org.knime.base.node.mine.decisiontree2.view.graph
Class ComponentNodeWidget<K>

java.lang.Object
  extended by org.knime.base.node.mine.decisiontree2.view.graph.NodeWidget<K>
      extended by org.knime.base.node.mine.decisiontree2.view.graph.ComponentNodeWidget<K>
Type Parameters:
K - The type
All Implemented Interfaces:
MouseListener, EventListener
Direct Known Subclasses:
DecTreeNodeWidget

public abstract class ComponentNodeWidget<K>
extends NodeWidget<K>

A NodeWidget consisting of single JComponent.

Author:
Heiko Hofer

Constructor Summary
ComponentNodeWidget(HierarchicalGraphView<K> graph, K object)
          Creates a new instance.
 
Method Summary
protected abstract  JComponent createComponent()
          Creates the component.
 Dimension getPreferredSize()
          Get the preferred size.
 void mouseClicked(MouseEvent e)
          
 void mouseEntered(MouseEvent e)
          
 void mouseExited(MouseEvent e)
          
 void mousePressed(MouseEvent e)
          
 void mouseReleased(MouseEvent e)
          
protected  void paint(Component c, Graphics2D g, int x, int y, int width, int height)
          Paint this NodeWidget using the given Graphics2D.
 void setScaleFactor(float scale)
          Get the scale factor.
 
Methods inherited from class org.knime.base.node.mine.decisiontree2.view.graph.NodeWidget
getConnectorLabelAbove, getConnectorLabelBelow, getGraphView, getScaleFactor, getSize, getUserObject, paint, setSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentNodeWidget

public ComponentNodeWidget(HierarchicalGraphView<K> graph,
                           K object)
Creates a new instance.

Parameters:
graph - the graph where this NodeWidget is element of
object - the user object
Method Detail

createComponent

protected abstract JComponent createComponent()
Creates the component.

Returns:
a component which this NodeWidget will display

setScaleFactor

public void setScaleFactor(float scale)
Get the scale factor.

Overrides:
setScaleFactor in class NodeWidget<K>
Parameters:
scale - the scale factor to set

getPreferredSize

public final Dimension getPreferredSize()
Get the preferred size.

Specified by:
getPreferredSize in class NodeWidget<K>
Returns:
the preferred size

paint

protected void paint(Component c,
                     Graphics2D g,
                     int x,
                     int y,
                     int width,
                     int height)
Paint this NodeWidget using the given Graphics2D.

Specified by:
paint in class NodeWidget<K>
Parameters:
c - the component to paint on
g - the graphics
x - the x coordinate in the component
y - the y coordinate in the component
width - the width of the widget
height - the height of the widget

mouseClicked

public void mouseClicked(MouseEvent e)


mousePressed

public void mousePressed(MouseEvent e)


mouseReleased

public void mouseReleased(MouseEvent e)


mouseEntered

public void mouseEntered(MouseEvent e)


mouseExited

public void mouseExited(MouseEvent e)



Copyright, 2003 - 2012. 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.