|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.tigris.gef.presentation.Fig
org.tigris.gef.presentation.FigGroup
org.tigris.gef.presentation.FigNode
public class FigNode
Class to present a node (such as a NetNode) in a diagram.
| Field Summary | |
|---|---|
protected boolean |
_blinkPorts
True if you want ports to show when the mouse moves in and be invisible otherwise. |
protected boolean |
_highlight
True when we want to draw the user's attention to this FigNode. |
static double |
ang135
|
static double |
ang225
|
static double |
ang315
|
static double |
ang45
Constants useful for determining what side (north, south, east, or west) a port is located on. |
| Fields inherited from class org.tigris.gef.presentation.Fig |
|---|
_allowsSaving, _context, _dashes, _dashPeriod, _dashStyle, _filled, _h, _w, _x, _y, an, annotationOwner, annotationStatus, BORDER, MIN_SIZE |
| Constructor Summary | |
|---|---|
FigNode()
|
|
FigNode(java.lang.Object node)
Constructs a new FigNode on the given node with the given owner. |
|
FigNode(java.lang.Object node,
java.util.Collection figs)
Constructs a new FigNode on the given node with the given owner and Figs. |
|
| Method Summary | |
|---|---|
void |
addFigEdge(FigEdge fe)
Adds a FigEdge to the list of them that need to be rerouted when this FigNode moves. |
void |
bindPort(java.lang.Object port,
Fig f)
Sets the port (some object in an underlying model) for Fig f. |
void |
cleanUp()
|
java.lang.Object |
clone()
|
boolean |
contains(int x,
int y)
Returns true if any Fig in the group contains the given point. |
java.lang.Object |
deepHitPort(int x,
int y)
Reply a port for the topmost Fig that actually has a port. |
void |
deleteFromModel()
When a FigNode is disposed, all of its edges are disposed. |
void |
dispose()
Deprecated. 0.11 use deleteFromModel() |
void |
endTrans()
When a FigNode is damaged, all of its edges may need repainting. |
java.util.List |
getFigEdges()
|
java.util.Collection |
getFigEdges(java.util.Collection c)
|
boolean |
getHighlight()
|
Fig |
getPortFig(java.lang.Object np)
Reply the Fig that displays the given NetPort. |
java.util.List |
getPortFigs()
Get all the figs that have some port as their owner |
int |
getPortSector(Fig portFig)
Reply the port's sector within the current view. |
void |
hidePorts()
Make the port Figs invisible. |
boolean |
hit(java.awt.Rectangle r)
Returns true if any Fig in the group hits the given rect. |
java.lang.Object |
hitPort(int x,
int y)
Reply the port that "owns" the topmost Fig under the given point, or null if none. |
java.lang.Object |
hitPort(java.awt.Point p)
Reply the NetPort associated with the topmost Fig under the mouse, or null if there is none. |
boolean |
isBlinkPorts()
Determine if ports are set to appear only on mouseover. |
boolean |
isDragConnectable()
Returns true if dragging from a port on this fig should automatically go to mode ModeCreateEdge |
void |
mouseClicked(java.awt.event.MouseEvent me)
Do nothing when mouse is clicked in FigNode. |
void |
mouseEntered(java.awt.event.MouseEvent me)
If the mouse enters this FigNode's bbox and the _blinkPorts flag is set, then show ports. |
void |
mouseExited(java.awt.event.MouseEvent me)
If the mouse exits this FigNode's bbox and the _blinkPorts flag is set, then hide ports. |
void |
mousePressed(java.awt.event.MouseEvent me)
Do nothing when mouse is pressed in FigNode. |
void |
mouseReleased(java.awt.event.MouseEvent me)
Do nothing when mouse is released in FigNode. |
void |
paint(java.awt.Graphics g)
Paints the FigNode to the given Graphics. |
void |
postLoad()
After the file is loaded, re-establish any connections from the model to the Figs |
void |
propertyChange(java.beans.PropertyChangeEvent pce)
The node object that this FigNode is presenting has changed state, or been disposed or highlighted. |
void |
removeFigEdge(FigEdge fe)
removes a FigEdge from the list of them that need to be rerouted when this FigNode moves. |
void |
removeFromDiagram()
When a FigNode is removed, all of its edges are removed. |
void |
removePort(Fig rep)
Removes a port from the current FigNode. |
void |
setBlinkPorts(boolean b)
Set the property of highlighting ports when the user moves the mouse over this FigNode. |
void |
setBounds(int x,
int y,
int w,
int h)
Set the bounding box to the given rect. |
void |
setEnclosingFig(Fig f)
USED BY PGML.tee |
void |
setHighlight(boolean b)
|
void |
setOwner(java.lang.Object node)
Sets the owner (a node in some underlying model). |
void |
showPorts()
Make the port Figs visible. |
void |
superTranslate(int dx,
int dy)
|
void |
translate(int dx,
int dy)
Translate all the Fig in the list by the given offset. |
void |
updateEdges()
|
| Methods inherited from class org.tigris.gef.presentation.FigGroup |
|---|
addFig, addFigs, calcBounds, deepSelect, elements, getDisplayedFigs, getExtraFrameSpace, getFigAt, getFigs, getFont, getFontFamily, getFontSize, getPrivateData, getSize, getSubFigBounds, getTextColor, getTextFillColor, getTextFilled, hitFig, isReshapable, isRotatable, iterator, parseDynObjects, removeAll, removeFig, setExtraFrameSpace, setFigs, setFigs, setFillColor, setFilled, setFont, setFontFamily, setFontSize, setLineColor, setLineWidth, setPrivateData, setTextColor, setTextFillColor, setTextFilled |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.tigris.gef.ui.Highlightable |
|---|
addPropertyChangeListener, removePropertyChangeListener |
| Field Detail |
|---|
public static final double ang45
public static final double ang135
public static final double ang225
public static final double ang315
protected boolean _blinkPorts
protected boolean _highlight
| Constructor Detail |
|---|
public FigNode()
public FigNode(java.lang.Object node)
node - The model item that this node represents
public FigNode(java.lang.Object node,
java.util.Collection figs)
node - the model item that this node representsfigs - the figs to be contained as a group by this FigNode| Method Detail |
|---|
public boolean isDragConnectable()
public java.lang.Object clone()
clone in class FigGrouppublic void setBlinkPorts(boolean b)
public boolean isBlinkPorts()
public void addFigEdge(FigEdge fe)
public void removeFigEdge(FigEdge fe)
public java.util.Collection getFigEdges(java.util.Collection c)
public java.util.List getFigEdges()
public void setOwner(java.lang.Object node)
setOwner in class Figpublic boolean hit(java.awt.Rectangle r)
hit in class FigGroupr - the rectangular hit area
public boolean contains(int x,
int y)
FigGroup
contains in class FigGroupFigCircle,
FigEdgepublic void setEnclosingFig(Fig f)
Fig
setEnclosingFig in class Figpublic void endTrans()
endTrans in class Figpublic void removeFromDiagram()
removeFromDiagram in class Figpublic void deleteFromModel()
deleteFromModel in class Figpublic void dispose()
public void bindPort(java.lang.Object port,
Fig f)
public void removePort(Fig rep)
public final java.lang.Object hitPort(java.awt.Point p)
public java.lang.Object hitPort(int x,
int y)
public java.lang.Object deepHitPort(int x,
int y)
public Fig getPortFig(java.lang.Object np)
public java.util.List getPortFigs()
public int getPortSector(Fig portFig)
Sectors
\ 1 /
\ /
\ /
2 \/ -2
/\
/ \
/ \
/ -1 \
public void paint(java.awt.Graphics g)
paint in class FigGrouppublic void setHighlight(boolean b)
setHighlight in interface Highlightablepublic boolean getHighlight()
getHighlight in interface Highlightablepublic void propertyChange(java.beans.PropertyChangeEvent pce)
propertyChange in interface java.beans.PropertyChangeListenerpropertyChange in class Figpublic void showPorts()
public void hidePorts()
public void mouseEntered(java.awt.event.MouseEvent me)
mouseEntered in interface java.awt.event.MouseListenerpublic void mouseExited(java.awt.event.MouseEvent me)
mouseExited in interface java.awt.event.MouseListenerpublic void mousePressed(java.awt.event.MouseEvent me)
mousePressed in interface java.awt.event.MouseListenerpublic void mouseReleased(java.awt.event.MouseEvent me)
mouseReleased in interface java.awt.event.MouseListenerpublic void mouseClicked(java.awt.event.MouseEvent me)
mouseClicked in interface java.awt.event.MouseListener
public void translate(int dx,
int dy)
FigGroup
translate in class FigGroup
public void superTranslate(int dx,
int dy)
public void setBounds(int x,
int y,
int w,
int h)
FigGroup
setBounds in class FigGroupx - new X co ordinate for figy - new Y co ordinate for figw - new width for figh - new height for figpublic void updateEdges()
public void postLoad()
postLoad in class Figpublic void cleanUp()
cleanUp in class Fig
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||