com.tensegrity.graph.view
Class InteractionSettings

java.lang.Object
  extended bycom.tensegrity.graph.view.InteractionSettings
All Implemented Interfaces:
java.io.Serializable

public final class InteractionSettings
extends java.lang.Object
implements java.io.Serializable

Interaction settings. This class can be used to control global generic interaction settings for VisualGraphView instances.

Version:
$Id: InteractionSettings.java,v 1.21 2005/10/19 13:27:14 BurkhardWick Exp $
Author:
Stepan Rutz, MichaelKegel
See Also:
Serialized Form

Field Summary
static int EDGEINSERTMODE_AUTOCENTER
          edge-insert modes for edges
static int EDGEINSERTMODE_DISABLED
          edge-insert modes for edges
static int EDGEINSERTMODE_EXACT
          edge-insert modes for edges
static int HIGHLIGHTMODE_ALLPORTS
          highlight mode for ports
static int HIGHLIGHTMODE_HITPORT_ONLY
          highlight mode for ports
static int HIGHLIGHTMODE_PORTS_NEARBY_NODE
          highlight mode for ports
 
Constructor Summary
InteractionSettings()
          Constructs the default interaction settings.
InteractionSettings(InteractionSettings settings)
          Copy constructor for interaction settings.
 
Method Summary
static java.lang.String edgeinsertMode2String(int edgeinsertmode)
          Returns a descriptive string for the given edge insert mode.
 int getHighlightMode()
          Returns the currently active highlight mode.
static Constraint getHighlightModeConstraint()
          Returns the constraint for the possible values for the highlight mode
 int getPortHighlightTolerance()
          Returns the current value for the port highlighting tolerance setting.
static java.lang.String highlightMode2String(int highlightmode)
          Returns a descriptive string for the given highlight mode.
 boolean isAllowLoops()
          Returns the allowLoops setting.
 boolean isPortsEnabled()
          Returns the port enabled setting.
 void setAllowLoops(boolean allowLoops)
          Sets the allowLoops setting.
 void setHighlightMode(int highlightmode)
          Sets the currently active highlight mode.
 void setPortHighlightTolerance(int portHighlightTolerance)
          Sets the value for the port highlighting tolerance to the value given by portHighlightTolerance.
 void setPortsEnabled(boolean portsEnabled)
          Sets the port enabled setting.
static int string2edgeinsertMode(java.lang.String description)
          Returns the edge-insert mode for the given descriptive string.
static int string2highlightMode(java.lang.String description)
          Returns the highlight mode for the given descriptive string.
 java.lang.String toString()
          Returns a string representation of this InteractionSettings instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

HIGHLIGHTMODE_HITPORT_ONLY

public static final int HIGHLIGHTMODE_HITPORT_ONLY
highlight mode for ports

See Also:
Constant Field Values

HIGHLIGHTMODE_PORTS_NEARBY_NODE

public static final int HIGHLIGHTMODE_PORTS_NEARBY_NODE
highlight mode for ports

See Also:
Constant Field Values

HIGHLIGHTMODE_ALLPORTS

public static final int HIGHLIGHTMODE_ALLPORTS
highlight mode for ports

See Also:
Constant Field Values

EDGEINSERTMODE_DISABLED

public static final int EDGEINSERTMODE_DISABLED
edge-insert modes for edges

See Also:
Constant Field Values

EDGEINSERTMODE_EXACT

public static final int EDGEINSERTMODE_EXACT
edge-insert modes for edges

See Also:
Constant Field Values

EDGEINSERTMODE_AUTOCENTER

public static final int EDGEINSERTMODE_AUTOCENTER
edge-insert modes for edges

See Also:
Constant Field Values
Constructor Detail

InteractionSettings

public InteractionSettings()
Constructs the default interaction settings.


InteractionSettings

public InteractionSettings(InteractionSettings settings)
Copy constructor for interaction settings.

Parameters:
settings - to source instance to copy from.
Method Detail

toString

public java.lang.String toString()
Returns a string representation of this InteractionSettings instance.

Returns:
string representation of this instance.

isAllowLoops

public boolean isAllowLoops()
Returns the allowLoops setting. True means that self loops are allowed.

Returns:
boolean true if loops are allowed.

setAllowLoops

public void setAllowLoops(boolean allowLoops)
Sets the allowLoops setting. True means that self-loops are allowed.

Parameters:
allowLoops - true to allow loops, false to forbid loops.

isPortsEnabled

public boolean isPortsEnabled()
Returns the port enabled setting. True means that ports are enabled and a highlight will mark them while user interaction takes place. False means that ports are globally disabled.

Returns:
boolean true if ports are enabled.

setPortsEnabled

public void setPortsEnabled(boolean portsEnabled)
Sets the port enabled setting. True means that ports are enabled.

Parameters:
portsEnabled - true to enable ports, false to globally disabled ports.

getHighlightMode

public int getHighlightMode()
Returns the currently active highlight mode. The returned constant is one of the HIGHLIGHTMODE_* constants defined in this class.

Returns:
the currently active highlight mode.

setHighlightMode

public void setHighlightMode(int highlightmode)
Sets the currently active highlight mode. Can be set to one of the HIGHLIGHTMODE_* values defined in this class.

Parameters:
highlightmode - the highlight mode to set.

getPortHighlightTolerance

public int getPortHighlightTolerance()
Returns the current value for the port highlighting tolerance setting. The returned tolerance is given in units of the coordinate of the VisualGraphView the InteractionSettings instance is associated to.

Returns:
int the current value for the port highlighting tolerance

setPortHighlightTolerance

public void setPortHighlightTolerance(int portHighlightTolerance)
Sets the value for the port highlighting tolerance to the value given by portHighlightTolerance. The portHighlightTolerance should be given in units of the coordinate of the VisualGraphView the InteractionSettings instance is associated to.

Parameters:
portHighlightTolerance - the new value for the port highlighting tolerance

highlightMode2String

public static final java.lang.String highlightMode2String(int highlightmode)
Returns a descriptive string for the given highlight mode.

Parameters:
highlightmode - the highlight mode to look up.
Returns:
description for the given highlight mode.

string2highlightMode

public static final int string2highlightMode(java.lang.String description)
Returns the highlight mode for the given descriptive string.

Parameters:
description - the string describing the given highlight mode.
Returns:
the highlight mode that was parsed.

edgeinsertMode2String

public static final java.lang.String edgeinsertMode2String(int edgeinsertmode)
Returns a descriptive string for the given edge insert mode.

Parameters:
edgeinsertmode - the edge-insert mode to look up.
Returns:
description for the given edge-insert mode.

string2edgeinsertMode

public static final int string2edgeinsertMode(java.lang.String description)
Returns the edge-insert mode for the given descriptive string.

Parameters:
description - the string describing the given edge-insert mode.
Returns:
the edge-insert mode that was parsed.

getHighlightModeConstraint

public static Constraint getHighlightModeConstraint()
Returns the constraint for the possible values for the highlight mode

Returns:
the constraint for the possible values for the highlight mode


Copyright © 2005 Tensegrity Software GmbH. All Rights Reserved. Date of creation: 09.06.2006.