com.tensegrity.gui.swing.dialog.graphfilechooser
Class GraphFileChooserOption

java.lang.Object
  extended bycom.tensegrity.gui.swing.dialog.graphfilechooser.GraphFileChooserOption
Direct Known Subclasses:
GraphFileChooserOptionCheckBox, GraphFileChooserOptionComboBox, GraphFileChooserOptionLabel, GraphFileChooserOptionRow, GraphFileChooserOptionSeperator

public abstract class GraphFileChooserOption
extends java.lang.Object

GraphFileChooserOption represents one line in the options panel of the GraphFileChooserDialog

Author:
BurkhardWick

Field Summary
protected  java.io.File file
          file
protected  javax.swing.filechooser.FileFilter filter
          filter
 
Constructor Summary
protected GraphFileChooserOption()
          Constructor
 
Method Summary
 void addChild(int index, GraphFileChooserOption child)
          Adds a child at the given index.
 GraphFileChooserOption getChild(int index)
          Returns the child at the given index
 int getChildCount()
          Returns the number of children in this options
 javax.swing.JComponent getComponent()
          Returns the JComponent that represents this option in the dialog
protected  int getDepth()
          Returns the current depth of this option
 int getIndentation()
          Returns the indentation in pixels
protected abstract  java.lang.Object getInitialValue()
          Called at initialization time to determine the initial value
 GraphFileChooserOption getParent()
          Returns the parent of this option.
 java.lang.Object getValue()
          Returns the current value of this option
 boolean isEnabled()
          Returns true, if the option is selectable or false if it is disabled
protected abstract  void parentValueChanged(java.lang.Object newVal)
          Called when the parent option changes the value
 void removeChild(GraphFileChooserOption child)
          Removes the given child
 void revalidate()
          Revalidates the state of this option and its children after a change of settings
 void setValue(java.lang.Object val)
          Sets the new value of this option
protected  void updateIndentation()
          Updates the indentation of this options component
 void updateState(javax.swing.filechooser.FileFilter filter, java.io.File file)
          Updates the state when the user selected a different file filter in the dialog
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

filter

protected javax.swing.filechooser.FileFilter filter
filter


file

protected java.io.File file
file

Constructor Detail

GraphFileChooserOption

protected GraphFileChooserOption()
Constructor

Method Detail

getValue

public java.lang.Object getValue()
Returns the current value of this option

Returns:
the current value of this option

setValue

public void setValue(java.lang.Object val)
Sets the new value of this option

Parameters:
val - the new value of this option to set

getParent

public final GraphFileChooserOption getParent()
Returns the parent of this option.

Returns:
the parent of this option.

getChildCount

public final int getChildCount()
Returns the number of children in this options

Returns:
the number of children in this options

getChild

public final GraphFileChooserOption getChild(int index)
Returns the child at the given index

Parameters:
index - The index of the child to retrieve
Returns:
the child at the given index

addChild

public final void addChild(int index,
                           GraphFileChooserOption child)
Adds a child at the given index. The enabled state of children will automatically depend on the state of their parent.

Parameters:
index - the index to add the child to
child - the child to add

removeChild

public final void removeChild(GraphFileChooserOption child)
Removes the given child

Parameters:
child - the child to remove

isEnabled

public boolean isEnabled()
Returns true, if the option is selectable or false if it is disabled

Returns:
true, if the option is selectable or false, if it is disabled

updateState

public void updateState(javax.swing.filechooser.FileFilter filter,
                        java.io.File file)
Updates the state when the user selected a different file filter in the dialog

Parameters:
filter - The selected filter in the dialog
file - The selected file in the dialog

revalidate

public void revalidate()
Revalidates the state of this option and its children after a change of settings


getComponent

public final javax.swing.JComponent getComponent()
Returns the JComponent that represents this option in the dialog

Returns:
the JComponent that represents this option in the dialog

getIndentation

public int getIndentation()
Returns the indentation in pixels

Returns:
the indentation in pixels

getDepth

protected final int getDepth()
Returns the current depth of this option

Returns:
the current depth of this option

updateIndentation

protected final void updateIndentation()
Updates the indentation of this options component


parentValueChanged

protected abstract void parentValueChanged(java.lang.Object newVal)
Called when the parent option changes the value

Parameters:
newVal - The new value of the option

getInitialValue

protected abstract java.lang.Object getInitialValue()
Called at initialization time to determine the initial value

Returns:
The initial value of this option


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