|
|||||||||
| 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.interlock.NetEditor
public class NetEditor
Network Editor component class. This class can be subclassed to create specific editor or viewer (not editable) component.
| 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 |
CREATE_BUBBLE
Editor is in bubble creation mode |
static int |
CREATE_LINK
Editor is in link creation mode |
static int |
CREATE_NONE
Selection mode (no creation) |
static int |
CREATE_TEXT
Editor is in text creation mode (Free label) |
| 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 | |
|---|---|
NetEditor()
Contruct a Network Editor. |
|
NetEditor(javax.swing.JFrame parent)
Contruct a Network Editor. |
|
| Method Summary | |
|---|---|
void |
addEditorListener(NetEditorListener l)
Add a NetEditor listener. |
boolean |
addObject(NetObject obj)
Add a NetObject to the editor. |
boolean |
canRedo()
Get redo state |
boolean |
canUndo()
Get undo state |
void |
clearEditorListener()
Clears the NetEditor listener list. |
void |
clearObjects()
Clear all object in the editor. |
void |
computePreferredSize()
Ask the editor to recompute it size. |
void |
copySelection()
copy current selection to the clipboard |
NetObject |
createBubbleObject(int x,
int y)
Called when the editor adds a bubble object to the network. |
void |
cutSelection()
move selection to clipbaord |
void |
deleteSelection()
delete current selection |
boolean |
getAntialiasFont()
Returns true if Anti-Aliased fonts are used, false otherwise |
java.lang.String |
getFileExtension()
Returns the file extension of this editor |
java.lang.String |
getFileName()
Returns the file name of the last laoded/saved net/xpss file |
java.awt.Dimension |
getGridSize()
Returns current grid size. |
boolean |
getNeedToSaveState()
Returns true if the scheme has been modified and need to be saved |
NetObject |
getNetObjectAt(int i)
Returns the NetObject at the specified index. |
int |
getNetObjectNumber()
Returns the number of NetObject in the editor |
javax.swing.JFrame |
getParentFrame()
Returns the parent frame or null |
java.lang.String |
getRedoActionName()
Get the name of the last action undone |
java.lang.String |
getUndoActionName()
Get the name of the last action performed |
boolean |
isEditable()
Returns true is this NetEditor is editable. |
boolean |
isShowingArrow()
Returns true if the editor is displaying arrow with link. |
void |
loadFile(java.lang.String fileName)
Load a Network file (net or xpss format) into the editor. |
void |
mouseClicked(java.awt.event.MouseEvent e)
|
void |
mouseClickedB1(java.awt.event.MouseEvent e)
|
void |
mouseClickedB3(java.awt.event.MouseEvent e)
|
void |
mouseDragged(java.awt.event.MouseEvent e)
|
void |
mouseEntered(java.awt.event.MouseEvent e)
|
void |
mouseExited(java.awt.event.MouseEvent e)
|
void |
mouseMoved(java.awt.event.MouseEvent e)
|
void |
mousePressed(java.awt.event.MouseEvent e)
|
void |
mousePressedB1(java.awt.event.MouseEvent e)
|
void |
mousePressedB3(java.awt.event.MouseEvent e)
|
void |
mouseReleased(java.awt.event.MouseEvent e)
|
void |
newAll()
Clear the whole editor.Clipbaord remains unchanged. |
void |
paint(java.awt.Graphics g)
Paint the component. |
void |
paintLinks(java.awt.Graphics2D g2)
Paint link of the scheme. |
void |
paintObjects(java.awt.Graphics2D g2)
Paint object of the scheme. |
void |
pasteSelection()
paste clipboard |
void |
redo()
Redo last canceled action |
void |
removeEditorListener(NetEditorListener l)
Remove a NetEditor listener. |
void |
removeObject(NetObject obj)
Remove a NetObject from the editor. |
void |
saveCurrent(java.lang.String defaultDir)
Save the current scheme. |
void |
saveNetFile(java.lang.String fileName)
Save the editor content to a net file. |
void |
selectAll()
Select all objects in the editor. |
void |
setAntialiasFont(boolean b)
Sets anti aliased font usage. |
void |
setCreateMode(int type)
Sets editor in creation mode. |
void |
setEditable(boolean b)
Sets the specified boolean to indicate whether or not this NetEditor should be editable. |
void |
setFileExtension(java.lang.String ext)
Sets the file extension for this editor. |
void |
setGridSize(java.awt.Dimension d)
Sets the grid size of this NetEditor. |
void |
setMoveableBubble(boolean b)
Allow the user to move bubble object even when the editor is not editable |
void |
setNetEditorDialog(NetEditorDlg dlg)
Sets the global option dialog. |
void |
setNetObjectDialog(NetObjectDlg dlg)
Sets the object properties dialog. |
void |
setShowArrow(boolean b)
Draws arrow with link. |
void |
showOpenFileDialog(java.lang.String defaultDir,
NetFileFilter filter)
Show the file selection box and call loadFile if a file is selected. |
void |
showOptionDialog()
Display the global option dialog |
void |
showSaveFileDialog(java.lang.String defaultDir,
NetFileFilter filter)
Show the file selection box and call saveNetFile if a file is selected. |
void |
undo()
Undo the last action |
void |
unselectAll()
Unselect all objects in the editor. |
| 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, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, 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, 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, setPreferredSize, 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 CREATE_NONE
public static final int CREATE_BUBBLE
public static final int CREATE_TEXT
public static final int CREATE_LINK
| Constructor Detail |
|---|
public NetEditor()
public NetEditor(javax.swing.JFrame parent)
parent - Parent frame| Method Detail |
|---|
public void setEditable(boolean b)
b - the boolean to be setisEditablepublic boolean isEditable()
setEditable(boolean)public void setFileExtension(java.lang.String ext)
ext - File extensionpublic java.lang.String getFileExtension()
public void loadFile(java.lang.String fileName)
throws java.io.IOException
fileName - filename to load
java.io.IOException - in case of failure (Contains the error message)NetEditorListener.sizeChanged(fr.esrf.tangoatk.widget.util.interlock.NetEditor, java.awt.Dimension),
NetEditorListener.valueChanged(fr.esrf.tangoatk.widget.util.interlock.NetEditor)
public void showOpenFileDialog(java.lang.String defaultDir,
NetFileFilter filter)
defaultDir - default directoryfilter - File filter, if null is specified a file filter is created with the file extension.loadFile(java.lang.String),
setFileExtension(java.lang.String),
NetEditorListener.valueChanged(fr.esrf.tangoatk.widget.util.interlock.NetEditor),
NetEditorListener.sizeChanged(fr.esrf.tangoatk.widget.util.interlock.NetEditor, java.awt.Dimension),
NetFileFilter.NetFileFilter(java.lang.String, java.lang.String[])
public void saveNetFile(java.lang.String fileName)
throws java.io.IOException
fileName - filename to save
java.io.IOException - in case of failure
public void showSaveFileDialog(java.lang.String defaultDir,
NetFileFilter filter)
defaultDir - default directoryfilter - File filter, if null is specified a file filter is created with the default file extension.NetEditorListener.valueChanged(fr.esrf.tangoatk.widget.util.interlock.NetEditor),
saveNetFile(java.lang.String),
setFileExtension(java.lang.String)public void saveCurrent(java.lang.String defaultDir)
defaultDir - default directory for filebox if no filename has been set.NetEditorListener.valueChanged(fr.esrf.tangoatk.widget.util.interlock.NetEditor),
saveNetFile(java.lang.String)public void setAntialiasFont(boolean b)
b - True to use Anti-Aliased fontpublic boolean getAntialiasFont()
public void unselectAll()
public void selectAll()
public void newAll()
public void setShowArrow(boolean b)
b - True to enable arrow.public boolean isShowingArrow()
public void setCreateMode(int type)
type - Type of object to be createdCREATE_NONE,
CREATE_BUBBLE,
CREATE_TEXT,
CREATE_LINK,
createBubbleObject(int, int)
public NetObject createBubbleObject(int x,
int y)
x - X coordinates (GRID coordinates)y - Y coordinates (GRID coordinates)
setCreateMode(int)public void cutSelection()
public void copySelection()
public void pasteSelection()
public void deleteSelection()
public boolean canUndo()
public java.lang.String getUndoActionName()
public java.lang.String getRedoActionName()
public boolean canRedo()
public void undo()
public void redo()
public void addEditorListener(NetEditorListener l)
l - Editor listener.NetEditorListenerpublic void removeEditorListener(NetEditorListener l)
l - Editor listener.NetEditorListenerpublic void clearEditorListener()
NetEditorListenerpublic boolean getNeedToSaveState()
public void computePreferredSize()
NetEditorListener.sizeChanged(fr.esrf.tangoatk.widget.util.interlock.NetEditor, java.awt.Dimension)public java.lang.String getFileName()
public NetObject getNetObjectAt(int i)
i - Object index
public void removeObject(NetObject obj)
obj - Object to be removedpublic boolean addObject(NetObject obj)
obj - Object to be added
public void clearObjects()
public int getNetObjectNumber()
public void showOptionDialog()
public void setNetEditorDialog(NetEditorDlg dlg)
public void setNetObjectDialog(NetObjectDlg dlg)
public void setMoveableBubble(boolean b)
public javax.swing.JFrame getParentFrame()
public void setGridSize(java.awt.Dimension d)
d - Grid dimensionpublic java.awt.Dimension getGridSize()
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface java.awt.event.MouseMotionListenerpublic void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved in interface java.awt.event.MouseMotionListenerpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenerpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListenerpublic void mouseClickedB3(java.awt.event.MouseEvent e)
public void mouseClickedB1(java.awt.event.MouseEvent e)
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenerpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenerpublic void mousePressedB1(java.awt.event.MouseEvent e)
public void mousePressedB3(java.awt.event.MouseEvent e)
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenerpublic void paintLinks(java.awt.Graphics2D g2)
public void paintLinks(Graphics2D g2) {
g2.setColor(Color.black);
for (int i = 0; i < getNetObjectNumber() ; i++) {
NetObject o = getNetObjectAt(i);
for (int j = 0; j < o.getChildrenNumber() ; j++ ) {
o.paintLink(g2,o.getChildAt(j),true);
}
}
}
g2 - Graphics objectpaintObjects(java.awt.Graphics2D)public void paintObjects(java.awt.Graphics2D g2)
public void paintObjects(Graphics2D g2) {
for (int i = 0; i < getNetObjectNumber() ; i++)
getNetObjectAt(i).paint(g2);
}
g2 - Graphics objectpaintLinks(java.awt.Graphics2D)public void paint(java.awt.Graphics g)
paint in class javax.swing.JComponentg - Graphics objectpaintLinks(java.awt.Graphics2D),
paintObjects(java.awt.Graphics2D)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||