fr.esrf.tangoatk.widget.util.jdraw
Class JDrawEditorFrame

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Window
              extended by java.awt.Frame
                  extended by javax.swing.JFrame
                      extended by fr.esrf.tangoatk.widget.util.jdraw.JDrawEditorFrame
All Implemented Interfaces:
JDrawEditorListener, JDValueListener, java.awt.event.ActionListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants

public class JDrawEditorFrame
extends javax.swing.JFrame
implements java.awt.event.ActionListener, JDrawEditorListener, JDValueListener

Main JDrawEditor frame, can be extended to produce customized editor. This class creates all menu and button needed by the editor. All actions are handled by this class and can be overrided by overriding actionPerformed().

See Also:
Serialized Form

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
 JDCreationMenu createMenu
          Creation menus.
 javax.swing.JMenuItem editCopyMenuItem
          Edit->Copy menu item.
 javax.swing.JMenuItem editCutMenuItem
          Edit->Cut menu item.
 javax.swing.JMenuItem editDeleteMenuItem
          Edit->Delete menu item.
 javax.swing.JMenu editMenu
          Edit menu.
 javax.swing.JMenuItem editPasteMenuItem
          Edit->Paste menu item.
 javax.swing.JMenuItem editRedoMenuItem
          Edit->Redo menu item.
 javax.swing.JMenuItem editSelectAllMenuItem
          Edit->Select All menu item.
 javax.swing.JMenuItem editSelectNoneMenuItem
          Edit->Select None menu item.
 javax.swing.JMenuItem editSelectNVMenuItem
          Edit->Select Not visible menu item.
 javax.swing.JButton editToolAlignBottomBtn
          'Align Bottom' toolbar button.
 javax.swing.JButton editToolAlignLeftBtn
          'Align Left' toolbar button.
 javax.swing.JButton editToolAlignRightBtn
          'Align Right' toolbar button.
 javax.swing.JButton editToolAlignTopBtn
          'Align Top' toolbar button.
 javax.swing.JToolBar editToolBar
          The Edition toolbar toolbar.
 javax.swing.JButton editToolCopyBtn
          'Copy' toolbar button.
 javax.swing.JButton editToolCutBtn
          'Cut' toolbar button.
 javax.swing.JButton editToolFileOpenBtn
          'Open' toolbar button.
 javax.swing.JButton editToolFileSaveBtn
          'Save' toolbar button.
 javax.swing.JButton editToolHMirrorBtn
          'H Mirror' toolbar button.
 javax.swing.JButton editToolOptionBtn
          'Object properties' toolbar button.
 javax.swing.JButton editToolPasteBtn
          'Paste' toolbar button.
 javax.swing.JButton editToolRedoBtn
          'Redo' toolbar button.
 javax.swing.JButton editToolTransformBtn
          'Transform' toolbar button.
 javax.swing.JButton editToolUndoBtn
          'Undo' toolbar button.
 javax.swing.JButton editToolVMirrorBtn
          'V Mirror' toolbar button.
 javax.swing.JButton editToolZoomInBtn
          'Zoom In' toolbar button.
 javax.swing.JLabel editToolZoomLabel
          'Zoom percent' toolbar label.
 javax.swing.JButton editToolZoomOutBtn
          'Zoom Out' toolbar button.
 javax.swing.JMenuItem editUndoMenuItem
          Edit->Undo menu item.
 javax.swing.JMenuItem fileExitMenuItem
          File->Exit menu item.
 javax.swing.JMenuItem fileImportMenuItem
          File->Import menu item.
 javax.swing.JMenu fileMenu
          File menu.
 javax.swing.JMenuItem fileOpenMenuItem
          File->Open menu item.
 javax.swing.JMenuItem fileSaveasMenuItem
          File->Save as menu item.
 javax.swing.JMenuItem fileSaveMenuItem
          File->Save menu item.
 javax.swing.JLabel statusLabel
          The status label (display at the bottom of the frame).
 javax.swing.JScrollPane theEditorView
          The editor scroll view.
 javax.swing.JMenuItem toolsAlignbottomMenuItem
          Tools->Align bottom menu item.
 javax.swing.JMenuItem toolsAlignleftMenuItem
          Tools->Align left menu item.
 javax.swing.JMenuItem toolsAlignrightMenuItem
          Tools->Align rigth item.
 javax.swing.JMenuItem toolsAligntopMenuItem
          Tools->Align top menu item.
 javax.swing.JMenuItem toolsHMirrorMenuItem
          Tools->H Mirror menu item.
 javax.swing.JMenu toolsMenu
          Tools menu.
 javax.swing.JMenuItem toolsVMirrorMenuItem
          Tools->V Mirror menu item.
 javax.swing.JMenuItem viewsBrowseMenuItem
          Views->Browse menu item.
 javax.swing.JMenu viewsMenu
          Views menu.
 javax.swing.JMenuItem viewsOptionMenuItem
          Views->Object properties menu item.
 javax.swing.JMenuItem viewsPlayMenuItem
          Views->Play menu item.
 javax.swing.JMenuItem viewsTangoSynopticMenuItem
          Views->Tango Synoptic menu item.
 javax.swing.JMenuItem viewsTransformMenuItem
          Views->Transform menu item.
 
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
JDrawEditorFrame()
          Contruct an Editor frame.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void clipboardChanged()
          Called when the clipboard change , after a copy/cut
 void creationDone()
          Called when the user end the creation mode
 void exitApp()
          Ask to save if some modifications are still unsaved then exit the application.
