public class NetMarqueeHandler extends BasicMarqueeHandler
currentPoint, marqueeBounds, previousCursor, startPoint
Constructor and Description |
---|
NetMarqueeHandler(NetGraph net) |
Modifier and Type | Method and Description |
---|---|
void |
connectElementsOrIgnoreFlow()
If there are valid source and target ports specified as a result
of a flow relation being drawn, this method will draw a flow connecting
these two ports, resulting in a flow relation between the parent elements
of the ports.
|
NetGraph |
getNet() |
protected void |
hidePort(PortView port)
Hides the specified port.
|
boolean |
isForceMarqueeEvent(java.awt.event.MouseEvent event)
Determines whether the default marquee behaviour is sufficient, or whether
our own response to mouse events are more appropriate.
|
void |
mouseDragged(java.awt.event.MouseEvent event)
Defaults to typical marquee behaviour unless a flow relation is being drawn.
|
void |
mouseMoved(java.awt.event.MouseEvent event)
Defaults to typical marquee behaviour if the PaletteBar is in Marquee mode,
Otherwise, the state of this marquee is determined through what lies underneath
the mouse.
|
void |
mousePressed(java.awt.event.MouseEvent event)
Defaults to typical marquee behaviour when the marquee palette button
is selected.
|
void |
mouseReleased(java.awt.event.MouseEvent event)
Defaults to typical marquee behaviour unless a flow relation is being
drawn.
|
protected void |
paintPort(PortView port,
boolean show) |
protected void |
paintPotentialFlow()
Paints a 'potential' flow from a source port to the current point
being tracked by the marquee handler (the point under the mouse).
|
protected void |
showPort(PortView port)
Makes the specified port visible.
|
getCurrentPoint, getGraphForEvent, getMarqueeBounds, getPreviousCursor, getStartPoint, handleMarqueeEvent, isMarqueeTriggerEvent, overlay, paint, processMouseDraggedEvent, setCurrentPoint, setMarqueeBounds, setPreviousCursor, setStartPoint
public NetMarqueeHandler(NetGraph net)
public boolean isForceMarqueeEvent(java.awt.event.MouseEvent event)
BasicMarqueeHandler
in the following scenarios:
BasicMarqueeHandler
to be used on them. What remains in
this class is the drawing of flows between net elements.isForceMarqueeEvent
in class BasicMarqueeHandler
public NetGraph getNet()
public void mouseMoved(java.awt.event.MouseEvent event)
mouseMoved
in class BasicMarqueeHandler
event
- the mouse eventpublic void mousePressed(java.awt.event.MouseEvent event)
BasicMarqueeHandler
,
which is typically to begin a select/drag operation on the element. If there is
a valid outgoing flow under the mouse, this is a trigger to begin drawing a flow relation.mousePressed
in class BasicMarqueeHandler
public void mouseDragged(java.awt.event.MouseEvent event)
mouseDragged
in class BasicMarqueeHandler
public void mouseReleased(java.awt.event.MouseEvent event)
mouseReleased
in class BasicMarqueeHandler
protected void hidePort(PortView port)
protected void showPort(PortView port)
port
- protected void paintPort(PortView port, boolean show)
protected void paintPotentialFlow()
public void connectElementsOrIgnoreFlow()