com.swfm.mica.events
Class MiICreateConnection

java.lang.Object
  extended bycom.swfm.mica.events.MiEventHandler
      extended bycom.swfm.mica.events.MiICreateConnection
All Implemented Interfaces:
MiiActionTypes, MiiCommandNames, MiiDisplayNames, MiiEventHandler, MiiEventTypes, MiiManagedPointValidator, MiiMessages
Direct Known Subclasses:
MiICreateConnectionUsingConnPoint

public class MiICreateConnection
extends MiEventHandler
implements MiiManagedPointValidator, MiiActionTypes, MiiDisplayNames

Version:
%I% %G%
Author:
Michael L. Davis

Field Summary
static java.lang.String Mi_START_NEW_LINE_SEGMENT_COMMAND_NAME
           
           
Constructor Summary
MiICreateConnection()
           
 
Method Summary
 MiiEventHandler copy()
          Returns a copy of this MiEventHandler.
 double findClosestPointOnLineToAPoint(MiPoint linePt1, MiPoint linePt2, MiPoint aPoint, MiPoint closestPtOnLine)
           
 boolean getConnectableToConnections()
           
 boolean getIgnoreConnectionsFromAConnectionToItself()
           
 MiAttributes getLineSnappedToConnectPointAttributes()
           
 double getMinDistancePerSegment()
           
 boolean getOnlyStartableAtConnections()
           
 MiConnection getPrototype()
           
 boolean getReplaceSectionsWithAnyConnectionsFromAConnectionToItself()
           
 boolean getSelectNewlyCreatedConnections()
           
 double getSnapToConnectionPointDistance()
           
 MiClosestValidManagedPointFinder getValidConnPointFinder()
           
 boolean isSnappingToMajorGridOnly()
           
 boolean isValidConnectionDestination(MiPart src, int srcConnPt, MiPart dest, int destConnPt)
           
 boolean isValidConnectionDestination(MiPart src, MiPart dest)
           
 boolean isValidConnectionSource(MiPart src, int srcConnPt, MiPart dest, int destConnPt)
           
 boolean isValidConnectionSource(MiPart src, MiPart dest)
           
 void setConnectableToConnections(boolean flag)
           
 void setConnectionConnectionPointLook(MiPart look)
           
 void setIgnoreConnectionsFromAConnectionToItself(boolean flag)
          Default is 'false'
 void setLineSnappedToConnectPointAttributes(MiAttributes atts)
           
 void setMinDistancePerSegment(double distance)
           
 void setOnlyStartableAtConnections(boolean flag)
           
 void setPrototype(MiConnection conn)
           
 void setPrototypeConnectionJunctionPoint(MiConnectionJunctionPoint pt)
           
 void setReplaceSectionsWithAnyConnectionsFromAConnectionToItself(boolean flag)
          Default is 'false'
 void setSelectNewlyCreatedConnections(boolean flag)
           
 void setSnappingToMajorGridOnly(boolean flag)
           
 void setSnapToConnectionPointDistance(double d)
           
 void setValidConnPointFinder(MiClosestValidManagedPointFinder f)
           
static void splitConnectionsIntoTwoAtPoint(MiConnection startOfPath, MiConnection restOfPath, MiBounds pointToSplitAt)
          Assumes both connections follow same, full path upon entry.
 
Methods inherited from class com.swfm.mica.events.MiEventHandler
addEventToCommandTranslation, addEventToCommandTranslation, addEventToCommandTranslation, getAlwaysConsumeTriggerEvents, getCommand, getEvent, getEventToCommandTranslation, getName, getNameForType, getObject, getRequestedCommands, getRequestedEvents, getTarget, getType, isCommand, isEnabled, isPositionDependent, isSingleton, isType, processCommand, processCommand, processEvent, removeAllEventToCommandTranslations, removeEventToCommandTranslation, removeEventToCommandTranslation, removeEventToCommandTranslation, removeEventToCommandTranslation, setAlwaysConsumeTriggerEvents, setCommand, setEnabled, setEventToCommandTranslation, setEventToCommandTranslation, setEventToCommandTranslation, setIsSingleton, setName, setObject, setPositionDependent, setPropertyValue, setTarget, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

Mi_START_NEW_LINE_SEGMENT_COMMAND_NAME