static void main(java.lang.String[] args)
          Main function of the Jdraw editor.
protected  void processWindowEvent(java.awt.event.WindowEvent e)
           
 void selectionChanged()
          Called when the selection change
 void setAppTitle(java.lang.String title)
          Name used to build the frame title.
 void setEditor(JDrawEditor editor)
          Sets the editor of this EditorFrame.
 void setLibraries(java.lang.String path)
           
 void setPlayer(JDrawEditor editor)
          Sets the player of this EditorFrame.
 void sizeChanged()
          Called when the size of the editor change, usualy after a zoom or a load.
 void valueChanged()
          Called when the drawing currently edited change, also called after laoding a file.
 void valueChanged(JDObject src)
          Trigerred when the JDObject value change
 void valueExceedBounds(JDObject src)
          Trigerred when the JDObject value goes out of bounds and is reseted to its minimum value
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, 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

theEditorView

public javax.swing.JScrollPane theEditorView
The editor scroll view.


statusLabel

public javax.swing.JLabel statusLabel
The status label (display at the bottom of the frame).


fileMenu

public javax.swing.JMenu fileMenu
File menu.


fileOpenMenuItem

public javax.swing.JMenuItem fileOpenMenuItem
File->Open menu item.


fileImportMenuItem

public javax.swing.JMenuItem fileImportMenuItem
File->Import menu item.


fileSaveMenuItem

public javax.swing.JMenuItem fileSaveMenuItem
File->Save menu item.


fileSaveasMenuItem

public javax.swing.JMenuItem fileSaveasMenuItem
File->Save as menu item.


fileExitMenuItem

public javax.swing.JMenuItem fileExitMenuItem
File->Exit menu item.


editMenu

public javax.swing.JMenu editMenu
Edit menu.


editUndoMenuItem

public javax.swing.JMenuItem editUndoMenuItem
Edit->Undo menu item.


editRedoMenuItem

public javax.swing.JMenuItem editRedoMenuItem
Edit->Redo menu item.


editCutMenuItem

public javax.swing.JMenuItem editCutMenuItem
Edit->Cut menu item.


editCopyMenuItem

public javax.swing.JMenuItem editCopyMenuItem
Edit->Copy menu item.


editPasteMenuItem

public javax.swing.JMenuItem editPasteMenuItem
Edit->Paste menu item.


editDeleteMenuItem

public javax.swing.JMenuItem editDeleteMenuItem
Edit->Delete menu item.


editSelectAllMenuItem

public javax.swing.JMenuItem editSelectAllMenuItem
Edit->Select All menu item.


editSelectNVMenuItem

public javax.swing.JMenuItem editSelectNVMenuItem
Edit->Select Not visible menu item.


editSelectNoneMenuItem

public javax.swing.JMenuItem editSelectNoneMenuItem
Edit->Select None menu item.


viewsMenu

public javax.swing.JMenu viewsMenu
Views menu.


viewsTransformMenuItem

public javax.swing.JMenuItem viewsTransformMenuItem
Views->Transform menu item.


viewsPlayMenuItem

public javax.swing.JMenuItem viewsPlayMenuItem
Views->Play menu item.


viewsTangoSynopticMenuItem

public javax.swing.JMenuItem viewsTangoSynopticMenuItem
Views->Tango Synoptic menu item.


viewsOptionMenuItem

public javax.swing.JMenuItem viewsOptionMenuItem
Views->Object properties menu item.


viewsBrowseMenuItem

public javax.swing.JMenuItem viewsBrowseMenuItem
Views->Browse menu item.


toolsMenu

public javax.swing.JMenu toolsMenu
Tools menu.


toolsHMirrorMenuItem

public javax.swing.JMenuItem toolsHMirrorMenuItem
Tools->H Mirror menu item.


toolsVMirrorMenuItem

public javax.swing.JMenuItem toolsVMirrorMenuItem
Tools->V Mirror menu item.


toolsAligntopMenuItem

public javax.swing.JMenuItem toolsAligntopMenuItem
Tools->Align top menu item.


toolsAlignleftMenuItem

public javax.swing.JMenuItem toolsAlignleftMenuItem
Tools->Align left menu item.


toolsAlignbottomMenuItem

public javax.swing.JMenuItem toolsAlignbottomMenuItem
Tools->Align bottom menu item.


toolsAlignrightMenuItem

public javax.swing.JMenuItem toolsAlignrightMenuItem
Tools->Align rigth item.


createMenu

public JDCreationMenu createMenu
Creation menus.


editToolBar

public javax.swing.JToolBar editToolBar
The Edition toolbar toolbar.


editToolFileOpenBtn

