org.knime.core.data.property
Class ShapeFactory.Shape

java.lang.Object
  extended by org.knime.core.data.property.ShapeFactory.Shape
Enclosing class:
ShapeFactory

public abstract static class ShapeFactory.Shape
extends Object

Abstract implementation of a shape. Handles all common attributes such as position, dimension, color, etc. All implementing classes have to provide a possibility to get a new instance and to paint themselves.

Author:
Fabian Dill, University of Konstanz

Constructor Summary
ShapeFactory.Shape()
           
 
Method Summary
 Icon getIcon()
           
 void paint(Graphics g, int x, int y, int size, Color color, boolean hilited, boolean selected, boolean faded)
          Paints the dot and if hilited a border around the dot.
 void paintBorder(Graphics g, int x, int y, int size, boolean hilited, boolean selected)
          Paints the hilite border.
abstract  void paintShape(Graphics g, int x, int y, int size, boolean selected, boolean hilited)
          Paints the shape.
abstract  String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ShapeFactory.Shape

public ShapeFactory.Shape()
Method Detail

getIcon

public Icon getIcon()
Returns:
the shape as an icon.

paintBorder

public void paintBorder(Graphics g,
                        int x,
                        int y,
                        int size,
                        boolean hilited,
                        boolean selected)
Paints the hilite border.

Parameters:
g - the graphics object.
x - the x center position
y - the y center position
size - the dimension of the shape
hilited - falg whether the shape is hilited
selected - flag whether the dot is selected

paint

public void paint(Graphics g,
                  int x,
                  int y,
                  int size,
                  Color color,
                  boolean hilited,
                  boolean selected,
                  boolean faded)
Paints the dot and if hilited a border around the dot.

Parameters:
g - the graphics object.
x - the x position (center of the shape)
y - the y position (center of the shape)
size - the size (width and height)
color - the normal color of the shape
hilited - flag whether dot is hilited
selected - flag whether dot is selected.
faded - flag whether point is faded.

paintShape

public abstract void paintShape(Graphics g,
                                int x,
                                int y,
                                int size,
                                boolean selected,
                                boolean hilited)
Paints the shape.

Parameters:
g - the graphics object
x - the center x position
y - the center y position
size - the dimension of the shape
hilited - flag whether the shape is hilited
selected - flag whether the shape is selected

toString

public abstract String toString()

Overrides:
toString in class Object


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.