madkit.utils.graphics
Class GraphicUtils

java.lang.Object
  extended by madkit.utils.graphics.GraphicUtils

public class GraphicUtils
extends java.lang.Object


Constructor Summary
GraphicUtils()
           
 
Method Summary
static void addMenuItem(java.awt.event.ActionListener al, javax.swing.JMenu m, java.lang.String label, java.lang.String command, int key)
           
static void addMenuItem(java.awt.event.ActionListener al, javax.swing.JMenu m, java.lang.String label, java.lang.String command, int key, int ckey)
           
static void addRadioButtonMenuItem(java.awt.event.ActionListener al, javax.swing.JMenu m, java.lang.String label, java.lang.String command, boolean b, javax.swing.ButtonGroup g)
           
static javax.swing.JButton addTool(java.awt.event.ActionListener al, javax.swing.JToolBar toolBar, java.lang.String name, java.lang.String descr, java.lang.String imageName)
           
static void debug(java.lang.Object s)
           
static void debug(java.lang.Object o, java.lang.Object s)
           
static void execute(java.lang.String url)
          Tries to launch the application associated to the file..
static java.lang.String getExtension(java.io.File f)
           
static java.awt.Container getFrameParent(java.awt.Container _c)
           
static java.awt.Frame getRealFrameParent(java.awt.Component c)
          get the Frame that surrounds a component.
static boolean isPopupTrigger(java.awt.event.MouseEvent evt)
          Returns if the specified event is the popup trigger event.
static boolean isWindowsPlatform()
          Try to determine whether this application is running under Windows or some other platform by examing the "os.name" property.
static void log(java.lang.String s)
           
static void requestFocus(java.awt.Window win, java.awt.Component comp)
          Focuses on the specified component as soon as the window becomes active.
static void showPopupMenu(javax.swing.JPopupMenu popup, java.awt.Component comp, int x, int y)
          Shows the specified popup menu, ensuring it is displayed within the bounds of the screen.
static void showPopupMenu(javax.swing.JPopupMenu popup, java.awt.Component comp, int x, int y, boolean point)
          Shows the specified popup menu, ensuring it is displayed within the bounds of the screen.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GraphicUtils

public GraphicUtils()
Method Detail

log

public static void log(java.lang.String s)

debug

public static void debug(java.lang.Object s)

debug

public static void debug(java.lang.Object o,
                         java.lang.Object s)

getExtension

public static java.lang.String getExtension(java.io.File f)

getRealFrameParent

public static java.awt.Frame getRealFrameParent(java.awt.Component c)
get the Frame that surrounds a component. May be used for buildings dialogs Ol: JF import


getFrameParent

public static java.awt.Container getFrameParent(java.awt.Container _c)

addMenuItem

public static void addMenuItem(java.awt.event.ActionListener al,
                               javax.swing.JMenu m,
                               java.lang.String label,
                               java.lang.String command,
                               int key)

addMenuItem

public static void addMenuItem(java.awt.event.ActionListener al,
                               javax.swing.JMenu m,
                               java.lang.String label,
                               java.lang.String command,
                               int key,
                               int ckey)

addTool

public static javax.swing.JButton addTool(java.awt.event.ActionListener al,
                                          javax.swing.JToolBar toolBar,
                                          java.lang.String name,
                                          java.lang.String descr,
                                          java.lang.String imageName)

addRadioButtonMenuItem

public static void addRadioButtonMenuItem(java.awt.event.ActionListener al,
                                          javax.swing.JMenu m,
                                          java.lang.String label,
                                          java.lang.String command,
                                          boolean b,
                                          javax.swing.ButtonGroup g)

requestFocus

public static void requestFocus(java.awt.Window win,
                                java.awt.Component comp)
Focuses on the specified component as soon as the window becomes active.

Parameters:
win - The window
comp - The component

isPopupTrigger

public static boolean isPopupTrigger(java.awt.event.MouseEvent evt)
Returns if the specified event is the popup trigger event. This implements precisely defined behavior, as opposed to MouseEvent.isPopupTrigger().

Parameters:
evt - The event Taken from jEdit 3.2pre8

showPopupMenu

public static void showPopupMenu(javax.swing.JPopupMenu popup,
                                 java.awt.Component comp,
                                 int x,
                                 int y)
Shows the specified popup menu, ensuring it is displayed within the bounds of the screen.

Parameters:
popup - The popup menu
comp - The component to show it for
x - The x co-ordinate
y - The y co-ordinate taken from jEdit 4.0pre1

showPopupMenu

public static void showPopupMenu(javax.swing.JPopupMenu popup,
                                 java.awt.Component comp,
                                 int x,
                                 int y,
                                 boolean point)
Shows the specified popup menu, ensuring it is displayed within the bounds of the screen.

Parameters:
popup - The popup menu
comp - The component to show it for
x - The x co-ordinate
y - The y co-ordinate
point - If true, then the popup originates from a single point; otherwise it will originate from the component itself. This affects positioning in the case where the popup does not fit onscreen. Taken from jEdit 4.0

execute

public static void execute(java.lang.String url)
Tries to launch the application associated to the file..

Parameters:
url: - the name of the file to be executed

isWindowsPlatform

public static boolean isWindowsPlatform()
Try to determine whether this application is running under Windows or some other platform by examing the "os.name" property.

Returns:
true if this application is running under a Windows OS


Copyright © Madkit Team (O. Gutknecht, J. Ferber, F. Michel et al.) All Rights Reserved.