|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.swtlayeredgraph.LayerDrawable
public abstract class LayerDrawable
Defines a base class for all objects that can be drawn on the layered graph. When creating your own shape, you need to make sure that you add the points that define the extents of your object. As long as you provide valid points, the extents will be automatically calculated for you.
Field Summary | |
---|---|
protected LayerComponentType |
componentType
|
protected java.util.List<GraphPoint> |
extentPointList
|
Constructor Summary | |
---|---|
LayerDrawable()
Default constructor. |
|
LayerDrawable(java.lang.String name)
Creates a new LayerDrawable object with the specified name. |
Method Summary | |
---|---|
void |
addExtentChangeListener(ExtentChangeListener listener)
Adds the specified listener to the list of those notified when an extent change happens. |
void |
addExtentPoint(GraphPoint point)
Adds a point to the list used to calculate extents. |
void |
addNameChangeListner(NameChangeListener listener)
Adds the specified listener to the list of those notified when a name change is requested. |
void |
clearExtents()
Clears the list of points used for extent calculation. |
abstract void |
draw(GCTransformer transformer)
Draws this object on the GC in the transformer. |
abstract void |
drawHover(GCTransformer transformer)
Draws this object, as an object that has the mouse over it, on the GC in the transformer. |
abstract void |
drawSelected(GCTransformer transformer)
Draws this object, as a selected object, on the GC in the transformer. |
GraphRectangle |
getExtents()
Calculates the minimum GraphRectangle that fully contains this object. |
java.lang.String |
getName()
Gets the name of this object. |
void |
handleMouseDoubleClick(org.eclipse.swt.widgets.Event e,
GraphPoint point)
Handles a mouse double click on this object. |
void |
handleMouseDown(org.eclipse.swt.widgets.Event e,
GraphPoint graphPoint)
Handles a mouse down event on this object. |
void |
handleMouseMove(org.eclipse.swt.widgets.Event e,
GraphPoint point)
Handles a mouse movement on this object. |
void |
handleMouseUp(org.eclipse.swt.widgets.Event e,
GraphPoint point)
Handles a mouse up event on this object. |
java.lang.Boolean |
isDirty()
Checks if this object is dirty. |
java.lang.Boolean |
isDrawable()
Checks if this item is a DRAWABLE. |
java.lang.Boolean |
isFocused()
Checks if this object is currently focused or not. |
java.lang.Boolean |
isGroup()
Checks if this item is a GROUP. |
java.lang.Boolean |
isLayer()
Checks if this item is a LAYER. |
java.lang.Boolean |
isSelected()
Checks if this object is selected or not. |
java.lang.Boolean |
isVisible()
Checks if this object is visible. |
abstract void |
move(java.lang.Double dx,
java.lang.Double dy,
CoordinateType type)
Moves the object by the specified x and y deltas. |
protected void |
recalculateExtents()
Recalculates the extents based off of the point list. |
void |
removeExtentChangeListener(ExtentChangeListener listener)
Removes the specified listener from the list of those notified when an extent change happens. |
void |
removeNameChangeListener(NameChangeListener listener)
Removes the specified listener from the list of those notified when a name change is requested. |
void |
setDirty(java.lang.Boolean isDirty)
Sets the dirty flag for this object. |
void |
setFocused(java.lang.Boolean focused)
Sets the current focus status of this object. |
java.lang.Boolean |
setName(java.lang.String name)
Sets the name of this object. |
void |
setSelected(java.lang.Boolean selected)
Sets the selected flag on this object. |
void |
setVisible(java.lang.Boolean visible)
Sets the visible flag on this object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected LayerComponentType componentType
protected java.util.List<GraphPoint> extentPointList
Constructor Detail |
---|
public LayerDrawable()
public LayerDrawable(java.lang.String name)
name
- Name of this object.
Throws
- IllegalArgumentException when name is null.Method Detail |
---|
public abstract void draw(GCTransformer transformer)
transformer
- GC Transformer for the device to draw on.
Throws
- IllegalArgumentException when transformer is null.public abstract void drawHover(GCTransformer transformer)
transformer
- GC Transformer for the device to draw on.
Throws
- IllegalArgumentException when transformer is null.public abstract void drawSelected(GCTransformer transformer)
transformer
- GC Transformer for the device to draw on.
Throws
- IllegalArgumentException when transformer is null.public abstract void move(java.lang.Double dx, java.lang.Double dy, CoordinateType type)
dx
- X Deltady
- Y Deltatype
- Type of coordinate system for X & Yprotected void recalculateExtents()
public GraphRectangle getExtents()
public java.lang.String getName()
public java.lang.Boolean setName(java.lang.String name)
name
- Name for this object.
Throws
- IllegalArgumentException when name is null.public void addNameChangeListner(NameChangeListener listener)
listener
- Listener to call when name change request is made.
java.lang.IllegalArgumentException
- when listener is null.public void removeNameChangeListener(NameChangeListener listener)
listener
- Listener to remove.
java.lang.IllegalArgumentException
- When listener is null.public void addExtentChangeListener(ExtentChangeListener listener)
listener
- Listener to call when extents change.
java.lang.IllegalArgumentException
- When listener is null.public void removeExtentChangeListener(ExtentChangeListener listener)
listener
- Listener to remove.
java.lang.IllegalArgumentException
- when listener is null.public java.lang.Boolean isFocused()
public void setFocused(java.lang.Boolean focused)
focused
- New focus value to set.
java.lang.IllegalArgumentException
- When focused is null.public java.lang.Boolean isSelected()
public void setSelected(java.lang.Boolean selected)
selected
- Value for selected flag.
java.lang.IllegalArgumentException
- When selected is null.public java.lang.Boolean isVisible()
public void setVisible(java.lang.Boolean visible)
visible
- Value for visible flag.
java.lang.IllegalArgumentException
- When visible is null.public java.lang.Boolean isDrawable()
public java.lang.Boolean isGroup()
public java.lang.Boolean isLayer()
public void handleMouseUp(org.eclipse.swt.widgets.Event e, GraphPoint point)
e
- SWT Event that was fired.point
- Location where mouse was as a GraphPoint.public void handleMouseDown(org.eclipse.swt.widgets.Event e, GraphPoint graphPoint)
e
- SWT Event that was fired.point
- Location where mouse was as a GraphPoint.public void handleMouseDoubleClick(org.eclipse.swt.widgets.Event e, GraphPoint point)
e
- SWT Event that was fired.point
- Location where mouse was as a GraphPoint.public void handleMouseMove(org.eclipse.swt.widgets.Event e, GraphPoint point)
e
- SWT Event that was fired.point
- Location where mouse was as a GraphPoint.public java.lang.Boolean isDirty()
public void setDirty(java.lang.Boolean isDirty)
isDirty
- Value to set for dirty flag.public void clearExtents()
public void addExtentPoint(GraphPoint point)
point
- Point to be used in extent calculation.
java.lang.IllegalArgumentException
- if point is null.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |