de.uni_paderborn.fujaba.fsa.swing
Class JBendLine

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byde.uni_paderborn.fujaba.fsa.swing.JLine
                  extended byde.uni_paderborn.fujaba.fsa.swing.JBendLine
All Implemented Interfaces:
java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.Serializable
Direct Known Subclasses:
JArrowedBendLine, JPolyLine, JPolyLine.LineSegment

public class JBendLine
extends JLine
implements java.beans.PropertyChangeListener

A JLine that can have a JBend at each end.

Startpoint and Endpoint are defined by the two Bends if they are attached. Otherwise this does the same as the "classic" JLine.

Associations

            N                      0..1
 JBendLine ----------------------------- JBend
            outgoingLines     startBend

            N                      0..1
 JBendLine ----------------------------- JBend
            incomingLines       endBend
 

Version:
$Revision: 1.19 $
Author:
$Author: schneider $
See Also:
JLine, JBend, JGrab, Serialized Form

Nested Class Summary
private  class JBendLine.AncestorManager
          No comment provided by developer, please add a comment to improve documentation
private  class JBendLine.BendIterator
          No comment provided by developer, please add a comment to improve documentation
 
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
private  JBendLine.AncestorManager ancestorListener
          No comment provided by developer, please add a comment to improve documentation.
private  JBend endBend
           N 0..1 JBendLine -------------------------- JBend incomingLines endBend
(package private)  java.awt.Point endTransform
          No comment provided by developer, please add a comment to improve documentation.
private  JBend startBend
           N 0..1 JBendLine ----------------------------- JBend outgoingLines startBend
(package private)  java.awt.Point startTransform
          No comment provided by developer, please add a comment to improve documentation.
 
Fields inherited from class de.uni_paderborn.fujaba.fsa.swing.JLine
 
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.Container
 
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
JBendLine()
          Constructor for class JBendLine
JBendLine(JBend start, JBend end)
           
JBendLine(java.awt.Point start, java.awt.Point end)
           
 
Method Summary
private  void calculateEndPoint()
          No comment provided by developer, please add a comment to improve documentation.
private  void calculateStartPoint()
          No comment provided by developer, please add a comment to improve documentation.
 boolean contains(int x, int y)
          No comment provided by developer, please add a comment to improve documentation.
protected  void endPointChanged()
          No comment provided by developer, please add a comment to improve documentation.
 JBendLine.AncestorManager getAncestorListener()
          Get the ancestorListener attribute of the JBendLine object
static java.awt.Container getClosestCommonAncestor(java.awt.Container c1, java.awt.Container c2)
          Get the closestCommonAncestor attribute of the AncestorManager object
 JBend getEndBend()
          Get the endBend attribute of the JBendLine object
 java.awt.Point getEndPoint(java.awt.Point p)
          Get the endPoint attribute of the JBendLine object
protected  java.awt.Point getEndTransform()
          Get the endTransform attribute of the JBendLine object
 JBend getFromBends(int index)
          Get the fromBends attribute of the JBendLine object
 int getIndexFromBends(JBend bend)
           
 JBend getNextFromBends(JBend bend)
          Get the nextFromBends attribute of the JBendLine object
 JBend getOtherBend(JBend bend)
          Get the partner for the bend
 JBend getPrevFromBends(JBend bend)
          Get the prevFromBends attribute of the JBendLine object
 JBend getStartBend()
          Get the startBend attribute of the JBendLine object
 java.awt.Point getStartPoint(java.awt.Point p)
          Get the startPoint attribute of the JBendLine object
protected  java.awt.Point getStartTransform()
          Get the startTransform attribute of the JBendLine object
 boolean hasInBends(JBend bend)
          No comment provided by developer, please add a comment to improve documentation.
protected  void invalidateEndTransform()
          No comment provided by developer, please add a comment to improve documentation.
