|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
fr.esrf.tangoatk.widget.util.jdraw.JDrawEditor
fr.esrf.tangoatk.widget.jdraw.TangoSynopticHandler
public class TangoSynopticHandler
TangoSynopticHandler is the base class used to display and animate any tango synoptic drawing made with the JDraw drawing tool "JDraw". The drawing file is browsed and a behaviour is attached to each drawing component according to the tango object which is associated with. While brawsing the drawing file the name of the graphical component determines the associated tango object: For example if inside the synoptic drawing a simple rectangle is given the name "eas/test-api/1" it will be associated to the tango device eas/test-api/1. The animation on the graphical component depends on the type of the Tango object (device, attribute, command) and the type of JDraw graphical component (simple graphical component, multi-state JDraw object, interactive JDraw object) Here are the default (state) animations provided :
In addition to the animation a default interaction behaviour is provided (reaction to mouse clicks). Here are the default interactions :
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
javax.swing.JComponent.AccessibleJComponent |
| 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 |
TOOL_TIP_NAME
Displays device name within tooltip |
static int |
TOOL_TIP_NONE
Does not display tooltip |
static int |
TOOL_TIP_STATE
Displays device state within tooltip |
static int |
TOOL_TIP_STATUS
Displays device status within tooltip |
| Fields inherited from class fr.esrf.tangoatk.widget.util.jdraw.JDrawEditor |
|---|
CREATE_AXIS, CREATE_BAR, CREATE_CLIPBOARD, CREATE_ELLIPSE, CREATE_IMAGE, CREATE_LABEL, CREATE_LINE, CREATE_POLYLINE, CREATE_RECTANGLE, CREATE_RRECTANGLE, CREATE_SLIDER, CREATE_SPLINE, CREATE_SWINGOBJECT, MODE_EDIT, MODE_EDIT_GROUP, MODE_LIB, MODE_PLAY |
| 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 | |
|---|---|
TangoSynopticHandler()
Construct a TangoSynopticHandler (A JDrawEditor in MODE_PLAY). |
|
TangoSynopticHandler(java.lang.String jdFileName)
Construct a TangoSynopticHandler (A JDrawEditor in MODE_PLAY). |
|
TangoSynopticHandler(java.lang.String jdFileName,
ErrorHistory errh)
Construct a TangoSynopticHandler (A JDrawEditor in MODE_PLAY). |
|
TangoSynopticHandler(java.lang.String jdFileName,
int ttMode)
Construct a TangoSynopticHandler (A JDrawEditor in MODE_PLAY). |
|
| Method Summary | |
|---|---|
void |
booleanScalarChange(BooleanScalarEvent evt)
|
void |
devStateScalarChange(DevStateScalarEvent event)
|
void |
devStateSpectrumChange(DevStateSpectrumEvent evt)
|
void |
errorChange(ErrorEvent event)
|
AttributeList |
getAttributeList()
Returns a Handle to the global attribute list which is used internaly to monitor attributes. |
ErrorHistory |
getErrorHistoryWindow()
Returns the current error history window |
java.lang.String |
getSynopticFileName()
Returns the current synoptic filename. |
int |
getToolTipMode()
Returns the current Tooltip Mode |
protected boolean |
isAttribute(java.lang.String s)
Return true only if the given name matches a Tango attribute name. |
protected boolean |
isCommand(java.lang.String s)
Return true only if the given name matches a Tango command name. |
protected boolean |
isDevice(java.lang.String devName)
Return true only if the given name matches a Tango device name. |
protected boolean |
isSpectrumAttElement(java.lang.String s)
Return true only if the given name matches a Tango attribute name followed by [index]. |
void |
loadSynopticFromStream(java.io.InputStreamReader inp)
Load a jdraw grpahics input stream into the drawing area.The JLoox and Loox files formats are not supported. |
static void |
main(java.lang.String[] args)
|
void |
numberScalarChange(NumberScalarEvent evt)
|
protected void |
parseJdrawComponents()
Parses JDraw components , detects tango entity name and attatch a model. |
void |
setErrorHistoryWindow(ErrorHistory errh)
Sets the current error history window. |
void |
setSynopticFileName(java.lang.String jdFileName)
Reads the Jdraw file, browses and parses the synoptic components. |
void |
setToolTipMode(int ttMode)
Sets the current tooltip mode (device object only) |
void |
stateChange(AttributeStateEvent evt)
change the color of the jdobj (bg or fg) according to the quality factor of the attribute If and Only If the JDobject is not a JDBar, or JDSlider and no color mapper is set for the JDobject and the "extension" QualityFactor is true |
void |
stateChange(StateEvent event)
|
void |
statusChange(StatusEvent event)
|
void |
windowActivated(java.awt.event.WindowEvent e)
|
void |
windowClosed(java.awt.event.WindowEvent e)
|
void |
windowClosing(java.awt.event.WindowEvent e)
|
void |
windowDeactivated(java.awt.event.WindowEvent e)
|
void |
windowDeiconified(java.awt.event.WindowEvent e)
|
void |
windowIconified(java.awt.event.WindowEvent e)
|
void |
windowOpened(java.awt.event.WindowEvent e)
|
| Methods inherited from class javax.swing.JComponent |
|---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI |
| Methods inherited from class java.awt.Container |
|---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, 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 |
|---|
public static final int TOOL_TIP_NONE
public static final int TOOL_TIP_STATE
public static final int TOOL_TIP_STATUS
public static final int TOOL_TIP_NAME
| Constructor Detail |
|---|
public TangoSynopticHandler()
JDrawEditor.MODE_PLAY
public TangoSynopticHandler(java.lang.String jdFileName)
throws java.util.MissingResourceException,
java.io.FileNotFoundException,
java.lang.IllegalArgumentException
jdFileName - Filename of the JDraw (jdw) synptic to load.
java.util.MissingResourceException
java.io.FileNotFoundException
java.lang.IllegalArgumentExceptionsetSynopticFileName(java.lang.String)
public TangoSynopticHandler(java.lang.String jdFileName,
ErrorHistory errh)
throws java.util.MissingResourceException,
java.io.FileNotFoundException,
java.lang.IllegalArgumentException
jdFileName - Filename of the JDraw (jdw) synptic to load.errh - ErrorHistory window which will receive errors.
java.util.MissingResourceException
java.io.FileNotFoundException
java.lang.IllegalArgumentExceptionsetSynopticFileName(java.lang.String),
ErrorHistory
public TangoSynopticHandler(java.lang.String jdFileName,
int ttMode)
throws java.util.MissingResourceException,
java.io.FileNotFoundException,
java.lang.IllegalArgumentException
jdFileName - Filename of the JDraw (jdw) synptic to load.ttMode - Tooltip mode
java.util.MissingResourceException
java.io.FileNotFoundException
java.lang.IllegalArgumentExceptionTOOL_TIP_NONE,
TOOL_TIP_STATE,
TOOL_TIP_STATUS,
TOOL_TIP_NAME| Method Detail |
|---|
public int getToolTipMode()
setToolTipMode(int)public void setToolTipMode(int ttMode)
ttMode - Tooltip modeTOOL_TIP_NONE,
TOOL_TIP_STATE,
TOOL_TIP_STATUS,
TOOL_TIP_NAMEpublic ErrorHistory getErrorHistoryWindow()
setErrorHistoryWindow(fr.esrf.tangoatk.widget.util.ErrorHistory)public void setErrorHistoryWindow(ErrorHistory errh)
public java.lang.String getSynopticFileName()
getSynopticFileName()public AttributeList getAttributeList()
setSynopticFileName(java.lang.String)
public void loadSynopticFromStream(java.io.InputStreamReader inp)
throws java.io.IOException,
java.util.MissingResourceException
InputStreamReader - inp An InputStreamReader should be created by the application and passed to this method
java.io.IOException - Exception when the inputStream cannot be accessed.
java.util.MissingResourceException - when the "jdraw" inputStream cannot be parsed.
public void setSynopticFileName(java.lang.String jdFileName)
throws java.util.MissingResourceException,
java.io.FileNotFoundException,
java.lang.IllegalArgumentException
jdFileName - Filename of the JDraw (jdw) synptic to load.
java.util.MissingResourceException
java.io.FileNotFoundException
java.lang.IllegalArgumentExceptionprotected void parseJdrawComponents()
isDevice(java.lang.String),
isAttribute(java.lang.String),
isCommand(java.lang.String)protected boolean isAttribute(java.lang.String s)
Attribute name allowed syntax ( Can be preceded by tango: ):
Full syntax: //hostName:portNumber/domain/family/member/attName Full syntax: //ipAddress:portNumber/domain/family/member/attName Short syntax: domain/family/member/attName
s - Attribute nameprotected boolean isSpectrumAttElement(java.lang.String s)
Spectrum Attribute element allowed syntax ( Can be preceded by tango: ):
Full syntax: //hostName:portNumber/domain/family/member/attName[xx] Full syntax: //ipAddress:portNumber/domain/family/member/attName[xx] Short syntax: domain/family/member/attName[xx]
s - Spectrum Attribute elementprotected boolean isCommand(java.lang.String s)
Command name allowed syntax ( Can be preceded by tango: ):
Full syntax: //hostName:portNumber/domain/family/member/cmdName Full syntax: //ipAddress:portNumber/domain/family/member/cmdName Short syntax: domain/family/member/cmdName
s - Command nameprotected boolean isDevice(java.lang.String devName)
Device name allowed syntax ( Can be preceded by tango: ):
Full syntax: //hostName:portNumber/domain/family/member Full syntax: //ipAddress:portNumber/domain/family/member Short syntax: domain/family/member
devName - Device namepublic void windowClosed(java.awt.event.WindowEvent e)
windowClosed in interface java.awt.event.WindowListenerpublic void windowOpened(java.awt.event.WindowEvent e)
windowOpened in interface java.awt.event.WindowListenerpublic void windowClosing(java.awt.event.WindowEvent e)
windowClosing in interface java.awt.event.WindowListenerpublic void windowIconified(java.awt.event.WindowEvent e)
windowIconified in interface java.awt.event.WindowListenerpublic void windowDeiconified(java.awt.event.WindowEvent e)
windowDeiconified in interface java.awt.event.WindowListenerpublic void windowActivated(java.awt.event.WindowEvent e)
windowActivated in interface java.awt.event.WindowListenerpublic void windowDeactivated(java.awt.event.WindowEvent e)
windowDeactivated in interface java.awt.event.WindowListenerpublic void numberScalarChange(NumberScalarEvent evt)
numberScalarChange in interface INumberScalarListenerpublic void booleanScalarChange(BooleanScalarEvent evt)
booleanScalarChange in interface IBooleanScalarListenerpublic void devStateSpectrumChange(DevStateSpectrumEvent evt)
devStateSpectrumChange in interface IDevStateSpectrumListenerpublic void stateChange(AttributeStateEvent evt)
stateChange in interface IAttributeStateListenerpublic void errorChange(ErrorEvent event)
errorChange in interface IErrorListenerpublic void devStateScalarChange(DevStateScalarEvent event)
devStateScalarChange in interface IDevStateScalarListenerpublic void stateChange(StateEvent event)
stateChange in interface IStateListenerpublic void statusChange(StatusEvent event)
statusChange in interface IStatusListenerpublic static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||