jgroup.experiment.gui.views.helpers
Class ChangeTracker

java.lang.Object
  extended by jgroup.experiment.gui.views.helpers.ChangeTracker

public class ChangeTracker
extends java.lang.Object

Utility class providing static methods for marking JLabels and tabs when their connected editable components change. The component must add a ChangeableActionListener as action listener, and pass the label and the panel to be marked in its constructor. ChangeTracker assumes the parent of the JPanel to be a JTabbedPane. The class also provides similar static methods for marking DefaultMutableTreeNodes in a tree. No listener is necessary for nodes.

Author:
Bjarte Svaeren

Constructor Summary
ChangeTracker()
           
 
Method Summary
static void addListener(javax.swing.text.JTextComponent component, javax.swing.JLabel label, javax.swing.JPanel panel)
          Add a change listener for the component.
static void clearChanges()
           
static void clearChanges(int changeType)
           
static void clearComponent(javax.swing.JComponent component)
           
static void clearNode(javax.swing.tree.TreeNode node)
           
static java.util.LinkedList getChangedComponents()
          Returns a list of all changed components.
static java.util.LinkedList getChangedNodes()
          Returns a list of all changed nodes.
static boolean hasChanges(javax.swing.JComponent component)
          Returns true if this component has changed.
static boolean hasChanges(javax.swing.tree.TreeNode node)
          Returns true if this node has changed.
static boolean hasComponentChanges()
          Returns true if there are changes in any components.
static boolean hasNodeChanges()
          Returns true if there are changes in any nodes.
static void performedChange(javax.swing.JComponent comp)
           
static void performedChange(javax.swing.JComponent comp1, javax.swing.JComponent comp2)
           
static void performedChange(javax.swing.tree.TreeNode node)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChangeTracker

public ChangeTracker()
Method Detail

performedChange

public static void performedChange(javax.swing.JComponent comp)

performedChange

public static void performedChange(javax.swing.JComponent comp1,
                                   javax.swing.JComponent comp2)

performedChange

public static void performedChange(javax.swing.tree.TreeNode node)

clearChanges

public static void clearChanges()

clearChanges

public static void clearChanges(int changeType)

clearComponent

public static void clearComponent(javax.swing.JComponent component)

clearNode

public static void clearNode(javax.swing.tree.TreeNode node)

hasComponentChanges

public static boolean hasComponentChanges()
Returns true if there are changes in any components. Important:

Returns:

hasNodeChanges

public static boolean hasNodeChanges()
Returns true if there are changes in any nodes.

Returns:

hasChanges

public static boolean hasChanges(javax.swing.JComponent component)
Returns true if this component has changed.

Parameters:
component -
Returns:

hasChanges

public static boolean hasChanges(javax.swing.tree.TreeNode node)
Returns true if this node has changed.

Parameters:
node -
Returns:

getChangedComponents

public static java.util.LinkedList getChangedComponents()
Returns a list of all changed components.

Returns:

getChangedNodes

public static java.util.LinkedList getChangedNodes()
Returns a list of all changed nodes.

Returns:

addListener

public static void addListener(javax.swing.text.JTextComponent component,
                               javax.swing.JLabel label,
                               javax.swing.JPanel panel)
Add a change listener for the component.

Parameters:
component -
label -
panel -


Copyright © 1998-2006 The Jgroup/ARM development team. All Rights Reserved.