public static final java.lang.String Mi_START_NEW_LINE_SEGMENT_COMMAND_NAME
See Also:
Constant Field Values
Constructor Detail

MiICreateConnection

public MiICreateConnection()
Method Detail

setPrototype

public void setPrototype(MiConnection conn)

getPrototype

public MiConnection getPrototype()

setValidConnPointFinder

public void setValidConnPointFinder(MiClosestValidManagedPointFinder f)

getValidConnPointFinder

public MiClosestValidManagedPointFinder getValidConnPointFinder()

setSelectNewlyCreatedConnections

public void setSelectNewlyCreatedConnections(boolean flag)

getSelectNewlyCreatedConnections

public boolean getSelectNewlyCreatedConnections()

setMinDistancePerSegment

public void setMinDistancePerSegment(double distance)

getMinDistancePerSegment

public double getMinDistancePerSegment()

setSnapToConnectionPointDistance

public void setSnapToConnectionPointDistance(double d)

getSnapToConnectionPointDistance

public double getSnapToConnectionPointDistance()

setLineSnappedToConnectPointAttributes

public void setLineSnappedToConnectPointAttributes(MiAttributes atts)

getLineSnappedToConnectPointAttributes

public MiAttributes getLineSnappedToConnectPointAttributes()

setConnectableToConnections

public void setConnectableToConnections(boolean flag)

getConnectableToConnections

public boolean getConnectableToConnections()

setOnlyStartableAtConnections

public void setOnlyStartableAtConnections(boolean flag)

getOnlyStartableAtConnections

public boolean getOnlyStartableAtConnections()

setSnappingToMajorGridOnly

public void setSnappingToMajorGridOnly(boolean flag)

isSnappingToMajorGridOnly

public boolean isSnappingToMajorGridOnly()

setIgnoreConnectionsFromAConnectionToItself

public void setIgnoreConnectionsFromAConnectionToItself(boolean flag)
Default is 'false'


getIgnoreConnectionsFromAConnectionToItself

public boolean getIgnoreConnectionsFromAConnectionToItself()

setReplaceSectionsWithAnyConnectionsFromAConnectionToItself

public void setReplaceSectionsWithAnyConnectionsFromAConnectionToItself(boolean flag)
Default is 'false'


getReplaceSectionsWithAnyConnectionsFromAConnectionToItself

public boolean getReplaceSectionsWithAnyConnectionsFromAConnectionToItself()

setConnectionConnectionPointLook

public void setConnectionConnectionPointLook(MiPart look)

setPrototypeConnectionJunctionPoint

public void setPrototypeConnectionJunctionPoint(MiConnectionJunctionPoint pt)

isValidConnectionSource

public boolean isValidConnectionSource(MiPart src,
                                       MiPart dest)
Specified by:
isValidConnectionSource in interface MiiManagedPointValidator

isValidConnectionSource

public boolean isValidConnectionSource(MiPart src,
                                       int srcConnPt,
                                       MiPart dest,
                                       int destConnPt)
Specified by:
isValidConnectionSource in interface MiiManagedPointValidator

isValidConnectionDestination

public boolean isValidConnectionDestination(MiPart src,
                                            MiPart dest)
Specified by:
isValidConnectionDestination in interface MiiManagedPointValidator

isValidConnectionDestination

public boolean isValidConnectionDestination(MiPart src,
                                            int srcConnPt,
                                            MiPart dest,
                                            int destConnPt)
Specified by:
isValidConnectionDestination in interface MiiManagedPointValidator

findClosestPointOnLineToAPoint

public double findClosestPointOnLineToAPoint(MiPoint linePt1,
                                             MiPoint linePt2,
                                             MiPoint aPoint,
                                             MiPoint closestPtOnLine)

splitConnectionsIntoTwoAtPoint

public static void splitConnectionsIntoTwoAtPoint(MiConnection startOfPath,
                                                  MiConnection restOfPath,
                                                  MiBounds pointToSplitAt)
Assumes both connections follow same, full path upon entry. Assumes any connection layouts not enabled.


copy

public MiiEventHandler copy()
Returns a copy of this MiEventHandler.

Specified by:
copy in interface MiiEventHandler
Overrides:
copy in class MiEventHandler
Returns:
the copy