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

java.lang.Object
  extended by org.knime.core.node.property.hilite.HiLiteTranslator

public final class HiLiteTranslator
extends Object

A translator for hilite events between one source (from) HiLiteHandler and a number of target handlers (to). The source hilite handler is passed through the constructor of this class. The target hilite handlers can be set independently, as well as the mapping which is defined between RowKey row keys and RowKey sets.

This class hosts two listeners one which is registered with the source handler and one which is registered with all target handlers. These listeners are called when something changes either on the source or target side, and then invoke the corresponding handlers on the other side to hilite, unhilite, and clear mapped keys.

Author:
Thomas Gabriel, University of Konstanz

Constructor Summary
HiLiteTranslator()
          Creates a translator with an empty mapping and a default hilite handler.
HiLiteTranslator(HiLiteHandler handler)
          Creates a new translator.
HiLiteTranslator(HiLiteHandler handler, HiLiteMapper mapper)
          Creates a new translator.
HiLiteTranslator(HiLiteMapper mapper)
          Creates a new translator.
 
Method Summary
 void addToHiLiteHandler(HiLiteHandler targetHandler)
          Adds a new target HiLiteHandler to the list of registered hilite handlers and adds the private target listener if the list of hilite keys is empty.
 HiLiteHandler getFromHiLiteHandler()
          The source hilite handler.
 HiLiteMapper getMapper()
           
 Set<HiLiteHandler> getToHiLiteHandlers()
          An unmodifiable set of target hilite handlers.
 void removeAllToHiliteHandlers()
          Removes all target hilite handlers from this translator.
 void removeToHiLiteHandler(HiLiteHandler targetHandler)
          Removes the given target HiLiteHandler from the list of registered hilite handlers and removes the private target listener from if the list of hilite keys is empty.
 void setMapper(HiLiteMapper mapper)
          Sets a new hilite mapper which can be null in case no hilite translation is available.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HiLiteTranslator

public HiLiteTranslator()
Creates a translator with an empty mapping and a default hilite handler.


HiLiteTranslator

public HiLiteTranslator(HiLiteHandler handler)
Creates a new translator.

Parameters:
handler - a given source HiLiteHandler

HiLiteTranslator

public HiLiteTranslator(HiLiteMapper mapper)
Creates a new translator.

Parameters:
mapper - mapping from aggregation to single patterns

HiLiteTranslator

public HiLiteTranslator(HiLiteHandler handler,
                        HiLiteMapper mapper)
Creates a new translator.

Parameters:
handler - a given source HiLiteHandler
mapper - mapping from aggregation to single patterns
Method Detail

setMapper

public void setMapper(HiLiteMapper mapper)
Sets a new hilite mapper which can be null in case no hilite translation is available.

Parameters:
mapper - the new hilite mapper

getMapper

public HiLiteMapper getMapper()
Returns:
mapper which contains the mapping, can be null

removeToHiLiteHandler

public void removeToHiLiteHandler(HiLiteHandler targetHandler)
Removes the given target HiLiteHandler from the list of registered hilite handlers and removes the private target listener from if the list of hilite keys is empty.

Parameters:
targetHandler - the target hilite handler to remove

addToHiLiteHandler

public void addToHiLiteHandler(HiLiteHandler targetHandler)
Adds a new target HiLiteHandler to the list of registered hilite handlers and adds the private target listener if the list of hilite keys is empty.

Parameters:
targetHandler - the target hilite handler to add

getToHiLiteHandlers

public Set<HiLiteHandler> getToHiLiteHandlers()
An unmodifiable set of target hilite handlers.

Returns:
the set of target hilite handlers

removeAllToHiliteHandlers

public void removeAllToHiliteHandlers()
Removes all target hilite handlers from this translator. To be used from the node that instantiates this instance when a new connection is made.


getFromHiLiteHandler

public HiLiteHandler getFromHiLiteHandler()
The source hilite handler.

Returns:
source hilite handler


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.