|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
fr.esrf.tangoatk.widget.util.interlock.NetEditorFrame
public class NetEditorFrame
A Frame for the NetEditor. This class is a good base class to create specific network editor. By default, It constructs all menus needed by the NetEditor and its toolbar.
All actions are handled by this frame. So you can override actionPerformed() to get the control on a menu item or a button. Ex: overriding the 'load' menu item action
public void actionPerformed(ActionEvent evt) {
if( evt.getSource() == getFileMenuItem(NetEditorFrame.FILE_LOAD) ) {
...
} else {
super.actionPerformed(evt);
}
}
You can also add or remove menu items or toolbar buttons. Here is an example of code that customize the option menu :
traceMode = NetUtils.createMenuItem("Trace mode",0,0,this);
editMode = NetUtils.createMenuItem("Edit mode",0,0,this);
getOptionMenu().add(traceMode,0);
getOptionMenu().add(editMode,1);
getOptionMenu().add(new JSeparator(),2);
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JFrame |
|---|
javax.swing.JFrame.AccessibleJFrame |
| Nested classes/interfaces inherited from class java.awt.Frame |
|---|
java.awt.Frame.AccessibleAWTFrame |
| Nested classes/interfaces inherited from class java.awt.Window |
|---|
java.awt.Window.AccessibleAWTWindow |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
java.awt.Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
static int |
EDIT_COPY
|
static int |
EDIT_CUT
|
static int |
EDIT_DELETE
|
static int |
EDIT_PASTE
|
static int |
EDIT_REDO
|
static int |
EDIT_SELECT_ALL
|
static int |
EDIT_SELECT_NONE
|
static int |
EDIT_UNDO
|
static int |
FILE_EXIT
|
static int |
FILE_LOAD
|
static int |
FILE_NEW
|
static int |
FILE_SAVE
|
static int |
FILE_SAVEAS
|
static int |
OPTION_FIT
|
static int |
OPTION_PREF
|
static int |
TOOL_BUBBLE
|
static int |
TOOL_LABEL
|
static int |
TOOL_LINK
|
static int |
TOOL_REDO
|
static int |
TOOL_UNDO
|
| Fields inherited from class javax.swing.JFrame |
|---|
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled |
| Fields inherited from class java.awt.Frame |
|---|
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface javax.swing.WindowConstants |
|---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
NetEditorFrame()
Construct a frame for the NetEditor. |
|
| Method Summary | |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent evt)
|
void |
cancelCreate(NetEditor src)
Clear the help label when the creation mode is aborted |
javax.swing.JButton |
createIconButton(java.lang.String resPath,
java.lang.String preffix,
java.lang.String toolTip,
java.awt.event.ActionListener l)
Create an icon button. |
void |
exitApp()
Ask to save if the current scheme has unsaved modification before exiting. |
javax.swing.JMenu |
getEditMenu()
Returns the edit menu. |
javax.swing.JMenuItem |
getEditMenuItem(int which)
Returns a reference to the specified menu item of the edit menu. |
javax.swing.JMenu |
getFileMenu()
Returns the file menu. |
javax.swing.JMenuItem |
getFileMenuItem(int which)
Returns a reference to the specified menu item of the file menu. |
javax.swing.JLabel |
getHelpLabel()
Returns a reference to the help label |
javax.swing.JMenu |
getOptionMenu()
Returns the option menu. |
javax.swing.JMenuItem |
getOptionMenuItem(int which)
Returns a reference to the specified menu item of the option menu. |
javax.swing.JScrollPane |
getScrollPane()
Return the JScrollPane that contains the NetEditor object |
javax.swing.JButton |
getToobarButton(int which)
Returns a reference to the specified button of the toolbar. |
javax.swing.JToolBar |
getToolbar()
Returns the default toolbar |
void |
linkClicked(NetEditor src,
NetObject obj,
int childIdx,
java.awt.event.MouseEvent e)
Trigerred when the user click on a link if the editor is not editable. |
static void |
main(java.lang.String[] args)
Main function which launch the default NerEditor . |
void |
objectClicked(NetEditor src,
NetObject obj,
java.awt.event.MouseEvent e)
Trigerred when the user click on an object only if the editor is not editable. |
void |
setAppTitle(java.lang.String appName)
Sets the app name used to build the frame title. |
void |
setEditor(NetEditor editor)
Sets the NetEditor. |
void |
sizeChanged(NetEditor src,
java.awt.Dimension d)
Revalidate the inner ScrollPane |
void |
valueChanged(NetEditor src)
Update the title bar with the filename and the apptitle when the scheme change . |
| Methods inherited from class javax.swing.JFrame |
|---|
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
| Methods inherited from class java.awt.Frame |
|---|
addNotify, finalize, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
| Methods inherited from class java.awt.Window |
|---|
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setAlwaysOnTop, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationByPlatform, setLocationRelativeTo, show, toBack, toFront |
| Methods inherited from class java.awt.Container |
|---|
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
| Methods inherited from class java.awt.Component |
|---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.awt.MenuContainer |
|---|
getFont, postEvent |
| Field Detail |
|---|
public static final int FILE_NEW
public static final int FILE_LOAD
public static final int FILE_SAVE
public static final int FILE_SAVEAS
public static final int FILE_EXIT
public static final int EDIT_UNDO
public static final int EDIT_REDO
public static final int EDIT_CUT
public static final int EDIT_COPY
public static final int EDIT_PASTE
public static final int EDIT_DELETE
public static final int EDIT_SELECT_ALL
public static final int EDIT_SELECT_NONE
public static final int OPTION_FIT
public static final int OPTION_PREF
public static final int TOOL_BUBBLE
public static final int TOOL_LABEL
public static final int TOOL_LINK
public static final int TOOL_UNDO
public static final int TOOL_REDO
| Constructor Detail |
|---|
public NetEditorFrame()
setEditor(fr.esrf.tangoatk.widget.util.interlock.NetEditor)| Method Detail |
|---|
public void setEditor(NetEditor editor)
editor - NetEditor objectpublic void setAppTitle(java.lang.String appName)
appName - application namevalueChanged(fr.esrf.tangoatk.widget.util.interlock.NetEditor)public javax.swing.JMenu getFileMenu()
public javax.swing.JMenuItem getFileMenuItem(int which)
which - Menu identifierFILE_NEW,
FILE_LOAD,
FILE_SAVE,
FILE_SAVEAS,
FILE_EXITpublic javax.swing.JMenu getEditMenu()
public javax.swing.JMenuItem getEditMenuItem(int which)
which - Menu identifierEDIT_UNDO,
EDIT_REDO,
EDIT_CUT,
EDIT_COPY,
EDIT_PASTE,
EDIT_DELETE,
EDIT_SELECT_ALL,
EDIT_SELECT_NONEpublic javax.swing.JMenu getOptionMenu()
public javax.swing.JMenuItem getOptionMenuItem(int which)
which - Menu identifierOPTION_FIT,
OPTION_PREFpublic javax.swing.JToolBar getToolbar()
public javax.swing.JButton getToobarButton(int which)
which - Button identifierTOOL_BUBBLE,
TOOL_LABEL,
TOOL_LINK,
TOOL_UNDO,
TOOL_REDOpublic javax.swing.JLabel getHelpLabel()
public javax.swing.JScrollPane getScrollPane()
public void exitApp()
public javax.swing.JButton createIconButton(java.lang.String resPath,
java.lang.String preffix,
java.lang.String toolTip,
java.awt.event.ActionListener l)
resPath - Resource path (ended with a '/')preffix - Preffix of gif filestoolTip - Tooltip textl - ActionListener
public void valueChanged(NetEditor src)
valueChanged in interface NetEditorListenersrc - NetEditorsetAppTitle(java.lang.String)
public void objectClicked(NetEditor src,
NetObject obj,
java.awt.event.MouseEvent e)
NetEditorListener
objectClicked in interface NetEditorListenersrc - NetEditor that has trigerred the event.obj - Clicked object.e - Original MouseEventNetEditor.setEditable(boolean)
public void linkClicked(NetEditor src,
NetObject obj,
int childIdx,
java.awt.event.MouseEvent e)
NetEditorListener
linkClicked in interface NetEditorListenersrc - NetEditor that has trigerred the event.obj - Clicked object.childIdx - Child index.e - Original MouseEventNetEditor.setEditable(boolean)
public void sizeChanged(NetEditor src,
java.awt.Dimension d)
sizeChanged in interface NetEditorListenersrc - NetEditor that has trigerred the event.d - New dimension (in pixel coordinates)NetEditor.computePreferredSize(),
NetEditor.loadFile(java.lang.String)public void cancelCreate(NetEditor src)
cancelCreate in interface NetEditorListenersrc - NetEditor that has trigerred the event.NetEditor.setEditable(boolean)public void actionPerformed(java.awt.event.ActionEvent evt)
actionPerformed in interface java.awt.event.ActionListenerpublic static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||