de.uni_paderborn.fujaba.fsa.swing
Class JPolyLine

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
                      extended byde.uni_paderborn.fujaba.fsa.swing.JPolyLine
All Implemented Interfaces:
java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.Serializable

public class JPolyLine
extends JBendLine

Polyline consisting of several small lines

Work in progress. Bugs guaranteed!

Version:
$Revision: 1.34.2.2 $
Author:
$Author: lowende $
See Also:
Serialized Form

Nested Class Summary
static class JPolyLine.LineSegment
          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
 
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
JPolyLine(JBend start, JBend end)
          Constructor for class JPolyLine
 
Method Summary
 boolean adjustBounds()
          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.
 double getAngle(double d)
          Get the angle attribute of the JPolyLine object
 JPolyLine.LineSegment getClosestLine(int x, int y)
          Get the closestLine attribute of the JPolyLine object
 JPolyLine.LineSegment getClosestLine(java.awt.Point p)
          Get the closestLine attribute of the JPolyLine object
 java.awt.geom.Point2D getDirection(double d, java.awt.geom.Point2D p)
          Get the direction attribute of the JPolyLine object
 double getDistance(int x, int y)
          Get the distance attribute of the JPolyLine object
 JBend getFromBends(int index)
          Get the fromBends attribute of the JPolyLine object
 JPolyLine.LineSegment getFromLines(int pos)
          please do not change lines directly.
 java.awt.Point getFromPoints(int index)
          Get the fromPoints attribute of the JPolyLine object
 int getIndexFromBends(JBend bend)
           
 int getIndexFromLines(JPolyLine.LineSegment line)
          please do not change lines directly.
 double getLength()
          Get the length attribute of the JPolyLine object
 JPolyLine.LineSegment getLineAt(double d)
           
 java.awt.geom.Point2D getNormal(double d, java.awt.geom.Point2D p)
          Get the normal attribute of the JPolyLine object
 java.awt.geom.Point2D getPointAt(double d)
          Get the pointAt attribute of the JLine object
 double getPosition(int x, int y)
          Get the position attribute of the JLine object
 java.awt.Rectangle getPreferredBounds()
          Get the preferredBounds attribute of the JPolyLine object
 boolean hasInBends(JBend bend)
          No comment provided by developer, please add a comment to improve documentation.
 boolean hasInLines(JPolyLine.LineSegment value)
          please do not change lines directly.
 boolean insertInBends(int index, JBend bend)
          No comment provided by developer, please add a comment to improve documentation.
 boolean insertInBends(JBend bend)
          insert the bend between the 2 closest bends
 boolean isAdjustingBounds()
          Get the adjustingBounds attribute of the JPolyLine object
 java.util.ListIterator iteratorOfBends(int start)
          No comment provided by developer, please add a comment to improve documentation.
 java.util.ListIterator iteratorOfLines()
          please do not change lines directly.
 java.util.ListIterator iteratorOfLines(int start)
          No comment provided by developer, please add a comment to improve documentation.
 java.util.ListIterator iteratorOfLines(JPolyLine.LineSegment line)
          No comment provided by developer, please add a comment to improve documentation.
 java.util.ListIterator iteratorOfPoints(int start)
          No comment provided by developer, please add a comment to improve documentation.
 void paintComponent(java.awt.Graphics g)
          No comment provided by developer, please add a comment to improve documentation.
 void removeAllFromBends()
          No comment provided by developer, please add a comment to improve documentation.
 boolean removeFromBends(int index)
          No comment provided by developer, please add a comment to improve documentation.
 boolean removeFromBends(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.
 void revalidate()
          No comment provided by developer, please add a comment to improve documentation.
 boolean setBendAt(int index, JBend b)
          Sets the bendAt attribute of the JPolyLine object
 boolean setEndBend(JBend value)
          Sets the endBend attribute of the JPolyLine object
 void setForeground(java.awt.Color c)
          Sets the foreground attribute of the JPolyLine object
 boolean setPointAt(int index, int x, int y)
          Sets the pointAt attribute of the JPolyLine object
 boolean setStartBend(JBend value)
          Sets the startBend attribute of the JPolyLine object
 void setUI(javax.swing.plaf.ComponentUI ui)
          Sets the UI of the object.
 int sizeOfBends()
          No comment provided by developer, please add a comment to improve documentation.
 int sizeOfLines()
          please do not change lines directly.
 int sizeOfPoints()
          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.
 
Methods inherited from class de.uni_paderborn.fujaba.fsa.swing.JBendLine
getAncestorListener, getClosestCommonAncestor, getEndBend, getEndPoint, getEndTransform, getNextFromBends, getOtherBend, getPrevFromBends, getStartBend, getStartPoint, getStartTransform, invalidateEndTransform, invalidateStartTransform, iteratorOfBends, iteratorOfBends, propertyChange, registerEndBend, registerStartBend, setEndPoint, setStartPoint, unregisterEndBend, unregisterStartBend
 
Methods inherited from class de.uni_paderborn.fujaba.fsa.swing.JLine
contains, doLayout, getAngle, getCx, getCy, getDelta, getDirection, getDirection, getDirection, getDistance, getEndPoint, getIndexFromPoints, getIndexFromPoints, getNextFromPoints, getNextFromPoints, getNormal, getNormal, getNormal, getPosition, getPreferredSize, getPrevFromPoints, getPrevFromPoints, getStartPoint, getStartToEndDistance, getStroke, getThickness, getUI, hasInPoints, hasInPoints, isLineDashed, isOptimizedDrawingEnabled, iteratorOfPoints, iteratorOfPoints, setBounds, setDelta, setEndPoint, setLineDashed, setPointAt, setStartPoint, setStroke, setThickness, 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, 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, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, 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
 

Constructor Detail

JPolyLine

public JPolyLine(JBend start,
                 JBend end)
Constructor for class JPolyLine

Parameters:
start - No description provided
end - No description provided
Method Detail

startPointChanged

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

Overrides:
startPointChanged in class JBendLine

endPointChanged

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

Overrides:
endPointChanged in class JBendLine

getFromLines

public JPolyLine.LineSegment getFromLines(int pos)
please do not change lines directly. Use the bends- or points-methods instead

Parameters:
pos - No description provided
Returns:
The fromLines value

getIndexFromLines

public int getIndexFromLines(JPolyLine.LineSegment line)
please do not change lines directly. Use the bends- or points-methods instead

Parameters:
line - No description provided
Returns:
The indexFromLines value

hasInLines

public boolean hasInLines(JPolyLine.LineSegment value)
please do not change lines directly. Use the bends- or points-methods instead

Parameters:
value - No description provided
Returns:
No description provided

iteratorOfLines

public final java.util.ListIterator iteratorOfLines()
please do not change lines directly. Use the bends- or points-methods instead

Returns:
No description provided

iteratorOfLines

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

Parameters:
line - No description provided
Returns:
No description provided

iteratorOfLines

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

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

sizeOfLines

public int sizeOfLines()
please do not change lines directly. Use the bends- or points-methods instead

Returns:
No description provided

getLineAt

public JPolyLine.LineSegment getLineAt(double d)
Parameters:
d - No description provided
Returns:
the line segment at the given position between 0 and 1

getPointAt

public java.awt.geom.Point2D getPointAt(double d)
Description copied from class: JLine
Get the pointAt attribute of the JLine object

Overrides:
getPointAt in class JLine
Parameters:
d - No description provided
Returns:
the linepoint at the given position between 0 and 1

getClosestLine

public JPolyLine.LineSegment getClosestLine(java.awt.Point p)
Get the closestLine attribute of the JPolyLine object

Parameters:
p - No description provided
Returns:
The closestLine value

getClosestLine

public JPolyLine.LineSegment getClosestLine(int x,
                                            int y)
Get the closestLine attribute of the JPolyLine object

Parameters:
x - No description provided
y - No description provided
Returns:
The closestLine value

contains

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

Overrides:
contains in class JBendLine
Parameters:
x - No description provided
y - No description provided
Returns:
No description provided

getDistance

public double getDistance(int x,
                          int y)
Get the distance attribute of the JPolyLine object

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

getPosition

public double getPosition(int x,
                          int y)
Description copied from class: JLine
Get the position attribute of the JLine object

Overrides:
getPosition in class JLine
Parameters:
x - No description provided
y - No description provided
Returns:
the position of the projection of (x, y) to the line as value between 0 and 1

getDirection

public java.awt.geom.Point2D getDirection(double d,
                                          java.awt.geom.Point2D p)
Get the direction attribute of the JPolyLine object

Overrides:
getDirection in class JLine
Parameters:
d - No description provided
p - No description provided
Returns:
The direction value

getNormal

public java.awt.geom.Point2D getNormal(double d,
                                       java.awt.geom.Point2D p)
Get the normal attribute of the JPolyLine object

Overrides:
getNormal in class JLine
Parameters:
d - No description provided
p - No description provided
Returns:
The normal value

getAngle

public double getAngle(double d)
Get the angle attribute of the JPolyLine object

Overrides:
getAngle in class JLine
Parameters:
d - No description provided
Returns:
The angle value

getLength

public double getLength()
Get the length attribute of the JPolyLine object

Overrides:
getLength in class JLine
Returns:
The length value

setPointAt

public boolean setPointAt(int index,
                          int x,
                          int y)
Sets the pointAt attribute of the JPolyLine object

Overrides:
setPointAt in class JLine
Parameters:
index - The new pointAt value
x - The new pointAt value
y - The new pointAt value
Returns:
No description provided

getFromPoints

public java.awt.Point getFromPoints(int index)
Get the fromPoints attribute of the JPolyLine object

Overrides:
getFromPoints in class JLine
Parameters:
index - No description provided
Returns:
The fromPoints value

iteratorOfPoints

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

Overrides:
iteratorOfPoints in class JLine
Parameters:
start - No description provided
Returns:
No description provided

sizeOfPoints

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

Overrides:
sizeOfPoints in class JLine
Returns:
No description provided

setStartBend

public boolean setStartBend(JBend value)
Sets the startBend attribute of the JPolyLine object

Overrides:
setStartBend in class JBendLine
Parameters:
value - The new startBend value
Returns:
No description provided
See Also:
JBendLine.getStartBend(), JBendLine.setEndBend(de.uni_paderborn.fujaba.fsa.swing.JBend), JBendLine.setStartPoint(int, int)

setEndBend

public boolean setEndBend(JBend value)
Sets the endBend attribute of the JPolyLine object

Overrides:
setEndBend in class JBendLine
Parameters:
value - The new endBend value
Returns:
No description provided
See Also:
JBendLine.getEndBend(), JBendLine.setStartBend(de.uni_paderborn.fujaba.fsa.swing.JBend), JBendLine.setEndPoint(int, int)

hasInBends

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

Overrides:
hasInBends in class JBendLine
Parameters:
bend - No description provided
Returns:
No description provided

setBendAt

public boolean setBendAt(int index,
                         JBend b)
Sets the bendAt attribute of the JPolyLine object

Overrides:
setBendAt in class JBendLine
Parameters:
index - The new bendAt value
b - The new bendAt value
Returns:
No description provided

getFromBends

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

Overrides:
getFromBends in class JBendLine
Parameters:
index - No description provided
Returns:
The fromBends value

sizeOfBends

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

Overrides:
sizeOfBends in class JBendLine
Returns:
No description provided

iteratorOfBends

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

Overrides:
iteratorOfBends in class JBendLine
Parameters:
start - No description provided
Returns:
No description provided

insertInBends

public boolean insertInBends(JBend bend)
insert the bend between the 2 closest bends

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

insertInBends

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

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

getIndexFromBends

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

removeFromBends

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

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

removeFromBends

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

Parameters:
index - No description provided
Returns:
No description provided

removeAllFromBends

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


removeYou

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

Overrides:
removeYou in class JBendLine

setForeground

public void setForeground(java.awt.Color c)
Sets the foreground attribute of the JPolyLine object

Parameters:
c - The new foreground value

revalidate

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


paintComponent

public void paintComponent(java.awt.Graphics g)
No comment provided by developer, please add a comment to improve documentation.

Parameters:
g - No description provided

setUI

public void setUI(javax.swing.plaf.ComponentUI ui)
Sets the UI of the object. The given UI will be also delegated to the children of the object.

Overrides:
setUI in class JLine
Parameters:
ui - The UI to use. Must be a subclass of LineUI.

getPreferredBounds

public java.awt.Rectangle getPreferredBounds()
Get the preferredBounds attribute of the JPolyLine object

Overrides:
getPreferredBounds in class JLine
Returns:
The preferredBounds value
See Also:
JLine.getDelta(), JLine.getStartPoint(), JLine.getEndPoint(), #adjustBounds

adjustBounds

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

Returns:
No description provided
See Also:
JLine.getPreferredBounds(), JLine.setBounds(int, int, int, int)

isAdjustingBounds

public boolean isAdjustingBounds()
Get the adjustingBounds attribute of the JPolyLine object

Returns:
The adjustingBounds value