public javax.swing.JButton editToolFileOpenBtn
'Open' toolbar button.


editToolFileSaveBtn

public javax.swing.JButton editToolFileSaveBtn
'Save' toolbar button.


editToolUndoBtn

public javax.swing.JButton editToolUndoBtn
'Undo' toolbar button.


editToolRedoBtn

public javax.swing.JButton editToolRedoBtn
'Redo' toolbar button.


editToolCutBtn

public javax.swing.JButton editToolCutBtn
'Cut' toolbar button.


editToolCopyBtn

public javax.swing.JButton editToolCopyBtn
'Copy' toolbar button.


editToolPasteBtn

public javax.swing.JButton editToolPasteBtn
'Paste' toolbar button.


editToolZoomInBtn

public javax.swing.JButton editToolZoomInBtn
'Zoom In' toolbar button.


editToolZoomOutBtn

public javax.swing.JButton editToolZoomOutBtn
'Zoom Out' toolbar button.


editToolZoomLabel

public javax.swing.JLabel editToolZoomLabel
'Zoom percent' toolbar label.


editToolOptionBtn

public javax.swing.JButton editToolOptionBtn
'Object properties' toolbar button.


editToolTransformBtn

public javax.swing.JButton editToolTransformBtn
'Transform' toolbar button.


editToolHMirrorBtn

public javax.swing.JButton editToolHMirrorBtn
'H Mirror' toolbar button.


editToolVMirrorBtn

public javax.swing.JButton editToolVMirrorBtn
'V Mirror' toolbar button.


editToolAlignLeftBtn

public javax.swing.JButton editToolAlignLeftBtn
'Align Left' toolbar button.


editToolAlignTopBtn

public javax.swing.JButton editToolAlignTopBtn
'Align Top' toolbar button.


editToolAlignRightBtn

public javax.swing.JButton editToolAlignRightBtn
'Align Right' toolbar button.


editToolAlignBottomBtn

public javax.swing.JButton editToolAlignBottomBtn
'Align Bottom' toolbar button.

Constructor Detail

JDrawEditorFrame

public JDrawEditorFrame()
Contruct an Editor frame.

See Also:
main(java.lang.String[])
Method Detail

setEditor

public void setEditor(JDrawEditor editor)
Sets the editor of this EditorFrame.


setPlayer

public void setPlayer(JDrawEditor editor)
Sets the player of this EditorFrame. (for the play mode)


setAppTitle

public void setAppTitle(java.lang.String title)
Name used to build the frame title.


setLibraries

public void setLibraries(java.lang.String path)

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

creationDone

public void creationDone()
Description copied from interface: JDrawEditorListener
Called when the user end the creation mode

Specified by:
creationDone in interface JDrawEditorListener

selectionChanged

public void selectionChanged()
Description copied from interface: JDrawEditorListener
Called when the selection change

Specified by:
selectionChanged in interface JDrawEditorListener

clipboardChanged

public void clipboardChanged()
Description copied from interface: JDrawEditorListener
Called when the clipboard change , after a copy/cut

Specified by:
clipboardChanged in interface JDrawEditorListener

valueChanged

public void valueChanged()
Description copied from interface: JDrawEditorListener
Called when the drawing currently edited change, also called after laoding a file.

Specified by:
valueChanged in interface JDrawEditorListener

sizeChanged

public void sizeChanged()
Description copied from interface: JDrawEditorListener
Called when the size of the editor change, usualy after a zoom or a load. Note: If the editor is within a JScrollPane, a called to revalidate on this ScrollPane is needed.

Specified by:
sizeChanged in interface JDrawEditorListener

valueChanged

public void valueChanged(JDObject src)
Description copied from interface: JDValueListener
Trigerred when the JDObject value change

Specified by:
valueChanged in interface JDValueListener

valueExceedBounds

public void valueExceedBounds(JDObject src)
Description copied from interface: JDValueListener
Trigerred when the JDObject value goes out of bounds and is reseted to its minimum value

Specified by:
valueExceedBounds in interface JDValueListener

exitApp

public void exitApp()
Ask to save if some modifications are still unsaved then exit the application. Called when the file exit menu is selected or when the frame is closed


processWindowEvent

protected void processWindowEvent(java.awt.event.WindowEvent e)
Overrides:
processWindowEvent in class javax.swing.JFrame

main

public static void main(java.lang.String[] args)
Main function of the Jdraw editor. You can create yourself the editor in order to customize it. Here is an example of a main function:

 public static void main(String[] args) {
   final JDrawEditor ed = new JDrawEditor(JDrawEditor.MODE_EDIT);
   final JDrawEditor py = new JDrawEditor(JDrawEditor.MODE_PLAY);
   JDrawableList.addClass("myClass");
   final JDrawEditorFrame jde = new JDrawEditorFrame();
   jde.setAppTitle("My Editor");
   jde.setEditor(ed);
   jde.setPlayer(py);
   ATKGraphicsUtils.centerFrameOnScreen(jde);
   jde.setVisible(true);
 }
   

Parameters:
args - Filename to be loaded