fr.emn.inputeditor
Class JDeskView

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byfr.emn.inputeditor.JDeskView
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.event.KeyListener, java.awt.MenuContainer, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, ProxyListener, java.io.Serializable

public class JDeskView
extends javax.swing.JComponent
implements java.awt.event.ActionListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.KeyListener, ProxyListener

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
static boolean antiAliased
           
static boolean automaticSelection
           
static int circuitStyle
           
static int dragThreshold
           
static boolean easyLinkRemoving
           
static boolean easyObjectRemoving
           
static int MAX_GHOST_DEPTH
           
static boolean roundedShapes
           
static boolean showNodeStates
           
static boolean showShadows
           
static boolean showShortcuts
           
static double snapValue
           
static boolean supertypeShapes
           
static boolean typeShapes
           
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
JDeskView(JInputEditor editor)
          Constructor.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Processes actions such as pressing a toolbar button (zoom, show slots,...).
 void addDesk(java.lang.String fileName, LiteDesk desk)
           
 LiteXOR addXOR(LiteXOR object)
           
 void close(LiteDesk desk)
          close file
 LiteUnion createUnion(java.util.Vector v)
          Creates a union, and selects it
 LiteDesk currentDesk()
           
 void deskStarted(LiteDesk d)
           
 void deskStopped(LiteDesk d)
           
 void doAction(java.lang.String action)
           
protected  void doBeginDrag(java.awt.event.MouseEvent e)
          Called by mouseDragged(MouseEvent e) the first time the mouse is dragged since the button has been pressed.
protected  void doClick(java.awt.event.MouseEvent e)
          Called by mouseReleased(MouseEvent e)
protected  void doDrag(java.awt.event.MouseEvent e)
          Called by mouseDragged(MouseEvent e)
protected  void doEndDrag(java.awt.event.MouseEvent e)
          Called by mouseDragged(MouseEvent e)
protected  void doPress(java.awt.event.MouseEvent e)
          Called my mousePressed
protected  void doRelease(java.awt.event.MouseEvent e)
          Called by mouseReleased(MouseEvent e)
protected  void doRepaints()
          Repaints the dirty regions of this component.
 void dropNode(LiteNode l, LiteGhost layout, boolean singleNode)
          A new node has just been dragged to the desk - perform some things.
 void editNodeLabel(LiteLabel l)
           
 void endExternDragTMP()
          Not used
 void expandSlot(LiteSlot slot, boolean expand)
           
 java.awt.Graphics2D get2D()
           
 java.awt.Point getCenter()
          Returns the component's center.
 LiteDesk[] getDesks()
           
