|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectCH.ifa.draw.standard.AbstractFigure
CH.ifa.draw.standard.CompositeFigure
org.openbp.cockpit.modeler.figures.tag.AbstractTagFigure
public abstract class AbstractTagFigure
An AbstractTagFigure represents a single tag. It is graphically represented by its presentation figure and can contain any amount of subFigures. The subFigures are layouted by using an Layouter. Contents can be divided using SpacerFigures and SeparatorFigures, the former is also used to create an offset to the center. Each Tag cotains an origin, around which rotating is resolved, a current angle, its layouter, its presentationFigure and its contents. Contents of the are represented by TagContent objects which contain the contained figure as well as its content type. The content state of the tag is actually the definition which content types are visible, all applicable stati being binary ORed to form the content state.
| Nested Class Summary | |
|---|---|
class |
AbstractTagFigure.TagContent
Simple class that combines a figure object with additional information, i\.e\. about the type of the figure. |
| Field Summary | |
|---|---|
protected double |
angle
Angle of the tag |
protected java.util.List |
content
Actual content of the tag (contains TagContent objects) |
static int |
CONTENT_DATA
Content that refers to the flow of data |
static int |
CONTENT_FLOW
Content that refers to flow of control |
static int |
CONTENT_ICON
Icon content |
static int |
CONTENT_INTERACTION
Flag for interaction-related content |
static int |
CONTENT_STATIC
Flag for static content |
static int |
CONTENT_TEXT
Static text content or similar |
static int |
CONTENT_USER1
Content that refers to the flow of data |
static int |
CONTENT_USER2
Content that refers to the flow of data |
protected int |
contentState
Content state of the tag |
protected int |
currentContentState
Current (decorated) content state of the tag |
static java.lang.String |
DECO_TAGCONTENTTYPE
Decoration key for the content type (used with Integer objects) |
protected TagLayouter |
layouter
The layouter is responsible for laying out the tag content |
protected java.awt.Point |
origin
The center from which the tag emerges in world coordinates. |
protected VisualElement |
parent
Containing figure |
protected XFigure |
presentationFigure
Presentation-figure (the tag itself) |
protected CH.ifa.draw.framework.Figure |
shadowFigure
Represents the figure's shadow |
protected int |
visualStatus
Visual status as defined by VisualElement |
| Fields inherited from class CH.ifa.draw.standard.CompositeFigure |
|---|
_nHighestZ, _nLowestZ, fFigures |
| Fields inherited from interface org.openbp.cockpit.modeler.figures.VisualElement |
|---|
VISUAL_DISPLAY_ALL, VISUAL_DND_PARTICIPANT, VISUAL_VISIBLE |
| Fields inherited from interface CH.ifa.draw.framework.Figure |
|---|
POPUP_MENU |
| Constructor Summary | |
|---|---|
AbstractTagFigure(VisualElement parent,
java.lang.Object modelObject)
Constructor. |
|
| Method Summary | |
|---|---|
void |
addContent(CH.ifa.draw.framework.Figure newFigure,
int type)
Adds a figure with a given content type to the content list of this tag. |
void |
addContentAt(CH.ifa.draw.framework.Figure newFigure,
int index,
int type)
Adds a figure with a given content type to the content list of this tag at the given position. |
void |
applyContentState()
Rebuilds the child figure list of the tag according to the (decorated) tag content state from the content list of the tag. |
void |
basicDisplayBox(java.awt.Point origin,
java.awt.Point corner)
|
protected void |
basicMoveBy(int dx,
int dy)
|
protected void |
basicSetAngle(double angle)
Sets the angle to the given one. |
boolean |
canConnect()
|
void |
changed()
|
void |
checkDecoratedContentState()
Rebuilds the tag content of the decorated content state differs from the current content state. |
java.awt.Rectangle |
compactDisplayBox()
Returns the display box of the presentation figure. |
CH.ifa.draw.framework.Connector |
connectorAt(int x,
int y)
|
boolean |
containsPoint(int x,
int y)
|
protected XFigure |
createPresentationFigure()
Creates the presentation figure of this tag. |
Orientation |
determine2WayOrientation(boolean vertical)
Determines the 2-way orientation of the tag figure. |
int |
determineDecoratedContentState()
Gets the tag content state after decoration. |
java.awt.Rectangle |
displayBox()
|
void |
dragActionTriggered(java.lang.Object regionId,
java.awt.Point p)
Called to signal additional actions, such as hovering for a certain time over the region. |
void |
dragEnded(java.awt.datatransfer.Transferable transferable)
called when a dragging has ended. |
void |
dragStarted(java.awt.datatransfer.Transferable transferable)
Called when a dragging has been started. |
void |
draw(java.awt.Graphics g)
Saves the transformation, draws the tag and restores the transformation. |
CH.ifa.draw.framework.Figure |
findFigure(int x,
int y)
|
CH.ifa.draw.framework.Figure |
findFigureInside(int x,
int y)
|
java.util.List |
getAllDropRegions(java.util.List flavors,
java.awt.datatransfer.Transferable data,
java.awt.event.MouseEvent mouseEvent)
Returns a list of all regions of this client AND possible sub clients. |
java.util.List |
getAllImportersAt(java.awt.Point p)
Returns all importers which will be accepted at the given point by this client or one of its sub clients. |
double |
getAngle()
Gets the rotation angle. |
CH.ifa.draw.framework.Figure |
getCenterFigure()
Gets the figure that forms the center of the rotation (usually the parent). |
java.awt.Rectangle |
getCenterFigureBox()
Returns the display box of the center figure or null. |
java.util.List |
getContent()
|
CH.ifa.draw.framework.Figure |
getContentFigureAt(int pos)
Gets the content figure (visible or not) at the specified position |
int |
getContentState()
Gets the tag content state. |
ProcessDrawing |
getDrawing()
Gets the drawing the element is a part of. |
java.util.List |
getDropRegions(java.util.List flavors,
java.awt.datatransfer.Transferable data,
java.awt.event.MouseEvent mouseEvent)
Returns a list of drop regions of this client that are compatible with the provided data flavors. |
java.awt.Color |
getFillColor()
|
java.util.List |
getImportersAt(java.awt.Point p)
Returns all importers which will be accepted at the given point by this client. |
TagLayouter |
getLayouter()
Gets the the layouter is responsible for laying out the tag content. |
int |
getNumberOfContents()
Gets the number of content objects (visible or not) of this tag. |
java.awt.Point |
getOrigin()
Gets the origin. |
CH.ifa.draw.framework.Figure |
getParent()
Gets the parent figure of this figure. |
VisualElement |
getParentElement()
Gets parent element of this element, if any. |
CH.ifa.draw.framework.Figure |
getPresentationFigure()
Gets the presentation figure of this element. |
CH.ifa.draw.framework.Figure |
getShadow()
Returns the shadow figure of this object. |
java.util.List |
getSubClients()
Returns subordinate clients of this client. |
int |
getVisualStatus()
Gets the visual status as defined by VisualElement |
boolean |
handleEvent(VisualElementEvent event)
Handler method that is called for handling events. |
java.util.Vector |
handles()
We do not want any handles, so we return an empty vector. |
boolean |
importData(java.lang.Object regionId,
java.awt.datatransfer.Transferable data,
java.awt.Point p)
Imports the given transferable into the given region. |
protected void |
initContent(java.lang.Object modelObject)
Creates the content of this tag. |
protected void |
initPresentationFigure()
Initializes the presentation figure and its shadow. |
protected void |
initShadow()
Creates the shadow figure of the tag's presentation figure. |
protected void |
initTagLayouter()
Creates the layouter for this tag. |
void |
invalidate()
|
boolean |
isVerticalOrientation()
Checks if the orientation of the tag is vertical or horizontal. |
boolean |
isVisible()
Gets the flag if the element is currently visible. |
void |
layoutTag()
Layouts the tag. |
void |
moveContent(int oldIndex,
int newIndex)
Moves content from old to new index. |
protected java.awt.Rectangle |
positionDisplayBox(java.awt.Rectangle rect)
Positions the display box of the tag relative to its parent figure. |
void |
read(CH.ifa.draw.util.StorableInput dr)
|
void |
setAngle(double angle)
Sets the rotation angle. |
void |
setContentState(int contentState)
Sets and applies the tag content state. |
void |
setDrawing(ProcessDrawing processDrawing)
Sets the drawing the element is a part of. |
void |
setFillColor(java.awt.Color color)
|
void |
setLayouter(TagLayouter layouter)
Sets the the layouter is responsible for laying out the tag content. |
void |
setOrigin(java.awt.Point origin)
Sets the origin. |
void |
setParent(CH.ifa.draw.framework.Figure parent)
Sets the parent figure of this figure. |
void |
setVisible(boolean visible)
Sets the flag if the element is currently visible. |
void |
setVisualStatus(int visualStatus)
Sets the visual status as defined by VisualElement |
void |
updateFigure()
Causes all UpdatableFigure children to updateFigure. |
void |
updatePresentationFigure()
Updates (reinitializes) the presentation figure. |
void |
write(CH.ifa.draw.util.StorableOutput dw)
|
| Methods inherited from class CH.ifa.draw.standard.CompositeFigure |
|---|
add, addAll, addAll, bringToFront, draw, figureAt, figureChanged, figureCount, figureInvalidated, figureRemoved, figureRequestRemove, figureRequestUpdate, figures, figures, figuresReverse, findFigure, findFigure, findFigureInsideWithout, findFigureWithout, getFigureFromLayer, getLayer, includes, init, orphan, orphanAll, orphanAll, release, remove, removeAll, removeAll, removeAll, replace, sendToBack, sendToLayer |
| Methods inherited from class CH.ifa.draw.standard.AbstractFigure |
|---|
addFigureChangeListener, addToContainer, center, clone, connectedTextLocator, connectionInsets, connectorVisibility, decompose, displayBox, displayBox, getAttribute, getZValue, isEmpty, listener, moveBy, removeFigureChangeListener, removeFromContainer, setAttribute, setZValue, size, willChange |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface CH.ifa.draw.framework.FigureChangeListener |
|---|
figureChanged, figureInvalidated, figureRemoved, figureRequestRemove, figureRequestUpdate |
| Methods inherited from interface CH.ifa.draw.framework.Figure |
|---|
addFigureChangeListener, addToContainer, center, clone, connectedTextLocator, connectionInsets, connectorVisibility, decompose, displayBox, displayBox, figures, getAttribute, getZValue, includes, isEmpty, listener, moveBy, release, removeFigureChangeListener, removeFromContainer, setAttribute, setZValue, size, willChange |
| Field Detail |
|---|
public static final java.lang.String DECO_TAGCONTENTTYPE
public static final int CONTENT_ICON
public static final int CONTENT_TEXT
public static final int CONTENT_FLOW
public static final int CONTENT_DATA
public static final int CONTENT_USER1
public static final int CONTENT_USER2
public static final int CONTENT_INTERACTION
public static final int CONTENT_STATIC
protected VisualElement parent
protected XFigure presentationFigure
protected CH.ifa.draw.framework.Figure shadowFigure
protected java.util.List content
protected TagLayouter layouter
protected double angle
protected java.awt.Point origin
protected int contentState
protected int currentContentState
protected int visualStatus
VisualElement
| Constructor Detail |
|---|
public AbstractTagFigure(VisualElement parent,
java.lang.Object modelObject)
parent - ParentmodelObject - Model object this tag represents or null| Method Detail |
|---|
protected void initPresentationFigure()
protected XFigure createPresentationFigure()
XRoundRectangleFigure
protected void initShadow()
protected void initTagLayouter()
HorizontalLayouter
protected void initContent(java.lang.Object modelObject)
modelObject - Model object this tag represents or nullpublic java.util.List getContent()
public void addContent(CH.ifa.draw.framework.Figure newFigure,
int type)
applyContentState() to apply the content to the list of displayed figures
according to the current content state of the tag.
newFigure - The figure to addtype - The content type of the figure to add
public void addContentAt(CH.ifa.draw.framework.Figure newFigure,
int index,
int type)
applyContentState() to apply the content to the list of displayed figures
according to the current content state of the tag.
newFigure - The figure to addindex - Position to insert the new figure at (0 = at the beginning)type - The content type of the figure to add
public void moveContent(int oldIndex,
int newIndex)
public int getNumberOfContents()
public CH.ifa.draw.framework.Figure getContentFigureAt(int pos)
public void checkDecoratedContentState()
public void applyContentState()
public void setContentState(int contentState)
public int getContentState()
public int determineDecoratedContentState()
DecorationMgr
The DECO_TAGCONTENTTYPE key will be used and the Integer value of the content state
as returned by getContentState() will be passed to the registered decorators as value.
public boolean isVerticalOrientation()
public void basicDisplayBox(java.awt.Point origin,
java.awt.Point corner)
basicDisplayBox in interface CH.ifa.draw.framework.FigurebasicDisplayBox in class CH.ifa.draw.standard.AbstractFigure
protected void basicMoveBy(int dx,
int dy)
basicMoveBy in class CH.ifa.draw.standard.CompositeFigurepublic java.util.Vector handles()
handles in interface CH.ifa.draw.framework.Figurehandles in class CH.ifa.draw.standard.AbstractFigure
public CH.ifa.draw.framework.Connector connectorAt(int x,
int y)
connectorAt in interface CH.ifa.draw.framework.FigureconnectorAt in class CH.ifa.draw.standard.AbstractFigurepublic java.awt.Rectangle displayBox()
displayBox in interface CH.ifa.draw.framework.FiguredisplayBox in class CH.ifa.draw.standard.AbstractFigurepublic void draw(java.awt.Graphics g)
draw in interface CH.ifa.draw.framework.Figuredraw in class CH.ifa.draw.standard.CompositeFigurepublic void changed()
changed in interface CH.ifa.draw.framework.Figurechanged in class CH.ifa.draw.standard.AbstractFigurepublic void invalidate()
invalidate in interface CH.ifa.draw.framework.Figureinvalidate in class CH.ifa.draw.standard.AbstractFigure
public boolean containsPoint(int x,
int y)
containsPoint in interface CH.ifa.draw.framework.FigurecontainsPoint in class CH.ifa.draw.standard.AbstractFigurepublic boolean canConnect()
canConnect in interface CH.ifa.draw.framework.FigurecanConnect in class CH.ifa.draw.standard.AbstractFigure
public CH.ifa.draw.framework.Figure findFigure(int x,
int y)
findFigure in class CH.ifa.draw.standard.CompositeFigure
public CH.ifa.draw.framework.Figure findFigureInside(int x,
int y)
findFigureInside in interface CH.ifa.draw.framework.FigurefindFigureInside in class CH.ifa.draw.standard.CompositeFigurepublic void layoutTag()
layoutTag in interface LayoutableTagpublic TagLayouter getLayouter()
getLayouter in interface LayoutableTagpublic void setLayouter(TagLayouter layouter)
setLayouter in interface LayoutableTagprotected java.awt.Rectangle positionDisplayBox(java.awt.Rectangle rect)
rect - Rectangle object that contains the size of the figure
public java.awt.Point getOrigin()
public void setOrigin(java.awt.Point origin)
public double getAngle()
public void setAngle(double angle)
public CH.ifa.draw.framework.Figure getCenterFigure()
protected void basicSetAngle(double angle)
public Orientation determine2WayOrientation(boolean vertical)
vertical - true: Return LEFT or RIGHTOrientation.RIGHT/Orientation.BOTTOM/Orientation.LEFT/Orientation.TOPpublic java.awt.Rectangle getCenterFigureBox()
Expandable center figures also.
public java.awt.Rectangle compactDisplayBox()
compactDisplayBox in interface Expandablepublic void setDrawing(ProcessDrawing processDrawing)
VisualElement
setDrawing in interface VisualElementpublic ProcessDrawing getDrawing()
VisualElement
getDrawing in interface VisualElementpublic VisualElement getParentElement()
VisualElement
getParentElement in interface VisualElementpublic CH.ifa.draw.framework.Figure getPresentationFigure()
VisualElement
getPresentationFigure in interface VisualElementpublic void updatePresentationFigure()
VisualElement
updatePresentationFigure in interface VisualElementpublic boolean isVisible()
VisualElement
isVisible in interface VisualElementpublic void setVisible(boolean visible)
VisualElement
setVisible in interface VisualElementpublic int getVisualStatus()
VisualElement
public void setVisualStatus(int visualStatus)
VisualElement
public boolean handleEvent(VisualElementEvent event)
VisualElement
handleEvent in interface VisualElementevent - Event that desribes the event
public void updateFigure()
updateFigure in interface UpdatableFigurepublic CH.ifa.draw.framework.Figure getParent()
ChildFigure
getParent in interface ChildFigurepublic void setParent(CH.ifa.draw.framework.Figure parent)
ChildFigure
setParent in interface ChildFigureparent - The parent or null if the figure does not have a parentpublic CH.ifa.draw.framework.Figure getShadow()
ShadowDropper
getShadow in interface ShadowDropperpublic void setFillColor(java.awt.Color color)
public java.awt.Color getFillColor()
public void read(CH.ifa.draw.util.StorableInput dr)
read in interface CH.ifa.draw.util.Storableread in class CH.ifa.draw.standard.CompositeFigurepublic void write(CH.ifa.draw.util.StorableOutput dw)
write in interface CH.ifa.draw.util.Storablewrite in class CH.ifa.draw.standard.CompositeFigure
public void dragActionTriggered(java.lang.Object regionId,
java.awt.Point p)
InteractionClient
dragActionTriggered in interface InteractionClientregionId - Id of the region to import into (see BasicDropRegion.getId)p - Current mouse position in screen coordinatespublic void dragStarted(java.awt.datatransfer.Transferable transferable)
InteractionClient
dragStarted in interface InteractionClienttransferable - Transferable to be draggedpublic void dragEnded(java.awt.datatransfer.Transferable transferable)
InteractionClient
dragEnded in interface InteractionClienttransferable - Transferable that has been dragged
public java.util.List getAllDropRegions(java.util.List flavors,
java.awt.datatransfer.Transferable data,
java.awt.event.MouseEvent mouseEvent)
InteractionClient
getAllDropRegions in interface InteractionClientflavors - List of data flavors to checkdata - Transferable to importmouseEvent - Mouse event that initiated the drag action
DragAwareRegion object or null if the drop client
or one of its sub clients cannot satisfy at least one of the supplied data flavors
public java.util.List getDropRegions(java.util.List flavors,
java.awt.datatransfer.Transferable data,
java.awt.event.MouseEvent mouseEvent)
InteractionClient
getDropRegions in interface InteractionClientflavors - List of data flavors to checkdata - Transferable to be importedmouseEvent - Mouse event that initiated the drag action
DragAwareRegion object or null if the drop client
cannot satisfy at least one of the supplied data flavors.public java.util.List getImportersAt(java.awt.Point p)
InteractionClient
getImportersAt in interface InteractionClientp - Current mouse position in screen coordinates
Importer objects or nullpublic java.util.List getAllImportersAt(java.awt.Point p)
InteractionClient
getAllImportersAt in interface InteractionClientp - Current mouse position in screen coordinates
Importer objects or nullpublic java.util.List getSubClients()
InteractionClient
getSubClients in interface InteractionClientInteractionClient objects or null if this drop client doesn't have sub drop clients
public boolean importData(java.lang.Object regionId,
java.awt.datatransfer.Transferable data,
java.awt.Point p)
InteractionClient
importData in interface InteractionClientregionId - Id of the region to import into (see BasicDropRegion.getId)data - Transferable to importp - Drop point in glass coordinates
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||