org.graffiti.plugin.view.interactive.slots
Class Point2DSlot

java.lang.Object
  extended by org.graffiti.plugin.view.interactive.Slot<Point2D>
      extended by org.graffiti.plugin.view.interactive.slots.Point2DSlot

public class Point2DSlot
extends Slot<Point2D>

Slot of type Point2D, which can store its value in a preferences tree.

Version:
$Revision$ $Date$
Author:
Andreas Gleißner

Field Summary
 
Fields inherited from class org.graffiti.plugin.view.interactive.Slot
type
 
Constructor Summary
Point2DSlot(String id, String name, String description, Point2D defaultValue)
          Constructs a Point2DSlot.
 
Method Summary
 void createDefaultPreferences(Preferences preferences)
          Prepares the specified preferences tree to store the value assigned to this slot.
 Point2D loadValue(Preferences preferences)
          Returns the value that is assigned to this slot according to the specified preferences tree.
 void saveValue(Preferences preferences, Point2D value)
          Stores the specified value in the specified preferences tree by means of this slot.
 
Methods inherited from class org.graffiti.plugin.view.interactive.Slot
acceptsNull, acceptsValue, create, create, createListSlot, createMapSlot, createSetSlot, equals, getBuilder, getDefaultValue, getDescription, getId, getName, getType, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Point2DSlot

public Point2DSlot(String id,
                   String name,
                   String description,
                   Point2D defaultValue)
Constructs a Point2DSlot.

Parameters:
id - the id of the slot.
name - the name of the slot as seen by the user when graphically editing the tools.
description - the description as seen by the user when graphically editing the tools.
defaultValue - the default value.
Method Detail

createDefaultPreferences

public void createDefaultPreferences(Preferences preferences)
Prepares the specified preferences tree to store the value assigned to this slot. The default implementation throws an UnsupportedOperationException. This implementation stores its default value in the preferences tree at the keys "valueX" and "valueY".

Overrides:
createDefaultPreferences in class Slot<Point2D>
Parameters:
preferences - the preferences tree where the value assigned to this slot will be stored.

loadValue

public Point2D loadValue(Preferences preferences)
Returns the value that is assigned to this slot according to the specified preferences tree. The default implementation throws an UnsupportedOperationException. This implementation loads its value from the preferences tree at the keys "valueX" and "valueY".

Overrides:
loadValue in class Slot<Point2D>
Parameters:
preferences - the preferences tree from where the value is to be obtained.
Returns:
the value that is assigned to this slot according to the specified preferences tree.

saveValue

public void saveValue(Preferences preferences,
                      Point2D value)
Stores the specified value in the specified preferences tree by means of this slot. The default implementation throws an UnsupportedOperationException. This implementation stores the specified value in the preferences tree at the keys "valueX" and "valueY".

Overrides:
saveValue in class Slot<Point2D>
Parameters:
preferences - the preferences tree where the value is to be stored.
value - the value that is to be stored.


Generated at 2012-05-30 11:00:36 PM CEST