org.knime.base.node.viz.table
Class TableNodeView

java.lang.Object
  extended by org.knime.core.node.AbstractNodeView<T>
      extended by org.knime.core.node.NodeView
          extended by org.knime.base.node.viz.table.TableNodeView
All Implemented Interfaces:
EventListener, NodeModelWarningListener

public class TableNodeView
extends NodeView

Table view on a DataTable. It simply uses a JTable to display the data table. If the node has not been executed or is reset, the view will print "<no data>". The view adds also a menu entry to the menu bar where the user can synchronize the selection with a global hilite handler.

Author:
Bernd Wiswedel, University of Konstanz

Field Summary
 
Fields inherited from class org.knime.core.node.NodeView
COLOR_BACKGROUND, PROP_CHANGE_CLOSE
 
Constructor Summary
TableNodeView(TableNodeModel nodeModel)
          Starts a new TableNodeView displaying "<no data>".
 
Method Summary
 int getRowHeight()
          Get row height from table.
 boolean hasData()
          Checks if there is data to display.
 boolean hasHiLiteHandler()
          Checks is property handler is set.
 void hiliteSelected()
          Hilites selected rows in the hilite handler.
 boolean isShowColorInfo()
          Is the color info shown.
protected  void modelChanged()
          Called from the super class when a property of the node has been changed.
protected  void onClose()
          Invoked when the window is about to be closed.
protected  void onOpen()
          Does nothing since view is in sync anyway.
 void resetHilite()
          Resets hiliting in the hilite handler.
 void setHiLiteHandler(HiLiteHandler hiLiteHdl)
          Sets a new handler for this view.
 void setRowHeight(int newHeight)
          Set a new row height in the table.
 void setShowColorInfo(boolean isShowColor)
          Shall row header encode the color information in an icon.
 void unHiliteSelected()
          Unhilites selected rows in the hilite handler.
protected  void updateTitle()
          Updates the title of the frame.
 
Methods inherited from class org.knime.core.node.NodeView
callCloseView, closeView, createFrame, getComponent, getJMenuBar, getViewTitle, isOpen, openViewComponent, setComponent, setShowNODATALabel, setViewTitleSuffix, warningChanged
 
Methods inherited from class org.knime.core.node.AbstractNodeView
getLogger, getNodeModel, updateModel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TableNodeView

public TableNodeView(TableNodeModel nodeModel)
Starts a new TableNodeView displaying "<no data>". The content comes up when the super class NodeView calls the modelChanged() method.

Parameters:
nodeModel - the underlying model
Method Detail

hasData

public boolean hasData()
Checks if there is data to display. That is: The model's content model (keeping the cache and so on) needs to have a DataTable to show. This method returns true when the node was executed and false otherwise.

Returns:
true if there is data to display

hasHiLiteHandler

public boolean hasHiLiteHandler()
Checks is property handler is set.

Returns:
true if property handler set
See Also:
TableContentView.hasHiLiteHandler()

setHiLiteHandler

public void setHiLiteHandler(HiLiteHandler hiLiteHdl)
Sets a new handler for this view.

Parameters:
hiLiteHdl - the new handler to set, may be null to disable any brushing

setShowColorInfo

public void setShowColorInfo(boolean isShowColor)
Shall row header encode the color information in an icon.

Parameters:
isShowColor - true for show icon (and thus the color), false ignore colors
See Also:
#setShowColorInfo(boolean)

isShowColorInfo

public boolean isShowColorInfo()
Is the color info shown.

Returns:
true Icon with the color is present

getRowHeight

public int getRowHeight()
Get row height from table.

Returns:
current row height
See Also:
JTable.getRowHeight()

setRowHeight

public void setRowHeight(int newHeight)
Set a new row height in the table.

Parameters:
newHeight - the new height
See Also:
JTable.setRowHeight(int)

hiliteSelected

public void hiliteSelected()
Hilites selected rows in the hilite handler.

See Also:
TableView.hiliteSelected()

unHiliteSelected

public void unHiliteSelected()
Unhilites selected rows in the hilite handler.

See Also:
TableView.unHiliteSelected()

resetHilite

public void resetHilite()
Resets hiliting in the hilite handler.

See Also:
TableView.resetHilite()

updateTitle

protected void updateTitle()
Updates the title of the frame. It prints: "Table (#rows[+] x #cols)". It is invoked each time new rows are inserted (user scrolls down).


modelChanged

protected void modelChanged()
Called from the super class when a property of the node has been changed.

Specified by:
modelChanged in class AbstractNodeView
See Also:
AbstractNodeView.modelChanged()

onClose

protected void onClose()
Invoked when the window is about to be closed. Unregister HiLiteListeners. Dispose internal members.
This method is the first to be called on a close request (right after the view is unregistered from the NodeModel

Specified by:
onClose in class NodeView

onOpen

protected void onOpen()
Does nothing since view is in sync anyway.

Specified by:
onOpen in class NodeView
See Also:
NodeView.onOpen()


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.