org.knime.core.node.property.hilite
Class HiLiteHandler

java.lang.Object
  extended by org.knime.core.node.property.hilite.HiLiteHandler
Direct Known Subclasses:
DefaultHiLiteHandler

public class HiLiteHandler
extends Object

HiLiteHandler implementation which receives hilite change requests, answers, queries, and notifies registered listeners.

This implementation keeps a list of row keys only for the hilit items. Furthermore, an event is only sent for items whose status actually changed. The list of hilite keys is modified (delete or add keys) before the actual event is send.

Do NOT derive this class which intended to be final but can't due to the historical DefaultHiLiteHandler class.

Author:
Thomas Gabriel, University of Konstanz
See Also:
HiLiteListener

Field Summary
static String CLEAR_HILITE
          Constant for the menu entry 'Clear HiLite'.
static String HILITE
          Constant for the Menu entry 'HiLite'.
static String HILITE_SELECTED
          Constant for the menu entry 'HiLite Selected'.
static String UNHILITE_SELECTED
          Constant for the menu entry 'UnHiLite Selected'.
 
Constructor Summary
HiLiteHandler()
          Creates a new default hilite handler with an empty set of registered listeners and an empty set of hilit items.
 
Method Summary
 void addHiLiteListener(HiLiteListener listener)
          Appends a new hilite listener at the end of the list, if the listener has not been added before.
 void fireClearHiLiteEvent()
          Resets the hilit status of all row IDs.
 void fireClearHiLiteEvent(KeyEvent event)
          Informs all registered hilite listener to reset all hilit rows.
protected  void fireClearHiLiteEventInternal(KeyEvent event)
          Deprecated. Replaced by fireClearHiLiteEvent(KeyEvent)
 void fireHiLiteEvent(KeyEvent event)
          Informs all registered hilite listener to hilite the row keys contained in the key event.
 void fireHiLiteEvent(RowKey... ids)
          Sets the status of the specified row IDs to 'hilit'.
 void fireHiLiteEvent(Set<RowKey> ids)
          Sets the status of all specified row IDs in the set to 'hilit'.
protected  void fireHiLiteEventInternal(KeyEvent event)
          Deprecated. Replaced by public method fireHiLiteEvent(KeyEvent).
 void fireUnHiLiteEvent(KeyEvent event)
          Informs all registered hilite listener to unhilite the row keys contained in the key event.
 void fireUnHiLiteEvent(RowKey... ids)
          Sets the status of the specified row IDs to 'unhilit'.
 void fireUnHiLiteEvent(Set<RowKey> ids)
          Sets the status of all specified row IDs in the set to 'unhilit'.
protected  void fireUnHiLiteEventInternal(KeyEvent event)
          Deprecated. Replaced by fireUnHiLiteEvent(KeyEvent).
 Set<RowKey> getHiLitKeys()
          Returns a copy of all hilit keys.
 boolean isHiLit(RowKey... ids)
          Returns true if the specified row IDs are hilit.
 void removeAllHiLiteListeners()
          Removes all hilite listeners from the list.
 void removeHiLiteListener(HiLiteListener listener)
          Removes the given hilite listener from the list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HILITE

public static final String HILITE
Constant for the Menu entry 'HiLite'.

See Also:
Constant Field Values

HILITE_SELECTED

public static final String HILITE_SELECTED
Constant for the menu entry 'HiLite Selected'.

See Also:
Constant Field Values

UNHILITE_SELECTED

public static final String UNHILITE_SELECTED
Constant for the menu entry 'UnHiLite Selected'.

See Also:
Constant Field Values

CLEAR_HILITE

public static final String CLEAR_HILITE
Constant for the menu entry 'Clear HiLite'.

See Also:
Constant Field Values
Constructor Detail

HiLiteHandler

public HiLiteHandler()
Creates a new default hilite handler with an empty set of registered listeners and an empty set of hilit items.

Method Detail

addHiLiteListener

public void addHiLiteListener(HiLiteListener listener)
Appends a new hilite listener at the end of the list, if the listener has not been added before. This method does not send a hilite event to the new listener.

Parameters:
listener - the hilite listener to append to the list

removeHiLiteListener

public void removeHiLiteListener(HiLiteListener listener)
Removes the given hilite listener from the list.

Parameters:
listener - the hilite listener to remove from the list

removeAllHiLiteListeners

public void removeAllHiLiteListeners()
Removes all hilite listeners from the list.


isHiLit

public boolean isHiLit(RowKey... ids)
Returns true if the specified row IDs are hilit.

Parameters:
ids - the row IDs to check the hilite status for
Returns:
true if all row IDs are hilit
Throws:
IllegalArgumentException - if this array or one of its elements is null.

fireHiLiteEvent

public void fireHiLiteEvent(RowKey... ids)
Sets the status of the specified row IDs to 'hilit'. It will send a hilite event to all registered listeners - only if the keys were not hilit before.

Parameters:
ids - the row IDs to set hilited.

fireUnHiLiteEvent

public void fireUnHiLiteEvent(RowKey... ids)
Sets the status of the specified row IDs to 'unhilit'. It will send a unhilite event to all registered listeners - only if the keys were hilit before.

Parameters:
ids - the row IDs to set unhilited

fireHiLiteEvent

public void fireHiLiteEvent(Set<RowKey> ids)
Sets the status of all specified row IDs in the set to 'hilit'. It will send a hilite event to all registered listeners - only for the IDs that were not hilit before.

Parameters:
ids - a set of row IDs to set hilited
Throws:
IllegalArgumentException - if the set or one of its elements is null

fireUnHiLiteEvent

public void fireUnHiLiteEvent(Set<RowKey> ids)
Sets the status of all specified row IDs in the set to 'unhilit'. It will send a unhilite event to all registered listeners - only for the IDs that were hilit before.

Parameters:
ids - a set of row IDs to set unhilited
Throws:
IllegalArgumentException - if the set or one of its elements is null

fireClearHiLiteEvent

public void fireClearHiLiteEvent()
Resets the hilit status of all row IDs. Every row ID will be unhilit after the call to this method. Sends an event to all registered listeners with all previously hilit row IDs, if at least one key was effected by this call.


fireHiLiteEventInternal

@Deprecated
protected void fireHiLiteEventInternal(KeyEvent event)
Deprecated. Replaced by public method fireHiLiteEvent(KeyEvent).

Informs all registered hilite listener to hilite the row keys contained in the key event.

Parameters:
event - Contains all rows keys to hilite.

fireHiLiteEvent

public void fireHiLiteEvent(KeyEvent event)
Informs all registered hilite listener to hilite the row keys contained in the key event.

Parameters:
event - Contains all rows keys to hilite.

fireUnHiLiteEventInternal

@Deprecated
protected void fireUnHiLiteEventInternal(KeyEvent event)
Deprecated. Replaced by fireUnHiLiteEvent(KeyEvent).

Informs all registered hilite listener to unhilite the row keys contained in the key event.

Parameters:
event - Contains all rows keys to unhilite.

fireUnHiLiteEvent

public void fireUnHiLiteEvent(KeyEvent event)
Informs all registered hilite listener to unhilite the row keys contained in the key event.

Parameters:
event - Contains all rows keys to unhilite.

fireClearHiLiteEventInternal

@Deprecated
protected void fireClearHiLiteEventInternal(KeyEvent event)
Deprecated. Replaced by fireClearHiLiteEvent(KeyEvent)

Informs all registered hilite listener to reset all hilit rows.

Parameters:
event - the event fired for clear hilite

fireClearHiLiteEvent

public void fireClearHiLiteEvent(KeyEvent event)
Informs all registered hilite listener to reset all hilit rows.

Parameters:
event - the event fired for clear hilite

getHiLitKeys

public Set<RowKey> getHiLitKeys()
Returns a copy of all hilit keys.

Returns:
a set of hilit row keys
See Also:
getHiLitKeys()


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.