org.knime.core.node.workflow
Class ConnectionUIInformation

java.lang.Object
  extended by org.knime.core.node.workflow.ConnectionUIInformation
All Implemented Interfaces:
Cloneable, UIInformation

public class ConnectionUIInformation
extends Object
implements UIInformation

Default implementation of a connection extra info. By now it only stores bendpoints used by the modelling editor.

Author:
Florian Georg, University of Konstanz

Field Summary
static String KEY_BENDPOINTS
          The key under which the bounds are registered.
static String KEY_VERSION
          The key under which the type is registered.
 
Constructor Summary
ConnectionUIInformation()
          Constructs a ConnectionUIInformation.
 
Method Summary
 void addBendpoint(int x, int y, int index)
          Add a bendpoint.
 ConnectionUIInformation clone()
          UIInformation objects are cloneable without further restriction.
 ConnectionUIInformation createNewWithOffsetPosition(int[] moveDist)
          Changes the position by setting the bend points according to the given moving distance.
 int[][] getAllBendpoints()
          Gets all bendpoints.
 int[] getBendpoint(int index)
          Returns a bendpoint.
 void load(NodeSettingsRO config)
          Reads the information from the NodeSettings object.
 void removeBendpoint(int index)
          Removes a bendpoint.
 void save(NodeSettingsWO config)
          Stores all contained information into the given configuration.
 String toString()
          
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

KEY_VERSION

public static final String KEY_VERSION
The key under which the type is registered. *

See Also:
Constant Field Values

KEY_BENDPOINTS

public static final String KEY_BENDPOINTS
The key under which the bounds are registered. *

See Also:
Constant Field Values
Constructor Detail

ConnectionUIInformation

public ConnectionUIInformation()
Constructs a ConnectionUIInformation.

Method Detail

addBendpoint

public void addBendpoint(int x,
                         int y,
                         int index)
Add a bendpoint.

Parameters:
x - x coordinate
y - y cordinate
index - index of the point

removeBendpoint

public void removeBendpoint(int index)
Removes a bendpoint.

Parameters:
index - The point index

getBendpoint

public int[] getBendpoint(int index)
Returns a bendpoint.

Parameters:
index - The point index
Returns:
the point (int[]{x,y}), or null

getAllBendpoints

public int[][] getAllBendpoints()
Gets all bendpoints.

Returns:
all bendpoints

save

public void save(NodeSettingsWO config)
Stores all contained information into the given configuration.

Specified by:
save in interface UIInformation
Parameters:
config - The configuration to write the current settings into.
See Also:
UIInformation.load(org.knime.core.node.NodeSettingsRO)

load

public void load(NodeSettingsRO config)
          throws InvalidSettingsException
Reads the information from the NodeSettings object.

Specified by:
load in interface UIInformation
Parameters:
config - Retrieve the data from.
Throws:
InvalidSettingsException - If the required keys are not available in the NodeSettings.
See Also:
UIInformation.save(org.knime.core.node.NodeSettingsWO)

createNewWithOffsetPosition

public ConnectionUIInformation createNewWithOffsetPosition(int[] moveDist)
Changes the position by setting the bend points according to the given moving distance.

Parameters:
moveDist - the distance to change the bend points
Returns:
A new copy of this object with all its bend points shifted by the argument offset.

toString

public String toString()

Overrides:
toString in class Object

clone

public ConnectionUIInformation clone()
UIInformation objects are cloneable without further restriction.

Specified by:
clone in interface UIInformation
Overrides:
clone in class Object
Returns:
a clone of this object


Copyright, 2003 - 2010. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.