protected  void invalidateStartTransform()
          No comment provided by developer, please add a comment to improve documentation.
 java.util.ListIterator iteratorOfBends()
          No comment provided by developer, please add a comment to improve documentation.
 java.util.ListIterator iteratorOfBends(int start)
          No comment provided by developer, please add a comment to improve documentation.
 java.util.ListIterator iteratorOfBends(JBend bend)
          No comment provided by developer, please add a comment to improve documentation.
 void propertyChange(java.beans.PropertyChangeEvent e)
          The PropertyChangeListener-Method.
protected  void registerEndBend(JBend bend)
          No comment provided by developer, please add a comment to improve documentation.
protected  void registerStartBend(JBend bend)
          No comment provided by developer, please add a comment to improve documentation.
 void removeYou()
          No comment provided by developer, please add a comment to improve documentation.
 boolean setBendAt(int index, JBend bend)
          Sets the bendAt attribute of the JBendLine object
 boolean setEndBend(JBend value)
          Set the end bend of the Line.
 boolean setEndPoint(int x, int y)
          Set the value of endPoint.
private  void setEndPointFromBend(int x, int y)
          Sets the endPointFromBend attribute of the JBendLine object
private  void setEndPointFromBend(java.awt.Point p)
          Sets the endPointFromBend attribute of the JBendLine object
 boolean setStartBend(JBend value)
          Set the start bend of the Line.
 boolean setStartPoint(int x, int y)
          Set the value of startPoint.
private  void setStartPointFromBend(int x, int y)
          Sets the startPointFromBend attribute of the JBendLine object
private  void setStartPointFromBend(java.awt.Point p)
          Sets the startPointFromBend attribute of the JBendLine object
 int sizeOfBends()
          No comment provided by developer, please add a comment to improve documentation.
protected  void startPointChanged()
          No comment provided by developer, please add a comment to improve documentation.
protected  void unregisterEndBend(JBend bend)
          No comment provided by developer, please add a comment to improve documentation.
protected  void unregisterStartBend(JBend bend)
          No comment provided by developer, please add a comment to improve documentation.
 
Methods inherited from class de.uni_paderborn.fujaba.fsa.swing.JLine
adjustBounds, computeCoeffs, contains, doLayout, getAngle, getAngle, getCx, getCy, getDelta, getDirection, getDirection, getDirection, getDirection, getDistance, getDistance, getEndPoint, getFromPoints, getIndexFromPoints, getIndexFromPoints, getLength, getNextFromPoints, getNextFromPoints, getNormal, getNormal, getNormal, getNormal, getPointAt, getPosition, getPosition, getPreferredBounds, getPreferredSize, getPrevFromPoints, getPrevFromPoints, getStartPoint, getStartToEndDistance, getStroke, getThickness, getUI, hasInPoints, hasInPoints, invalidateCoeffs, isCoeffsDirty, isLineDashed, isOptimizedDrawingEnabled, iteratorOfPoints, iteratorOfPoints, iteratorOfPoints, linePointsChanged, setBounds, setDelta, setEndPoint, setLineDashed, setPointAt, setPointAt, setStartPoint, setStroke, setThickness, setUI, sizeOfPoints, toString
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, 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, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, 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, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, 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, 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, isFocusTraversable, 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, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, 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

ancestorListener

private JBendLine.AncestorManager ancestorListener
No comment provided by developer, please add a comment to improve documentation.


startBend

private JBend startBend
            N                      0..1
 JBendLine ----------------------------- JBend
            outgoingLines     startBend
 


endBend

private JBend endBend
            N                   0..1
 JBendLine -------------------------- JBend
            incomingLines    endBend
 


startTransform

java.awt.Point startTransform
No comment provided by developer, please add a comment to improve documentation.


endTransform

java.awt.Point endTransform
No comment provided by developer, please add a comment to improve documentation.

Constructor Detail

JBendLine

public JBendLine()
Constructor for class JBendLine


JBendLine

public JBendLine(java.awt.Point start,
                 java.awt.Point end)
Parameters:
start - start of line
end - end of line

JBendLine

public JBendLine(JBend start,
                 JBend end)
Parameters:
start - the start Bend
end - the end Bend
Method Detail

getAncestorListener

public JBendLine.AncestorManager getAncestorListener()
Get the ancestorListener attribute of the JBendLine object

Returns:
The ancestorListener value

setStartBend

public boolean setStartBend(JBend value)
Set the start bend of the Line.

If the Bend has no Parent yet, it is assigned to the parent of the Line. Furthermore if the parent of the Bend is the same as the parent of the Line, it is changed whenever the parent of the Line changes

Parameters:
value - the new Bend
Returns:
true if the bend has changed, false otherwise
See Also:
getStartBend(), setEndBend(de.uni_paderborn.fujaba.fsa.swing.JBend), setStartPoint(int, int)

registerStartBend

protected void registerStartBend(JBend bend)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
bend - No description provided

unregisterStartBend

protected void unregisterStartBend(JBend bend)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
bend - No description provided

getStartBend

public JBend getStartBend()
Get the startBend attribute of the JBendLine object

Returns:
The startBend value

setEndBend

public boolean setEndBend(JBend value)
Set the end bend of the Line.

If the Bend has no Parent yet, it is assigned to the parent of the Line. Furthermore if the parent of the Bend is the same as the parent of the Line, it is changed whenever the parent of the Line changes

Parameters:
value - the new Bend
Returns:
true if the bend has changed, false otherwise
See Also:
getEndBend(), setStartBend(de.uni_paderborn.fujaba.fsa.swing.JBend), setEndPoint(int, int)

registerEndBend

protected void registerEndBend(JBend bend)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
bend - No description provided

unregisterEndBend

protected void unregisterEndBend(JBend bend)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
bend - No description provided

getEndBend

public JBend getEndBend()
Get the endBend attribute of the JBendLine object

Returns:
The endBend value

setBendAt

public boolean setBendAt(int index,
                         JBend bend)
Sets the bendAt attribute of the JBendLine object

Parameters:
index - The new bendAt value
bend - The new bendAt value
Returns:
No description provided

getFromBends

public JBend getFromBends(int index)
Get the fromBends attribute of the JBendLine object

Parameters:
index - No description provided
Returns:
The fromBends value

iteratorOfBends

public final java.util.ListIterator iteratorOfBends()
No comment provided by developer, please add a comment to improve documentation.

Returns:
No description provided

iteratorOfBends

public final java.util.ListIterator iteratorOfBends(JBend bend)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
bend - No description provided
Returns:
No description provided

iteratorOfBends

public java.util.ListIterator iteratorOfBends(int start)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
start - No description provided
Returns:
No description provided

sizeOfBends

public int sizeOfBends()
No comment provided by developer, please add a comment to improve documentation.

Returns:
No description provided

hasInBends

public boolean hasInBends(JBend bend)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
bend - No description provided
Returns:
No description provided

getIndexFromBends

public int getIndexFromBends(JBend bend)
Parameters:
bend - No description provided
Returns:
the index of bend or -1 if not in this line

getNextFromBends

public JBend getNextFromBends(JBend bend)
Get the nextFromBends attribute of the JBendLine object

Parameters:
bend - No description provided
Returns:
The nextFromBends value

getPrevFromBends

public JBend getPrevFromBends(JBend bend)
Get the prevFromBends attribute of the JBendLine object

Parameters:
bend - No description provided
Returns:
The prevFromBends value

getOtherBend

public JBend getOtherBend(JBend bend)
Get the partner for the bend

Parameters:
bend - No description provided
Returns:
startBend if bend is endBend, endBend if bend is startBend, null otherwise

setStartPoint

public boolean setStartPoint(int x,
                             int y)
Set the value of startPoint.

Sets the startPoint value, the position of the startBend and calls the endPoints GrabManager for revalidation.

Overrides:
setStartPoint in class JLine
Parameters:
x - x-coordinate to assign to startPoint
y - y-coordinate to assign to startPoint
Returns:
No description provided
See Also:
JLine.getStartPoint(), setEndPoint(int, int)

setStartPointFromBend

private final void setStartPointFromBend(java.awt.Point p)
Sets the startPointFromBend attribute of the JBendLine object

Parameters:
p - The new startPointFromBend value

setStartPointFromBend

private void setStartPointFromBend(int x,
                                   int y)
Sets the startPointFromBend attribute of the JBendLine object

Parameters:
x - The new startPointFromBend value
y - The new startPointFromBend value

startPointChanged

protected void startPointChanged()
No comment provided by developer, please add a comment to improve documentation.


invalidateStartTransform

protected void invalidateStartTransform()
No comment provided by developer, please add a comment to improve documentation.


getStartTransform

protected java.awt.Point getStartTransform()
Get the startTransform attribute of the JBendLine object

Returns:
The startTransform value

calculateStartPoint

private void calculateStartPoint()
No comment provided by developer, please add a comment to improve documentation.


getStartPoint

public java.awt.Point getStartPoint(java.awt.Point p)
Get the startPoint attribute of the JBendLine object

Overrides:
getStartPoint in class JLine
Parameters:
p - No description provided
Returns:
The startPoint value
See Also:
JLine.getStartPoint(), JLine.setStartPoint(java.awt.Point), JLine.setStartPoint(int, int), JLine.getEndPoint(java.awt.Point), JLine.getEndPoint()

setEndPoint

public boolean setEndPoint(int x,
                           int y)
Set the value of endPoint.

Sets the endPoint value, the position of the endBend and calls the endPoints GrabManager for revalidation.

Overrides:
setEndPoint in class JLine
Parameters:
x - x-coordinate to assign to endPoint
y - y-coordinate to assign to endPoint
Returns:
No description provided
See Also:
JLine.getEndPoint(), setStartPoint(int, int)

endPointChanged

protected void endPointChanged()
No comment provided by developer, please add a comment to improve documentation.


invalidateEndTransform

protected void invalidateEndTransform()
No comment provided by developer, please add a comment to improve documentation.


getEndTransform

protected java.awt.Point getEndTransform()
Get the endTransform attribute of the JBendLine object

Returns:
The endTransform value

setEndPointFromBend

private final void setEndPointFromBend(java.awt.Point p)
Sets the endPointFromBend attribute of the JBendLine object

Parameters:
p - The new endPointFromBend value

setEndPointFromBend

private void setEndPointFromBend(int x,
                                 int y)
Sets the endPointFromBend attribute of the JBendLine object

Parameters:
x - The new endPointFromBend value
y - The new endPointFromBend value

calculateEndPoint

private void calculateEndPoint()
No comment provided by developer, please add a comment to improve documentation.


getEndPoint

public java.awt.Point getEndPoint(java.awt.Point p)
Get the endPoint attribute of the JBendLine object

Overrides:
getEndPoint in class JLine
Parameters:
p - No description provided
Returns:
The endPoint value
See Also:
JLine.getEndPoint(), JLine.setEndPoint(java.awt.Point), JLine.setEndPoint(int, int), JLine.getStartPoint(java.awt.Point), JLine.getStartPoint()

contains

public boolean contains(int x,
                        int y)
No comment provided by developer, please add a comment to improve documentation.

Overrides:
contains in class JLine
Parameters:
x - No description provided
y - No description provided
Returns:
No description provided
See Also:
JLine.contains(java.awt.Point), JLine.getDistance(java.awt.Point), JLine.getDistance(int, int)

removeYou

public void removeYou()
No comment provided by developer, please add a comment to improve documentation.

Overrides:
removeYou in class JLine

propertyChange

public void propertyChange(java.beans.PropertyChangeEvent e)
The PropertyChangeListener-Method.

Called when the parent of the Line changes to set the parent of the grabs to the new parent if their old parent was the old parent of the line. Or when the point of either of the Bends changes to update the Line.

Specified by:
propertyChange in interface java.beans.PropertyChangeListener
Parameters:
e - The event
See Also:
PropertyChangeListener, PropertyChangeEvent

getClosestCommonAncestor

public static java.awt.Container getClosestCommonAncestor(java.awt.Container c1,
                                                          java.awt.Container c2)
Get the closestCommonAncestor attribute of the AncestorManager object

Parameters:
c1 - No description provided
c2 - No description provided
Returns:
The closestCommonAncestor value