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

java.lang.Object
  extended by org.graffiti.plugin.view.interactive.Slot<Integer>
      extended by org.graffiti.plugin.view.interactive.slots.IntSlot

public class IntSlot
extends Slot<Integer>

Slot of type Integer, 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
IntSlot(String id, String name, String description, int defaultValue)
          Constructs a IntSlot.
 
Method Summary
 void createDefaultPreferences(Preferences preferences)
          Prepares the specified preferences tree to store the value assigned to this slot.
 Integer loadValue(Preferences preferences)
          Returns the value that is assigned to this slot according to the specified preferences tree.
 void saveValue(Preferences preferences, Integer 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

IntSlot

public IntSlot(String id,
               String name,
               String description,
               int defaultValue)
Constructs a IntSlot.

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 key "value".

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

loadValue

public Integer 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 key "value".

Overrides:
loadValue in class Slot<Integer>
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,
                      Integer 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 key "value".

Overrides:
saveValue in class Slot<Integer>
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