protected  int getManipulation(Manipulable m, java.awt.event.InputEvent e)
          Returns the state of interaction (manipulation) according to the value of modifiers & the object's manipulation capabilities.
 java.lang.String getToolTipText(java.awt.event.MouseEvent e)
           
 boolean helpMode()
           
 boolean isFocusTraversable()
          returns true.
 void keyPressed(java.awt.event.KeyEvent e)
           MODIFIERS : Calls updateNodeOperation() with event's modifiers.
 void keyReleased(java.awt.event.KeyEvent e)
           MODIFIERS : Calls updateNodeOperation() with event's modifiers.
 void keyTyped(java.awt.event.KeyEvent e)
          Does nothing.
 void load(LiteDesk desk, java.io.File icFile)
          Load an existing configuration
 void mouseClicked(java.awt.event.MouseEvent e)
           
 void mouseDragged(java.awt.event.MouseEvent e)
          If drag is higher than threshold, this method delegates event processing to doBeginDrag(MouseEvent e), then doDrag(MouseEvent e).
 void mouseEntered(java.awt.event.MouseEvent e)
          NOT USED
 void mouseExited(java.awt.event.MouseEvent e)
          ?
 void mouseMoved(java.awt.event.MouseEvent e)
          Calls updateDevelopedNode() if necessary.
 void mousePressed(java.awt.event.MouseEvent e)
          Event processing
 void mouseReleased(java.awt.event.MouseEvent e)
          this method delegates event processing to doRelease(MouseEvent e) or doDragEnd(MouseEvent e).
 void moveObject(Lite lite, LiteGhost dest)
          Moves a Lite objet (LiteLink, LiteNode).
 void nodesFailed(LiteDesk d, LiteNode[] n)
           
 void nodesOpened(LiteDesk d, LiteNode[] n)
           
 void paint(java.awt.Graphics g)
          JComponent's paint method.
 MyPickedList pickPoint(java.awt.Point p, int size)
           
 MyPickedList pickPoint(java.awt.Point p, int size, int strategy)
           
 void rebuild(LiteDesk desk)
           
 void rebuild(LiteDesk desk, java.lang.String newScript)
           
 void removeAllXOR()
           
 void removeDesk(LiteDesk desk)
           
 void removeXOR(LiteXOR object)
           
 void repaint(Lite object)
          Repaints a Lite object as soon as possible.
 void repaint(java.util.Vector v)
          Repaints a vector of Lite objects as soon as possible.
 boolean save(LiteDesk desk, java.io.File icFile)
          Save current configuration to a file
 boolean saveXML(LiteDesk desk, java.io.File icFile)
          Save current configuration to an XML file
 void setCurrentDesk(LiteDesk desk)
           
 void setFastDrawingMode(boolean value)
           
 void setHelpMode(boolean helpMode)
           
 void startDesk(LiteDesk d, boolean withStats)
           
 void toFront(Lite lite)
          Puts a lite to foreground
 void toggleExpandSlot(LiteSlot slot)
           
 void updateFisheye(java.awt.event.InputEvent e)
           
 void zoomAction(double zoomFactor)
           
 void zoomActionStart()
           
 void zoomActionStop()
           
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

automaticSelection

public static boolean automaticSelection

easyObjectRemoving

public static boolean easyObjectRemoving

easyLinkRemoving

public static boolean easyLinkRemoving

dragThreshold

public static int dragThreshold

circuitStyle

public static int circuitStyle

antiAliased

public static boolean antiAliased

showShadows

public static boolean showShadows

roundedShapes

public static boolean roundedShapes

typeShapes

public static boolean typeShapes

supertypeShapes

public static boolean supertypeShapes

showShortcuts

public static boolean showShortcuts

showNodeStates

public static boolean showNodeStates

snapValue

public static double snapValue

MAX_GHOST_DEPTH

public static final int MAX_GHOST_DEPTH
See Also:
Constant Field Values
Constructor Detail

JDeskView

public JDeskView(JInputEditor editor)
Constructor. Sets default size and color values for the JComponent, and adds listeners.

Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Processes actions such as pressing a toolbar button (zoom, show slots,...).

Specified by:
actionPerformed in interface java.awt.event.ActionListener

addDesk

public void addDesk(java.lang.String fileName,
                    LiteDesk desk)

addXOR

public LiteXOR addXOR(LiteXOR object)

close

public void close(LiteDesk desk)
close file


createUnion

public LiteUnion createUnion(java.util.Vector v)
Creates a union, and selects it


currentDesk

public LiteDesk currentDesk()

doAction

public void doAction(java.lang.String action)

rebuild

public void rebuild(LiteDesk desk)

rebuild

public void rebuild(LiteDesk desk,
                    java.lang.String newScript)

startDesk

public void startDesk(LiteDesk d,
                      boolean withStats)

doPress

protected void doPress(java.awt.event.MouseEvent e)
Called my mousePressed


doBeginDrag

protected void doBeginDrag(java.awt.event.MouseEvent e)
Called by mouseDragged(MouseEvent e) the first time the mouse is dragged since the button has been pressed.


doClick

protected void doClick(java.awt.event.MouseEvent e)
Called by mouseReleased(MouseEvent e)


doDrag

protected void doDrag(java.awt.event.MouseEvent e)
Called by mouseDragged(MouseEvent e)


doEndDrag

protected void doEndDrag(java.awt.event.MouseEvent e)
Called by mouseDragged(MouseEvent e)


doRelease

protected void doRelease(java.awt.event.MouseEvent e)
Called by mouseReleased(MouseEvent e)


toggleExpandSlot

public void toggleExpandSlot(LiteSlot slot)

