|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.cmc.tcgui.TCObjectView.TCObjectHandle
Title: Class TCObjectHandle
Description: Basic handle for TCObjectView. Size handling code is based on class VertexView.SizeHandle
Copyright: Copyright (c) 2003
Company: CMC Computers
Field Summary | |
protected Rectangle |
cachedBounds
|
protected int |
CONNECT_HANDLE
|
protected org.jgraph.graph.GraphContext |
context
Reference to the context for the specified view. |
protected org.jgraph.graph.CellView[] |
contextViews
|
protected Point |
currentPoint
Connection target |
protected TCPort |
currentPort
Port to connect to |
protected boolean |
dragged
|
protected boolean |
firstDrag
|
protected boolean |
firstOverlayInvocation
|
protected Point |
firstPoint
Point when the connecting started |
protected TCPort |
firstPort
Port being connected |
protected org.jgraph.JGraph |
graph
|
protected int |
handle
Value of the handle being used |
protected Rectangle |
initialBounds
|
protected int |
MOVE_HANDLE
|
protected int |
NO_HANDLE
Indexes of the active control point. |
protected Graphics |
offgraphics
|
protected Image |
offscreen
Double Buffer |
protected int |
originOffsetX
Offset of the origin relative to mousePressed's x |
protected int |
originOffsetY
Offset of the origin relative to mousePressed's x |
protected org.jgraph.graph.CellView[] |
portViews
|
protected Rectangle[] |
r
Array of control points represented as rectangles. |
Constructor Summary | |
TCObjectView.TCObjectHandle(org.jgraph.graph.GraphContext ctx)
Create handle for outter classes |
Method Summary | |
protected Rectangle |
computeBounds(MouseEvent event)
Computes new bounds when handling move or resize |
protected void |
connect(TCPort port1,
TCPort port2)
Called when the connecting is done and the connection is allowed May be overriden by subclassers. |
protected int |
connectionAllowed(TCPort port1,
TCPort port2)
Decide whether the connection between ports is allowed |
protected TCPort |
getMatchingPort(TCObject tco)
Get matching port of the counterpart TCObject when connecting. |
protected boolean |
handleMove()
Returns true if this cell view is the only one in the selection. |
protected boolean |
handleResize()
Returns true if the view's auto size is off. |
protected void |
initOffscreen()
Double Buffers by David Larsson |
protected void |
makeBoundEdit(Rectangle bounds)
Makes standard move/resize edit. |
void |
mouseDragged(MouseEvent event)
Process mouse dragged event. |
void |
mouseMoved(MouseEvent event)
Invoked when the mouse pointer has been moved on a component (with no buttons down). |
void |
mousePressed(MouseEvent event)
Process mouse pressed event. |
void |
mouseReleased(MouseEvent e)
Handle the mouse released event |
protected Rectangle |
moved(Graphics g,
Rectangle bounds)
If handleMove() returns true, this is called whenever the cell view is moved. |
protected void |
movingDone(Rectangle bounds)
If handleMove() is true, this is called when the cell movement is done. |
void |
overlay(Graphics g)
Overlay the handle |
void |
paint(Graphics g)
Paint the handle |
protected Rectangle |
resized(Graphics g,
Rectangle bounds)
If handleResize() is true, this is called whenever the cell view is resized. |
protected void |
resizingDone(Rectangle bounds)
If handleResize() is true, this is called when the cell resizing is done. |
protected void |
startConnecting(TCPort port)
Starts connecting ports Called by subclassers to connect specific ports |
protected void |
updateConnect(Graphics g,
MouseEvent e,
boolean makeNew)
Updates the connection state. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected transient Image offscreen
protected transient Graphics offgraphics
protected transient boolean firstDrag
protected transient org.jgraph.JGraph graph
protected transient org.jgraph.graph.CellView[] portViews
protected transient Rectangle cachedBounds
protected transient org.jgraph.graph.GraphContext context
protected transient Rectangle initialBounds
protected transient int originOffsetX
protected transient int originOffsetY
protected transient org.jgraph.graph.CellView[] contextViews
protected transient Point firstPoint
protected transient TCPort firstPort
protected transient Point currentPoint
protected transient TCPort currentPort
protected final transient int NO_HANDLE
protected final transient int MOVE_HANDLE
protected final transient int CONNECT_HANDLE
protected transient int handle
protected transient Rectangle[] r
protected boolean firstOverlayInvocation
protected transient boolean dragged
Constructor Detail |
public TCObjectView.TCObjectHandle(org.jgraph.graph.GraphContext ctx)
ctx
- Current GraphContextMethod Detail |
protected boolean handleResize()
protected void startConnecting(TCPort port)
port
- port to be connected to a counterpartprotected int connectionAllowed(TCPort port1, TCPort port2)
port1
- first port to connectport2
- second port to connect
protected void connect(TCPort port1, TCPort port2)
port1
- first port to connectport2
- second port to connectprotected boolean handleMove()
protected Rectangle moved(Graphics g, Rectangle bounds)
g
- Graphics that may be used for paintingbounds
- current bounds of the cell
handleMove()
protected void movingDone(Rectangle bounds)
bounds
- new bounds of the cellprotected Rectangle resized(Graphics g, Rectangle bounds)
g
- Graphics that may be used for paintingbounds
- current bounds of the cell
handleResize()
protected void resizingDone(Rectangle bounds)
bounds
- new bounds of the cellprotected void makeBoundEdit(Rectangle bounds)
public void paint(Graphics g)
paint
in interface org.jgraph.graph.CellHandle
g
- Graphics to paint onprotected void initOffscreen()
public void overlay(Graphics g)
overlay
in interface org.jgraph.graph.CellHandle
g
- Graphics to do overlay onpublic void mouseMoved(MouseEvent event)
mouseMoved
in interface org.jgraph.graph.CellHandle
public void mousePressed(MouseEvent event)
mousePressed
in interface org.jgraph.graph.CellHandle
public void mouseDragged(MouseEvent event)
mouseDragged
in interface org.jgraph.graph.CellHandle
protected TCPort getMatchingPort(TCObject tco)
tco
- TCObject to get matching port for
protected void updateConnect(Graphics g, MouseEvent e, boolean makeNew)
g
- graphics to draw the connection state one
- mouse event to make the update formakeNew
- false if erasing the old connection state, true
if making a new oneprotected Rectangle computeBounds(MouseEvent event)
event
- MouseEvent to compute new bounds for
public void mouseReleased(MouseEvent e)
mouseReleased
in interface org.jgraph.graph.CellHandle
e
- event to be handled
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |