Package diva.canvas.connector
Class ConnectorEvent
- java.lang.Object
-
- java.util.EventObject
-
- diva.canvas.connector.ConnectorEvent
-
- All Implemented Interfaces:
java.io.Serializable
public class ConnectorEvent extends java.util.EventObjectA graph event that is emitted when anything interesting happens inside a graph by way of a GraphModel. Each graph event contains an ID, a source, and a previous value for all changes and deletions, the specifics of which are described on a case-by-case basis below.- Version:
- $Id$
- Author:
- Michael Shilman, John Reekie, Contributor: Edward A. Lee
- See Also:
- Serialized Form
- Pt.AcceptedRating:
- Red
-
-
Field Summary
Fields Modifier and Type Field Description static intBOTH_ENDSThis event is concerns both ends of the connector.static intCONNECTOR_DRAGGEDSignifies that a connector is dragged some distancestatic intCONNECTOR_DROPPEDSignifies that a connector end is dropped.static intCONNECTOR_SNAPPEDSignifies that a connector end is snapped to a possible target.static intCONNECTOR_UNSNAPPEDSignifies that a connector end is unsnapped from the original site that it was attached to, or from a possible target.static intHEAD_ENDThis event concerns the head end of the connector.static intMIDPOINTThis event is concerns the midpoint of the connector.static intTAIL_ENDThis event concerns the tail end of the connector.
-
Constructor Summary
Constructors Constructor Description ConnectorEvent(int id, java.lang.Object source, Figure target, Connector connector, int end)Construct a ConnectorEvent with the given source, target, connector, and "end" flag.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConnectorgetConnector()Return the connector that this event concerns.intgetEnd()Return the end of the connector that this event concerns.intgetID()Return the type id for this event.FiguregetTarget()Return the target that the connector is snapped to or unsnapped from.java.lang.StringtoString()
-
-
-
Field Detail
-
CONNECTOR_DRAGGED
public static final int CONNECTOR_DRAGGED
Signifies that a connector is dragged some distance- See Also:
- Constant Field Values
-
CONNECTOR_DROPPED
public static final int CONNECTOR_DROPPED
Signifies that a connector end is dropped. If the connector is currently snapped to a target, the target can be obtained from the event as the source field.- See Also:
- Constant Field Values
-
CONNECTOR_SNAPPED
public static final int CONNECTOR_SNAPPED
Signifies that a connector end is snapped to a possible target.- See Also:
- Constant Field Values
-
CONNECTOR_UNSNAPPED
public static final int CONNECTOR_UNSNAPPED
Signifies that a connector end is unsnapped from the original site that it was attached to, or from a possible target.- See Also:
- Constant Field Values
-
HEAD_END
public static final int HEAD_END
This event concerns the head end of the connector.- See Also:
getEnd(), Constant Field Values
-
TAIL_END
public static final int TAIL_END
This event concerns the tail end of the connector.- See Also:
getEnd(), Constant Field Values
-
BOTH_ENDS
public static final int BOTH_ENDS
This event is concerns both ends of the connector.- See Also:
getEnd(), Constant Field Values
-
MIDPOINT
public static final int MIDPOINT
This event is concerns the midpoint of the connector.- See Also:
getEnd(), Constant Field Values
-
-
Constructor Detail
-
ConnectorEvent
public ConnectorEvent(int id, java.lang.Object source, Figure target, Connector connector, int end)Construct a ConnectorEvent with the given source, target, connector, and "end" flag. The source is the layer in which the connector exists, while the target is the figure that the connector is snapped to or unsnapped from.
-
-
Method Detail
-
getConnector
public Connector getConnector()
Return the connector that this event concerns.
-
getEnd
public int getEnd()
Return the end of the connector that this event concerns.
-
getID
public int getID()
Return the type id for this event.
-
getTarget
public Figure getTarget()
Return the target that the connector is snapped to or unsnapped from.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.util.EventObject
-
-