|
|||||||||
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
simtools.diagram.DiagramComponent
public abstract class DiagramComponent
This class is an abstract diagram with editor functions such as zoom, grid, multiple selection, resize, copy/cut/paste, ... and a link capabilty betwwen the elements of the diagram
Nested Class Summary | |
---|---|
static interface |
DiagramComponent.ContextualDrawing
An interface for additional drawing to be performed in specific context |
static interface |
DiagramComponent.ContextualDrawingProvider
An interface implemented by diagram elements which provide a ContextualDrawing when mouse button 2 is pressed on them while they are selected |
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.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
protected DiagramAction |
_action
diagram action listener |
protected java.awt.Rectangle |
_autoScrollRect
a rectangle used to increase the diagram size automatically when the mouse is near the right or the bottom of the diagram |
protected javax.swing.undo.CompoundEdit |
_compoundEdit
This attribute is used by classes who need to register several undoable edits once for all (e.g translation and resize) |
protected DiagramConnection |
_connection
current link during linking operation |
protected static java.awt.BasicStroke |
_dashStroke
a stroked used to display the selection rectangle |
protected static java.awt.Color |
_defaultColor
the default color |
protected static java.awt.BasicStroke |
_defaultStroke
the default stroke |
protected boolean |
_dragging
true if dragging operation is in use |
protected java.awt.Point |
_dragPoint
coordiantes of the dragging start point |
protected static java.awt.Color |
_gridColor
the grid color |
protected java.lang.String |
_headerTitle
Deprecated. Use _param.headerTitle |
protected DiagramConnector |
_inputConnector
current link input during linking operation |
protected boolean |
_linking
true if linking operation is in use |
protected javax.swing.event.EventListenerList |
_listenerList
List of listeners, used by undo/redo feature |
protected DiagramConnector |
_outputConnector
current link ouput during linking operation |
protected DiagramParameters |
_param
diagram parameters (zoom, grid,...) |
protected javax.swing.JPopupMenu |
_popup
diagram popup menu called when the right mouse buttom is clicked |
protected boolean |
_printSelectionOnly
Do we print just the diagram selection or everything? |
protected int |
_resizeWay
resize way : N = 1, NE =2 , ... |
protected DiagramSelection |
_selection
diagram selection |
protected static java.awt.Color |
_selectionColor
the selection color |
protected java.awt.Dimension |
_size
the diagram size |
protected boolean |
_translating
true if translation operation is in use |
protected UndoHandler |
_undoHandler
The UndoHandler catches undoable edits and
sends them to the UndoManager |
protected javax.swing.undo.UndoManager |
_undoManager
|
protected boolean |
autofit
If autofit is true, the diagram shall automatically fill up all the space when put in a JViewPort If autofit is false, the diagram Default is true |
protected boolean |
canEdit
Can we edit the diagram Default is true |
protected DiagramComponent.ContextualDrawing |
contextualDrawing
The current contextual drawing |
protected boolean |
fullScreen
Full screen variable is true when this mode is active |
protected java.awt.GraphicsDevice |
fullScreenDevice
|
protected javax.swing.JFrame |
fullScreenFrame
|
protected boolean |
hasBeenModified
This attribute is true whenever the diagam component has been modified since last backup |
protected java.awt.Container |
windowedModeParent
|
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.print.Printable |
---|
NO_SUCH_PAGE, PAGE_EXISTS |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
DiagramComponent(DiagramParameters param)
Creates a new diagram |
Method Summary | |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
|
void |
addUndoableEventListener(javax.swing.event.UndoableEditListener listener)
Adds an UndoableEditListener to the list of event listeners,
to provide the component with undo/redo features. |
void |
adjust()
Adjusts the diagram size to take into account components at the left of the left margin or upper the top margin |
void |
align()
Aligns the selection on the grid |
protected double |
computePrintScaleFactor(java.awt.print.PageFormat pf)
Computes the scale factor between parameter space and paper coordinates |
protected abstract void |
copyAt(java.util.Vector v,
int x,
int y)
To copy a list of diagram elements at the given coordinates |
protected abstract DiagramConnection |
createConnection(DiagramConnector input,
int x,
int y)
This method is called to create a new link |
void |
createSelection()
Creates a default diagram selection |
void |
disableEditing(boolean s)
Enable/disable diagram editing |
protected abstract void |
drawClipboardElements(java.awt.Graphics2D g2,
java.awt.Point pMax)
This method is called by the drawDiagram method to perform the drawing of each clipboard elements |
protected abstract void |
drawConnection(java.awt.Graphics2D g2,
java.awt.Point pMax)
This method is called by the drawDiagram method to perform the drawing of a new link |
protected void |
drawDiagram(java.awt.Graphics2D g2)
Paints the diagram itself |
protected abstract void |
drawDiagramElements(java.awt.Graphics2D g2,
java.awt.Point pMax)
This method is called by the drawDiagram method to perform the drawing of each diagram elements |
void |
drawDiagramWithHeader(java.awt.Graphics2D g2)
Paints the diagram and a header |
protected void |
drawHeader(java.awt.Graphics2D g2)
|
void |
executeClipboardPaste()
Pastes the clipbaord content into the diagram |
void |
executeConnectionCreation()
Starts the creation of a link between a selected connector (input of the link) and a ouput connector to be selected later |
void |
executeNewElement()
Starts the creation of a new element This implementation creates nothing |
void |
executeSelectAll()
Select all the shapes |
void |
executeSelectConnectors()
Select the connectors connected to the selected elements This implementation selectes nothing |
void |
executeSelectionCopy()
Puts a copy of the selection into the clipbaord |
void |
executeSelectionCut()
Cuts the selection and put a copy into the clipbaord |
void |
executeSelectionDelete()
Erases the selection |
void |
fireUndoableEditUpdate(javax.swing.event.UndoableEditEvent event)
Notify all UndoableEditListener that an UndoableEditEvent
has happened. |
DiagramAction |
getAction()
Gets the diagram action listener |
DiagramComponent.ContextualDrawing |
getContextualDrawing()
Gets the current contextual drawing element |
int |
getDiagramHeight()
Gets the diagram start height |
java.awt.Point |
getDiagramMaxPoint(java.awt.Graphics2D g2)
Gets max size of the diagram if printed |
DiagramSelection |
getDiagramSelection()
Gets the selection |
int |
getDiagramWidth()
Gets the diagram start width |
int |
getGrid()
Gets the diagram grid step |
boolean |
getGridDisplay()
Gets the diagram grid display status |
int |
getHeaderHeight()
Gets the diagram header height for printing |
protected abstract void |
getMin(java.awt.Point p)
Gets the coordinates ot the element at the top left of the diagram |
java.lang.String |
getName()
Gets the name of the diagram |
DiagramParameters |
getParameters()
Get the diagram parameters |
javax.swing.JPopupMenu |
getPopupMenu()
Gets the diagram popup menu |
java.awt.Dimension |
getPreferredScrollableViewportSize()
Returns the preferred display size of a Canvas. |
int |
getScrollableBlockIncrement(java.awt.Rectangle visibleRect,
int orientation,
int direction)
Returns the amount for a block inrecment, which is the height or width of visibleRect , based on orientation . |
boolean |
getScrollableTracksViewportHeight()
Returns false to indicate that the height of the viewport does not determine the height of the table, unless the preferred height of the canvas is smaller than the viewports height. |
boolean |
getScrollableTracksViewportWidth()
Returns false to indicate that the width of the viewport does not determine the width of the table, unless the preferred width of the canvas is smaller than the viewports width. |
int |
getScrollableUnitIncrement(java.awt.Rectangle visibleRect,
int orientation,
int direction)
Returns the amount to increment when scrolling. |
java.util.Vector |
getSelection()
Gets the selection elements |
DiagramConnector |
getSelectionConnector()
Gets a connector form the selection If the first element in the selection is a connector then return this connector else return null. |
UndoHandler |
getUndoHandler()
|
int |
getXMargin()
Gets the diagram left and right margin |
int |
getYMargin()
Gets the diagram top and bottom margin |
double |
getZoom()
Gets the diagram zoom factor |
boolean |
hasBeenModified()
|
boolean |
hasHeader()
If we have a valid header |
boolean |
isAutofit()
|
boolean |
isEditingDisbled()
Check if diagram editing is disabled |
boolean |
isFullScreen()
|
static boolean |
isMouseButton2(java.awt.event.MouseEvent e)
|
boolean |
isSelectionEmpty()
Checks if selection is empty |
void |
mouseClicked(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 |
mouseReleased(java.awt.event.MouseEvent e)
|
void |
mouseWheelMoved(java.awt.event.MouseWheelEvent e)
|
void |
paint(java.awt.Graphics g)
Paints the diagram according to zoom and grid This methods setup the transformation, draw the grid and the call the drawDiagram method. |
protected abstract void |
performConnection(DiagramConnection c,
DiagramConnector input,
DiagramConnector output)
This method is called to connect a new link to its output connector |
int |
print(java.awt.Graphics g,
java.awt.print.PageFormat pf,
int pnum)
|
void |
printDiagram(java.awt.Graphics2D g2)
Paints the diagram itself |
protected abstract void |
printDiagramElements(java.awt.Graphics2D g2,
java.awt.Point pMax)
This method is called by the drawDiagram method to perform the printing of each diagram elements |
protected void |
registerActions()
|
void |
removeUndoableEventListener(javax.swing.event.UndoableEditListener listener)
Removes an UndoableEditListener from the list of event listeners. |
void |
repaint(java.awt.Rectangle r)
|
void |
repaint(java.awt.Rectangle r,
boolean withMargins)
|
protected void |
resizeEnd()
This method is called at the end of the resize of the selection i.e when the mouse is released |
void |
setAction(DiagramAction act)
Sets the diagram action listener Only one action listener is allowed |
void |
setAutofit(boolean autofit)
|
void |
setContextualDrawing(DiagramComponent.ContextualDrawing cd)
Install a new contextual drawing element |
void |
setDiagramSize(int w,
int h)
Sets the diagram start size |
void |
setFullScreen(boolean fullScreenState)
Use this function with "false" as argument to exit full screen mode. |
void |
setFullScreen(java.awt.GraphicsDevice device)
Use this method with a valid graphics device to enter full screen mode. |
void |
setGrid(int grid)
Sets the diagram grid step |
void |
setGridDisplay(boolean state)
Sets the diagram grid display status |
void |
setHasBeenModified(boolean hasBeenModified)
Set the diagram modification status |
void |
setHeader(java.lang.String header)
Sets the header for this diagram component |
void |
setHeaderHeight(int h)
Sets the diagram header height for printing |
void |
setMargin(int x,
int y)
Sets the diagram margins |
void |
setName(java.lang.String name)
Sets the name of the diagram |
void |
setPopupMenu(javax.swing.JPopupMenu menu)
Sets the digram popup menu |
void |
setSelectionPrintMode(boolean selectionOnly)
Sets the print mode |
void |
setZoom(double scale)
Sets the diagram zoom factor |
java.lang.String |
toString()
Gets the name of the diagram |
protected abstract void |
translate(int x,
int y)
Abstract method to translate the diagram elements |
protected abstract void |
translateConnection(DiagramConnection c,
int dx,
int dy)
This method is called to move the end of the link after creation |
protected void |
translationEnd()
This method is called at the end of the transaltion of the selection i.e when the mouse is released |
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, getBaseline, getBaselineResizeBehavior, 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, isPaintingForPrint, 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, 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, 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, setSize, setSize, show, show, size, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected static java.awt.BasicStroke _dashStroke
protected static java.awt.BasicStroke _defaultStroke
protected static java.awt.Color _gridColor
protected static java.awt.Color _selectionColor
protected static java.awt.Color _defaultColor
protected java.awt.Dimension _size
protected java.awt.Rectangle _autoScrollRect
protected boolean _dragging
protected java.awt.Point _dragPoint
protected boolean _linking
protected boolean _translating
protected int _resizeWay
protected DiagramConnection _connection
protected DiagramConnector _inputConnector
protected DiagramConnector _outputConnector
protected DiagramSelection _selection
protected boolean _printSelectionOnly
protected DiagramParameters _param
protected DiagramAction _action
protected javax.swing.JPopupMenu _popup
protected java.lang.String _headerTitle
protected boolean autofit
protected boolean canEdit
protected boolean fullScreen
protected java.awt.GraphicsDevice fullScreenDevice
protected javax.swing.JFrame fullScreenFrame
protected java.awt.Container windowedModeParent
protected transient javax.swing.event.EventListenerList _listenerList
protected transient UndoHandler _undoHandler
UndoHandler
catches undoable edits and
sends them to the UndoManager
protected transient javax.swing.undo.UndoManager _undoManager
protected transient javax.swing.undo.CompoundEdit _compoundEdit
protected DiagramComponent.ContextualDrawing contextualDrawing
DiagramComponent.ContextualDrawing
protected transient boolean hasBeenModified
Constructor Detail |
---|
public DiagramComponent(DiagramParameters param)
the
- diagram parametersMethod Detail |
---|
public void disableEditing(boolean s)
s
- true to disable editingpublic boolean isEditingDisbled()
public DiagramParameters getParameters()
public void setPopupMenu(javax.swing.JPopupMenu menu)
menu
- the new popup menupublic javax.swing.JPopupMenu getPopupMenu()
public void setAction(DiagramAction act)
act
- the listenerpublic DiagramAction getAction()
public void createSelection()
public java.lang.String getName()
getName
in class java.awt.Component
public boolean hasBeenModified()
public void setName(java.lang.String name)
setName
in class java.awt.Component
name
- the namepublic void setHasBeenModified(boolean hasBeenModified)
public java.lang.String toString()
toString
in class java.awt.Component
public boolean isAutofit()
public void setAutofit(boolean autofit)
autofit
- public int getXMargin()
public int getYMargin()
public void setMargin(int x, int y)
x
- the left and right marginy
- the top and bottom marginpublic int getHeaderHeight()
public void setHeaderHeight(int h)
h
- the heightpublic void setDiagramSize(int w, int h)
w
- the widthh
- the heightpublic int getDiagramWidth()
public int getDiagramHeight()
public void setGrid(int grid)
grid
- the step (if =0 then no grid)public void setGridDisplay(boolean state)
state
- =true to display the gridpublic int getGrid()
public boolean getGridDisplay()
public void setZoom(double scale)
scale
- the scale factorpublic double getZoom()
public void adjust()
public void align()
public void paint(java.awt.Graphics g)
paint
in class javax.swing.JComponent
g
- the current graphicspublic void repaint(java.awt.Rectangle r)
repaint
in class javax.swing.JComponent
public void repaint(java.awt.Rectangle r, boolean withMargins)
protected void drawDiagram(java.awt.Graphics2D g2)
g2
- the current graphicsprotected void drawHeader(java.awt.Graphics2D g2)
public void printDiagram(java.awt.Graphics2D g2)
g2
- the current graphicspublic java.awt.Point getDiagramMaxPoint(java.awt.Graphics2D g2)
g2
- the current graphics
public void setHeader(java.lang.String header)
header
- The diagram header to printpublic boolean hasHeader()
public void setSelectionPrintMode(boolean selectionOnly)
selectionOnly
- If true, will print only the selectionpublic void drawDiagramWithHeader(java.awt.Graphics2D g2)
g2
- the current graphicspublic void executeNewElement()
public void executeSelectAll()
public void executeSelectConnectors()
public void executeConnectionCreation()
public void executeSelectionCut()
public void executeSelectionDelete()
public void executeSelectionCopy()
public void executeClipboardPaste()
public boolean isSelectionEmpty()
public java.util.Vector getSelection()
public DiagramSelection getDiagramSelection()
public DiagramConnector getSelectionConnector()
protected abstract void translate(int x, int y)
x
- translation value along the X axisy
- translation value along the Y axisprotected abstract void getMin(java.awt.Point p)
p
- the coordinates to be compared with the elements coordinates
and to be modified if an element has lower coordinatesprotected abstract void copyAt(java.util.Vector v, int x, int y)
v
- a vector of diagram elementsx
- the x coordinate destinationy
- the y coordinate destinationprotected abstract void drawDiagramElements(java.awt.Graphics2D g2, java.awt.Point pMax)
g2
- the current graphicspMax
- the coordinates of the elements at the bottom rightprotected abstract void printDiagramElements(java.awt.Graphics2D g2, java.awt.Point pMax)
g2
- the current graphicspMax
- the coordinates of the elements at the bottom rightprotected abstract void drawClipboardElements(java.awt.Graphics2D g2, java.awt.Point pMax)
g2
- the current graphicspMax
- the coordinates of the elements at the bottom rightprotected abstract void drawConnection(java.awt.Graphics2D g2, java.awt.Point pMax)
g2
- the current graphicspMax
- the coordinates of the elements at the bottom rightprotected abstract DiagramConnection createConnection(DiagramConnector input, int x, int y)
input
- the input connectorx
- the end link x coordinatey
- the end link y coordinateprotected abstract void translateConnection(DiagramConnection c, int dx, int dy)
c
- the linkdx
- the end link move along x axisdy
- the end link moce along y axisprotected abstract void performConnection(DiagramConnection c, DiagramConnector input, DiagramConnector output)
c
- the linkinput
- the input connectoroutput
- the output connectorprotected void translationEnd()
protected void resizeEnd()
public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked
in interface java.awt.event.MouseListener
public void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
public void mousePressed(java.awt.event.MouseEvent e)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased
in interface java.awt.event.MouseListener
public void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void mouseMoved(java.awt.event.MouseEvent e)
mouseMoved
in interface java.awt.event.MouseMotionListener
public void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
mouseWheelMoved
in interface java.awt.event.MouseWheelListener
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
protected double computePrintScaleFactor(java.awt.print.PageFormat pf)
pf
- The PageFormat to se for printing
public int print(java.awt.Graphics g, java.awt.print.PageFormat pf, int pnum) throws java.awt.print.PrinterException
print
in interface java.awt.print.Printable
java.awt.print.PrinterException
public java.awt.Dimension getPreferredScrollableViewportSize()
getPreferredScrollableViewportSize
in interface javax.swing.Scrollable
public int getScrollableUnitIncrement(java.awt.Rectangle visibleRect, int orientation, int direction)
getScrollableUnitIncrement
in interface javax.swing.Scrollable
visibleRect
- The view area visible within the viewportorientation
- Either SwingConstants.VERTICAL or SwingConstants.HORIZONTAL.direction
- Less than zero to scroll up/left, greater than zero for down/right.
JScrollBar.setUnitIncrement(int)
public int getScrollableBlockIncrement(java.awt.Rectangle visibleRect, int orientation, int direction)
visibleRect
, based on orientation
.
getScrollableBlockIncrement
in interface javax.swing.Scrollable
visibleRect
- The view area visible within the viewportorientation
- Either SwingConstants.VERTICAL or SwingConstants.HORIZONTAL.direction
- Less than zero to scroll up/left, greater than zero for down/right.
JScrollBar.setBlockIncrement(int)
public boolean getScrollableTracksViewportWidth()
getScrollableTracksViewportWidth
in interface javax.swing.Scrollable
Scrollable.getScrollableTracksViewportWidth()
public boolean getScrollableTracksViewportHeight()
getScrollableTracksViewportHeight
in interface javax.swing.Scrollable
Scrollable.getScrollableTracksViewportHeight()
protected void registerActions()
public boolean isFullScreen()
public void setFullScreen(boolean fullScreenState)
fullScreen
- The fullScreen mode to set.public void setFullScreen(java.awt.GraphicsDevice device)
public void addUndoableEventListener(javax.swing.event.UndoableEditListener listener)
UndoableEditListener
to the list of event listeners,
to provide the component with undo/redo features.
listener
- public void removeUndoableEventListener(javax.swing.event.UndoableEditListener listener)
UndoableEditListener
from the list of event listeners.
listener
- addUndoableEventListener(UndoableEditListener)
public void fireUndoableEditUpdate(javax.swing.event.UndoableEditEvent event)
UndoableEditListener
that an UndoableEditEvent
has happened.
event
- public UndoHandler getUndoHandler()
UndoHandler
associated with this componentpublic void setContextualDrawing(DiagramComponent.ContextualDrawing cd)
cd
- the elementpublic DiagramComponent.ContextualDrawing getContextualDrawing()
public static boolean isMouseButton2(java.awt.event.MouseEvent e)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |