|
|||||||||||
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
de.uni_paderborn.fujaba.fsa.swing.JLine
A Line from startPoint to endPoint
JBendLine
,
Serialized FormNested Class Summary |
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 boolean |
boundsDirty
No comment provided by developer, please add a comment to improve documentation. |
private boolean |
coeffsDirty
No comment provided by developer, please add a comment to improve documentation. |
private double |
cx
No comment provided by developer, please add a comment to improve documentation. |
private double |
cy
No comment provided by developer, please add a comment to improve documentation. |
private boolean |
dashedFlag
No comment provided by developer, please add a comment to improve documentation. |
private double |
delta
UMLAttribute : 'delta : double ' |
private java.awt.Point |
endPoint
No comment provided by developer, please add a comment to improve documentation. |
private double |
length
No comment provided by developer, please add a comment to improve documentation. |
private java.awt.Point |
startPoint
No comment provided by developer, please add a comment to improve documentation. |
private java.awt.Stroke |
stroke
No comment provided by developer, please add a comment to improve documentation. |
private int |
thickness
No comment provided by developer, please add a comment to improve documentation. |
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 | |
JLine()
Creates a Line from (0,0) to (0,0) |
|
JLine(java.awt.Point start,
java.awt.Point end)
Creates a Line from Point start to Point end |
Method Summary | |
(package private) boolean |
adjustBounds()
set the bounds to the value of getPreferredBounds by calling super.setBounds |
(package private) void |
computeCoeffs()
compute the coefficients needed to efficiently calculate the distance of points to the line. |
boolean |
contains(int x,
int y)
|
boolean |
contains(java.awt.Point p)
|
void |
doLayout()
No comment provided by developer, please add a comment to improve documentation. |
double |
getAngle()
Get the angle attribute of the JLine object |
double |
getAngle(double d)
Get the angle attribute of the JLine object |
protected double |
getCx()
x coeff to quickly calculate the distance of a point to a line The value is cached until one of the endpoints changes, and then recalculated along with cy and length, when one of them is requested. |
protected double |
getCy()
y coeff to quickly calculate the distance of a point to a line The value is cached until one of the endpoints changes, and then recalculated along with cx and length, when one of them is requested. |
double |
getDelta()
Get the value of delta. |
java.awt.geom.Point2D |
getDirection()
Get the direction attribute of the JLine object |
java.awt.geom.Point2D |
getDirection(double d)
Get the direction attribute of the JLine object |
java.awt.geom.Point2D |
getDirection(double d,
java.awt.geom.Point2D p)
Get the direction attribute of the JLine object |
java.awt.geom.Point2D |
getDirection(java.awt.geom.Point2D p)
Get the direction attribute of the JLine object |
double |
getDistance(int x,
int y)
|
double |
getDistance(java.awt.Point p)
|
java.awt.Point |
getEndPoint()
Get the value of endPoint. |
java.awt.Point |
getEndPoint(java.awt.Point p)
Store the value of endPoint in p or return a new Point containing these coordinates if p is null |
java.awt.Point |
getFromPoints(int index)
Get the fromPoints attribute of the JLine object |
int |
getIndexFromPoints(int x,
int y)
Get the indexFromPoints attribute of the JLine object |
int |
getIndexFromPoints(java.awt.Point point)
|
double |
getLength()
Get the length attribute of the JLine object |
java.awt.Point |
getNextFromPoints(int x,
int y)
Get the nextFromPoints attribute of the JLine object |
java.awt.Point |
getNextFromPoints(java.awt.Point point)
Get the nextFromPoints attribute of the JLine object |
java.awt.geom.Point2D |
getNormal()
Get the normal attribute of the JLine object |
java.awt.geom.Point2D |
getNormal(double d)
Get the normal attribute of the JLine object |
java.awt.geom.Point2D |
getNormal(double d,
java.awt.geom.Point2D p)
Get the normal attribute of the JLine object |
java.awt.geom.Point2D |
getNormal(java.awt.geom.Point2D p)
Get the normal attribute of the JLine 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 |
double |
getPosition(java.awt.Point p)
Get the position attribute of the JLine object |
java.awt.Rectangle |
getPreferredBounds()
compute the bounds from the start- and endpoint and delta. |
java.awt.Dimension |
getPreferredSize()
|
java.awt.Point |
getPrevFromPoints(int x,
int y)
Get the prevFromPoints attribute of the JLine object |
java.awt.Point |
getPrevFromPoints(java.awt.Point point)
Get the prevFromPoints attribute of the JLine object |
java.awt.Point |
getStartPoint()
Get the value of startPoint. |
java.awt.Point |
getStartPoint(java.awt.Point p)
Store the value of startPoint in p or return a new Point containing these coordinates if p is null |
double |
getStartToEndDistance()
length of the line The value is cached until one of the endpoints changes, and then recalculated along with cx and cy, when one of them is requested. |
java.awt.Stroke |
getStroke()
Get the stroke attribute of the JLine object |
int |
getThickness()
Get the thickness attribute of the JLine object |
LineUI |
getUI()
Get the uI attribute of the JLine object |
boolean |
hasInPoints(int x,
int y)
No comment provided by developer, please add a comment to improve documentation. |
boolean |
hasInPoints(java.awt.Point point)
No comment provided by developer, please add a comment to improve documentation. |
(package private) void |
invalidateCoeffs()
invalidates the coefficients needed for calculations on the line. |
(package private) boolean |
isCoeffsDirty()
Get the coeffsDirty attribute of the JLine object |
boolean |
isLineDashed()
Get the lineDashed attribute of the JLine object |
boolean |
isOptimizedDrawingEnabled()
Get the optimizedDrawingEnabled attribute of the JLine object |
java.util.ListIterator |
iteratorOfPoints()
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. |
java.util.ListIterator |
iteratorOfPoints(java.awt.Point pt)
No comment provided by developer, please add a comment to improve documentation. |
(package private) void |
linePointsChanged()
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 |
setBounds(int x,
int y,
int w,
int h)
set Bounds to parameters and update startPoint and endPoint accordingly. |
void |
setDelta(double delta)
Set the value of delta. |
boolean |
setEndPoint(int x,
int y)
Set the value of startPoint and recalculate bounds |
void |
setEndPoint(java.awt.Point point)
Set the value of endPoint and recalculate bounds |
void |
setLineDashed(boolean dashed)
Sets the lineDashed attribute of the JLine object |
boolean |
setPointAt(int index,
int x,
int y)
Sets the pointAt attribute of the JLine object |
boolean |
setPointAt(int index,
java.awt.Point p)
Sets the pointAt attribute of the JLine object |
boolean |
setStartPoint(int x,
int y)
Set the value of startPoint and recalculate bounds |
void |
setStartPoint(java.awt.Point point)
Set the value of startPoint and recalculate bounds |
void |
setStroke(java.awt.Stroke value)
Sets the stroke attribute of the JLine object |
void |
setThickness(int newThickness)
Sets the thickness attribute of the JLine object |
void |
setUI(javax.swing.plaf.ComponentUI ui)
Sets the UI of this class. |
int |
sizeOfPoints()
No comment provided by developer, please add a comment to improve documentation. |
java.lang.String |
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 |
private java.awt.Point startPoint
private java.awt.Point endPoint
private boolean dashedFlag
private int thickness
private double delta
private double cx
private double cy
private double length
private boolean coeffsDirty
private boolean boundsDirty
private java.awt.Stroke stroke
Constructor Detail |
public JLine()
public JLine(java.awt.Point start, java.awt.Point end)
start
- start of lineend
- end of lineMethod Detail |
public boolean isOptimizedDrawingEnabled()
public final java.awt.Point getStartPoint()
Same as getStartPoint(null).
getStartPoint(java.awt.Point)
,
setStartPoint(java.awt.Point)
,
setStartPoint(int, int)
,
getEndPoint(java.awt.Point)
,
getEndPoint()
public java.awt.Point getStartPoint(java.awt.Point p)
p
- The point to store the coordinates in
getStartPoint()
,
setStartPoint(java.awt.Point)
,
setStartPoint(int, int)
,
getEndPoint(java.awt.Point)
,
getEndPoint()
public final void setStartPoint(java.awt.Point point)
point
- Value to assign to startPoint.setStartPoint(int, int)
,
setEndPoint(int, int)
,
setEndPoint(java.awt.Point)
,
getStartPoint()
,
getStartPoint(java.awt.Point)
,
setBounds(int, int, int, int)
public boolean setStartPoint(int x, int y)
x
- x-coordinatey
- y-coordinate
setStartPoint(java.awt.Point)
,
setEndPoint(int, int)
,
setEndPoint(java.awt.Point)
,
getStartPoint()
,
getStartPoint(java.awt.Point)
,
setBounds(int, int, int, int)
public final java.awt.Point getEndPoint()
getEndPoint(java.awt.Point)
,
setEndPoint(java.awt.Point)
,
setEndPoint(int, int)
,
getStartPoint(java.awt.Point)
,
getStartPoint()
public java.awt.Point getEndPoint(java.awt.Point p)
p
- The point to store the coordinates in
getEndPoint()
,
setEndPoint(java.awt.Point)
,
setEndPoint(int, int)
,
getStartPoint(java.awt.Point)
,
getStartPoint()
public final void setEndPoint(java.awt.Point point)
point
- Value to assign to endPoint.setEndPoint(int, int)
,
setStartPoint(int, int)
,
setStartPoint(java.awt.Point)
,
getEndPoint()
,
getEndPoint(java.awt.Point)
,
setBounds(int, int, int, int)
public boolean setEndPoint(int x, int y)
x
- x-coordinatey
- y-coordinate
setEndPoint(java.awt.Point)
,
setStartPoint(int, int)
,
setStartPoint(java.awt.Point)
,
getEndPoint()
,
getEndPoint(java.awt.Point)
,
setBounds(int, int, int, int)
public final boolean setPointAt(int index, java.awt.Point p)
index
- The new pointAt valuep
- The new pointAt value
public boolean setPointAt(int index, int x, int y)
index
- The new pointAt valuex
- The new pointAt valuey
- The new pointAt value
public java.awt.Point getFromPoints(int index)
index
- No description provided
public java.util.ListIterator iteratorOfPoints(int start)
start
- No description provided
public final java.util.ListIterator iteratorOfPoints()
public final java.util.ListIterator iteratorOfPoints(java.awt.Point pt)
pt
- No description provided
public int sizeOfPoints()
public final java.awt.Point getNextFromPoints(java.awt.Point point)
point
- No description provided
public java.awt.Point getNextFromPoints(int x, int y)
x
- No description providedy
- No description provided
public final java.awt.Point getPrevFromPoints(java.awt.Point point)
point
- No description provided
public java.awt.Point getPrevFromPoints(int x, int y)
x
- No description providedy
- No description provided
public final boolean hasInPoints(java.awt.Point point)
point
- No description provided
public boolean hasInPoints(int x, int y)
x
- No description providedy
- No description provided
public final int getIndexFromPoints(java.awt.Point point)
point
- No description provided
public int getIndexFromPoints(int x, int y)
x
- No description providedy
- No description provided
public void setLineDashed(boolean dashed)
dashed
- The new lineDashed valuepublic boolean isLineDashed()
public void setThickness(int newThickness)
newThickness
- The new thickness valuepublic int getThickness()
public double getDelta()
This value declares the "thickness" of the line.
Mouse actions that are at most in a distance of delta are considered to be on this line.
setDelta(double)
,
getDistance(Point)
,
getDistance(int,int)
,
contains(Point)
,
contains(int,int)
public void setDelta(double delta)
This value declares the "thickness" of the line.
Mouse actions, that are at most in a distance of delta are considered to be on this line.
delta
- Value to assign to delta.getDelta()
,
getDistance(Point)
,
getDistance(int,int)
,
contains(Point)
,
contains(int,int)
void computeCoeffs()
invalidateCoeffs()
,
getCx()
,
getCy()
,
getLength()
,
contains(int, int)
,
contains(java.awt.Point)
,
getDistance(int, int)
,
getDistance(java.awt.Point)
void invalidateCoeffs()
computeCoeffs()
boolean isCoeffsDirty()
protected double getCx()
The value is cached until one of the endpoints changes, and then recalculated along with cy and length, when one of them is requested.
cx=dx/(dx**2+dy**2), where (dx, dy)=endPoint-startPoint
getCy()
,
getLength()
,
computeCoeffs()
,
invalidateCoeffs()
protected double getCy()
The value is cached until one of the endpoints changes, and then recalculated along with cx and length, when one of them is requested.
cy=dy/(dx**2+dy**2), where (dx, dy)=endPoint-startPoint
getCy()
,
getLength()
,
computeCoeffs()
,
invalidateCoeffs()
public double getStartToEndDistance()
The value is cached until one of the endpoints changes, and then recalculated along with cx and cy, when one of them is requested.
getCx()
,
getCy()
,
computeCoeffs()
,
invalidateCoeffs()
public double getLength()
public final java.awt.geom.Point2D getDirection(double d)
d
- No description provided
public java.awt.geom.Point2D getDirection(double d, java.awt.geom.Point2D p)
d
- No description providedp
- No description provided
public java.awt.geom.Point2D getDirection()
public java.awt.geom.Point2D getDirection(java.awt.geom.Point2D p)
p
- No description provided
public final java.awt.geom.Point2D getNormal(double d)
d
- No description provided
public java.awt.geom.Point2D getNormal(double d, java.awt.geom.Point2D p)
d
- No description providedp
- No description provided
public java.awt.geom.Point2D getNormal()
public java.awt.geom.Point2D getNormal(java.awt.geom.Point2D p)
p
- No description provided
public double getAngle(double d)
d
- No description provided
public double getAngle()
public final double getPosition(java.awt.Point p)
p
- No description provided
public double getPosition(int x, int y)
x
- No description providedy
- No description provided
public java.awt.geom.Point2D getPointAt(double d)
d
- No description provided
void linePointsChanged()
boolean adjustBounds()
getPreferredBoundsby calling
super.setBounds
getPreferredBounds()
,
setBounds(int, int, int, int)
public void doLayout()
public java.awt.Rectangle getPreferredBounds()
getDelta()
,
getStartPoint()
,
getEndPoint()
,
adjustBounds()
public void setBounds(int x, int y, int w, int h)
x
- x-positiony
- y-positionw
- widthh
- heightadjustBounds()
public java.awt.Dimension getPreferredSize()
getPreferredBounds()
public boolean contains(int x, int y)
x
- x-coordinatey
- y-coordinate
contains(java.awt.Point)
,
getDistance(java.awt.Point)
,
getDistance(int, int)
public final boolean contains(java.awt.Point p)
p
- Point
contains(int, int)
,
getDistance(java.awt.Point)
,
getDistance(int, int)
public final double getDistance(java.awt.Point p)
p
- Point
contains(java.awt.Point)
,
contains(int, int)
,
getDistance(int, int)
public double getDistance(int x, int y)
x
- x-coordinatey
- y-coordinate
contains(java.awt.Point)
,
contains(int, int)
,
getDistance(int, int)
public void setUI(javax.swing.plaf.ComponentUI ui)
ui
- the UI for this object. Must be a subclass of LineUI.public LineUI getUI()
public void setStroke(java.awt.Stroke value)
value
- The new stroke valuepublic java.awt.Stroke getStroke()
public java.lang.String toString()
public void removeYou()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |