public class VisualComponentConnection
extends javax.swing.JPanel
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
VisualComponentConnection(javax.swing.JComponent source,
javax.swing.JComponent dest)
Constructs the default
VisualComponentConnection . |
VisualComponentConnection(javax.swing.JComponent source,
javax.swing.JComponent dest,
int lineArrow,
java.awt.Color lineColor)
Constructs a
VisualComponentConnection with the specified arrow and color. |
VisualComponentConnection(javax.swing.JComponent source,
javax.swing.JComponent dest,
int lineArrow,
int lineType,
java.awt.Color lineColor,
boolean visible)
Constructs a
VisualComponentConnection with the specified arrow, line type and color. |
VisualComponentConnection(java.awt.Rectangle sourceRect,
java.awt.Rectangle destRect,
int lineArrow,
int lineType,
java.awt.Color lineColor,
boolean visible)
Constructs a
VisualComponentConnection between two imaginary Compoments
with same bounds as sourceRect and destRect . |
Modifier and Type | Method and Description |
---|---|
javax.swing.JComponent |
getDest() |
javax.swing.tree.TreePath |
getDestPath() |
int |
getLineArrow() |
java.awt.Color |
getLineColor() |
VisualComponentConnectionLineProperties |
getLineProperties() |
int |
getLineType() |
javax.swing.JComponent |
getOriginalDest() |
javax.swing.JComponent |
getOriginalSource() |
javax.swing.JComponent |
getSource() |
javax.swing.tree.TreePath |
getSourcePath() |
VisualComponentConnectionVisibilityProperties |
getVisibilityProperties() |
void |
moveConnectionBy(int incSourceX,
int incSourceY,
int incDestX,
int incDestY)
Moves each of this
VisualComponentConnection 's source and destination components
by (incSourceX,incSourceY) and (incDestX,incDestY) respectively |
void |
moveConnectionBy(java.awt.Point incSource,
java.awt.Point incDest)
Moves each of this
VisualComponentConnection 's source and destination components
by the (x,y) coordinates indicated by incSource and incDest
points |
void |
moveDestBy(int incX,
int incY)
Moves this
VisualComponentConnection 's destination Component for (incX,incY)
on the (x-axis,y-axis) of the coordinate system |
void |
moveDestBy(java.awt.Point incPoint)
Moves this
VisualComponentConnection 's destination Component by the x,y
coordinates indicated by incPoint |
void |
moveOriginalDestBy(int incX,
int incY) |
void |
moveOriginalSourceBy(int incX,
int incY) |
void |
moveSourceBy(int incX,
int incY)
Moves this
VisualComponentConnection 's source Component for (incX,incY)
on the (x-axis,y-axis) of the coordinate system |
void |
moveSourceBy(java.awt.Point incPoint)
Moves this
VisualComponentConnection 's source Component by the x,y
coordinates indicated by incPoint |
void |
paint(java.awt.Graphics g)
Overrides parent's paint().
|
void |
print() |
void |
resetToOriginal() |
void |
setDest(java.awt.Rectangle rect)
Sets the destination component of this
VisualComponentConnection to a JLabel
with same bounds as rect |
void |
setDestX(int incX)
Sets the
x coordinate of this VisualComponentConnection 's destination
Component to incX |
void |
setLineArrow(int lineArrow) |
void |
setLineColor(java.awt.Color lineColor)
Sets the
color field of this VisualComponentConnection to c |
void |
setLineProperties(VisualComponentConnectionLineProperties lineProp) |
void |
setLineType(int lineType)
Sets the line type of this
VisualComponentConnection to type |
void |
setOriginalDest(java.awt.Rectangle rDest) |
void |
setOriginalSource(java.awt.Rectangle rSource) |
void |
setPaths(javax.swing.tree.TreePath sourcePath,
javax.swing.tree.TreePath destPath) |
void |
setSource(java.awt.Rectangle rect)
Sets the source component of this
VisualComponentConnection to a JLabel
with same bounds as rect |
void |
setSourceDest(java.awt.Rectangle sourceRect,
java.awt.Rectangle destRect,
boolean visible) |
void |
setSourceX(int incX)
Sets the
x coordinate of this VisualComponentConnection 's source
Component to incX |
void |
setVisibilityProperties(VisualComponentConnectionVisibilityProperties visibilityProp) |
java.lang.String |
toString() |
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, 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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, 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, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
add, add, add, add, add, addContainerListener, 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, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, 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, 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, transferFocus, transferFocusBackward, transferFocusUpCycle
public VisualComponentConnection(javax.swing.JComponent source, javax.swing.JComponent dest)
VisualComponentConnection
.source
- JComponentdest
- JComponentpublic VisualComponentConnection(javax.swing.JComponent source, javax.swing.JComponent dest, int lineArrow, java.awt.Color lineColor)
VisualComponentConnection
with the specified arrow and color.source
- JComponentdest
- JComponentlineArrow
- intlineColor
- Colorpublic VisualComponentConnection(javax.swing.JComponent source, javax.swing.JComponent dest, int lineArrow, int lineType, java.awt.Color lineColor, boolean visible)
VisualComponentConnection
with the specified arrow, line type and color.source
- JComponentdest
- JComponentlineArrow
- intlineType
- intlineColor
- Colorpublic VisualComponentConnection(java.awt.Rectangle sourceRect, java.awt.Rectangle destRect, int lineArrow, int lineType, java.awt.Color lineColor, boolean visible)
VisualComponentConnection
between two imaginary Compoments
with same bounds as sourceRect
and destRect
.
By default the source and dest are constructed as instances of JLabel.sourceRect
- RectangledestRect
- RectanglelineArrow
- intlineType
- intlineColor
- Colorpublic void paint(java.awt.Graphics g)
paint
in class javax.swing.JComponent
g
- Graphicspublic java.awt.Color getLineColor()
Color
class, indicating the color
of this VisualComponentConnection
public void setLineColor(java.awt.Color lineColor)
color
field of this VisualComponentConnection
to c
lineColor
- An instance of Color
classpublic int getLineType()
VisualComponentConnection
public void setLineType(int lineType)
VisualComponentConnection
to type
lineType
- An integer indicating the line typepublic int getLineArrow()
public void setLineArrow(int lineArrow)
public javax.swing.JComponent getSource()
VisualComponentConnection
public void setSource(java.awt.Rectangle rect)
VisualComponentConnection
to a JLabel
with same bounds as rect
rect
- An instance of Rectangle
public void setSourceX(int incX)
x
coordinate of this VisualComponentConnection
's source
Component to incX
incX
- An integer indicating the new x coordinatepublic void moveSourceBy(java.awt.Point incPoint)
VisualComponentConnection
's source Component by the x,y
coordinates indicated by incPoint
incPoint
- An instance of Point
class indicating the
x,y
coordinatespublic void moveSourceBy(int incX, int incY)
VisualComponentConnection
's source Component for (incX,incY)
on the (x-axis,y-axis)
of the coordinate systemincX
- An integer indicating the distance for the x-axis
incY
- An integer indicating the distance for the y-axis
public javax.swing.JComponent getDest()
VisualComponentConnection
public void setDest(java.awt.Rectangle rect)
VisualComponentConnection
to a JLabel
with same bounds as rect
rect
- An instance of Rectangle
public void setDestX(int incX)
x
coordinate of this VisualComponentConnection
's destination
Component to incX
incX
- An integer indicating the new x coordinatepublic void moveDestBy(java.awt.Point incPoint)
VisualComponentConnection
's destination Component by the x,y
coordinates indicated by incPoint
incPoint
- An instance of Point
class indicating the
x,y
coordinatespublic void moveDestBy(int incX, int incY)
VisualComponentConnection
's destination Component for (incX,incY)
on the (x-axis,y-axis)
of the coordinate systemincX
- An integer indicating the distance for the x-axis
incY
- An integer indicating the distance for the y-axis
public void setSourceDest(java.awt.Rectangle sourceRect, java.awt.Rectangle destRect, boolean visible)
public void moveConnectionBy(java.awt.Point incSource, java.awt.Point incDest)
VisualComponentConnection
's source and destination components
by the (x,y)
coordinates indicated by incSource and incDest
pointsincSource
- An instance of Point
incDest
- An instance of Point
public void moveConnectionBy(int incSourceX, int incSourceY, int incDestX, int incDestY)
VisualComponentConnection
's source and destination components
by (incSourceX,incSourceY) and (incDestX,incDestY)
respectivelyincSourceX
- The x
coordinate for the source ComponentincSourceY
- The y
coordinate for the source ComponentincDestX
- The x
coordinate for the destination ComponentincDestY
- The y
coordinate for the destination Componentpublic void setOriginalSource(java.awt.Rectangle rSource)
public javax.swing.JComponent getOriginalSource()
public void moveOriginalSourceBy(int incX, int incY)
public void setOriginalDest(java.awt.Rectangle rDest)
public javax.swing.JComponent getOriginalDest()
public void moveOriginalDestBy(int incX, int incY)
public void resetToOriginal()
public void setPaths(javax.swing.tree.TreePath sourcePath, javax.swing.tree.TreePath destPath)
public javax.swing.tree.TreePath getSourcePath()
public javax.swing.tree.TreePath getDestPath()
public VisualComponentConnectionVisibilityProperties getVisibilityProperties()
public void setVisibilityProperties(VisualComponentConnectionVisibilityProperties visibilityProp)
public VisualComponentConnectionLineProperties getLineProperties()
public void setLineProperties(VisualComponentConnectionLineProperties lineProp)
public void print()
public java.lang.String toString()
toString
in class java.awt.Component