org.knime.base.node.viz.plotter.parcoord
Class LineInfo

java.lang.Object
  extended by org.knime.base.node.viz.plotter.parcoord.LineInfo

public class LineInfo
extends Object

Represents a line (one row) in the parallel coordinates plot. Stores the mapped points, the domain values (for tooltip information), flags whether this line is selected and/or hilited, the RowKey and the visual properties size, color and shape (for the dots).

Author:
Fabian Dill, University of Konstanz

Constructor Summary
LineInfo(List<Point> points, List<DataCell> domainValues, boolean isSelected, boolean isHilite, ColorAttr color, double size, RowKey rowKey)
          Creates a line.
 
Method Summary
 void addPoint(Point point)
          Adds a point to the line.
 ColorAttr getColor()
           
 List<DataCell> getDomainValues()
           
 List<Point> getPoints()
           
 RowKey getRowKey()
           
 ShapeFactory.Shape getShape()
           
 double getSize()
           
 boolean isContainedIn(Rectangle rectangle)
          Returns true if any point of this line is contained in the rectangle.
 boolean isHilite()
           
 boolean isSelected()
           
 void setColor(ColorAttr color)
           
 void setDomainValues(List<DataCell> domainValues)
           
 void setHilite(boolean hilite)
           
 void setPoints(List<Point> points)
           
 void setSelected(boolean isSelected)
           
 void setShape(ShapeFactory.Shape shape)
           
 void setSize(double size)
           
 boolean wasClicked(Point clicked, boolean curve)
          Determines if the line was clicked.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LineInfo

public LineInfo(List<Point> points,
                List<DataCell> domainValues,
                boolean isSelected,
                boolean isHilite,
                ColorAttr color,
                double size,
                RowKey rowKey)
Creates a line.

Parameters:
points - the points making up the line (mapped).
domainValues - the domain values
isSelected - true if the line / row is selected.
isHilite - true if the row/line is hilite
color - the row's color attribute
size - the rows size attribute
rowKey - the referring row key of the line
Method Detail

setPoints

public void setPoints(List<Point> points)
Parameters:
points - the mapped points making up the line

getPoints

public List<Point> getPoints()
Returns:
the mapped points making up the line

setShape

public void setShape(ShapeFactory.Shape shape)
Parameters:
shape - the shape for the datapoints of this line.

getShape

public ShapeFactory.Shape getShape()
Returns:
the shape for the data points of this line.

setDomainValues

public void setDomainValues(List<DataCell> domainValues)
Parameters:
domainValues - the domain values of the line.

getDomainValues

public List<DataCell> getDomainValues()
Returns:
the domain values of the line.

setSelected

public void setSelected(boolean isSelected)
Parameters:
isSelected - true if the line / row is selected.

isSelected

public boolean isSelected()
Returns:
true if the row / line is selected.

setHilite

public void setHilite(boolean hilite)
Parameters:
hilite - true if the row / line is hilite.

isHilite

public boolean isHilite()
Returns:
true if the row / line is hilite.

setColor

public void setColor(ColorAttr color)
Parameters:
color - the color of this row / line.

getColor

public ColorAttr getColor()
Returns:
the color of this row / line.

setSize

public void setSize(double size)
Parameters:
size - the row's size attribute

getSize

public double getSize()
Returns:
the relative size

getRowKey

public RowKey getRowKey()
Returns:
the referring row key of this line.

addPoint

public void addPoint(Point point)
Adds a point to the line.

Parameters:
point - the point to be added

isContainedIn

public boolean isContainedIn(Rectangle rectangle)
Returns true if any point of this line is contained in the rectangle.

Parameters:
rectangle - the dragged rectangle
Returns:
true if any point of the line lies within the rectangle.

wasClicked

public boolean wasClicked(Point clicked,
                          boolean curve)
Determines if the line was clicked.

Parameters:
clicked - the clicked point
curve - flag if the line was drawn as a curve.
Returns:
true if the either one point of the line was clicked or if the line connecting the points was clicked (both with a defined tolerance).


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.