expandSlot

public void expandSlot(LiteSlot slot,
                       boolean expand)

toFront

public void toFront(Lite lite)
Puts a lite to foreground


doRepaints

protected void doRepaints()
Repaints the dirty regions of this component.


dropNode

public void dropNode(LiteNode l,
                     LiteGhost layout,
                     boolean singleNode)
A new node has just been dragged to the desk - perform some things.


editNodeLabel

public void editNodeLabel(LiteLabel l)

endExternDragTMP

public void endExternDragTMP()
Not used


get2D

public java.awt.Graphics2D get2D()

getCenter

public java.awt.Point getCenter()
Returns the component's center. Used when zooming the whole desk.


getDesks

public LiteDesk[] getDesks()

getManipulation

protected int getManipulation(Manipulable m,
                              java.awt.event.InputEvent e)
Returns the state of interaction (manipulation) according to the value of modifiers & the object's manipulation capabilities.


getToolTipText

public java.lang.String getToolTipText(java.awt.event.MouseEvent e)

helpMode

public boolean helpMode()

isFocusTraversable

public boolean isFocusTraversable()
returns true.


keyPressed

public void keyPressed(java.awt.event.KeyEvent e)

MODIFIERS : Calls updateNodeOperation() with event's modifiers.

DELETE : Deletes selected object

Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)

MODIFIERS : Calls updateNodeOperation() with event's modifiers.

Specified by:
keyReleased in interface java.awt.event.KeyListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Does nothing.

Specified by:
keyTyped in interface java.awt.event.KeyListener

load

public void load(LiteDesk desk,
                 java.io.File icFile)
Load an existing configuration


mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
If drag is higher than threshold, this method delegates event processing to doBeginDrag(MouseEvent e), then doDrag(MouseEvent e).

Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
NOT USED

Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
?

Specified by:
mouseExited in interface java.awt.event.MouseListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
Calls updateDevelopedNode() if necessary.

Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Event processing

Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
this method delegates event processing to doRelease(MouseEvent e) or doDragEnd(MouseEvent e).

Specified by:
mouseReleased in interface java.awt.event.MouseListener

moveObject

public void moveObject(Lite lite,
                       LiteGhost dest)
Moves a Lite objet (LiteLink, LiteNode).


paint

public void paint(java.awt.Graphics g)
JComponent's paint method. Called by the window manager. (When called by update, draws on a graphic buffer).


pickPoint

public MyPickedList pickPoint(java.awt.Point p,
                              int size)

pickPoint

public MyPickedList pickPoint(java.awt.Point p,
                              int size,
                              int strategy)

removeAllXOR

public void removeAllXOR()

removeDesk

public void removeDesk(LiteDesk desk)

removeXOR

public void removeXOR(LiteXOR object)

repaint

public void repaint(Lite object)
Repaints a Lite object as soon as possible.


repaint

public void repaint(java.util.Vector v)
Repaints a vector of Lite objects as soon as possible.


save

public boolean save(LiteDesk desk,
                    java.io.File icFile)
Save current configuration to a file


saveXML

public boolean saveXML(LiteDesk desk,
                       java.io.File icFile)
Save current configuration to an XML file


setCurrentDesk

public void setCurrentDesk(LiteDesk desk)

setHelpMode

public void setHelpMode(boolean helpMode)

zoomAction

public void zoomAction(double zoomFactor)

zoomActionStart

public void zoomActionStart()

zoomActionStop

public void zoomActionStop()

nodesOpened

public void nodesOpened(LiteDesk d,
                        LiteNode[] n)
Specified by:
nodesOpened in interface ProxyListener

nodesFailed

public void nodesFailed(LiteDesk d,
                        LiteNode[] n)
Specified by:
nodesFailed in interface ProxyListener

deskStarted

public void deskStarted(LiteDesk d)
Specified by:
deskStarted in interface ProxyListener

deskStopped

public void deskStopped(LiteDesk d)
Specified by:
deskStopped in interface ProxyListener

setFastDrawingMode

public void setFastDrawingMode(boolean value)

updateFisheye

public void updateFisheye(java.awt.event.InputEvent e)