org.knime.base.util.coordinate
Class AscendingNumericTickPolicyStrategy

java.lang.Object
  extended by org.knime.base.util.coordinate.PolicyStrategy
      extended by org.knime.base.util.coordinate.AscendingNumericTickPolicyStrategy
Direct Known Subclasses:
DescendingNumericTickPolicyStrategy, PercentagePolicyStrategy

public class AscendingNumericTickPolicyStrategy
extends PolicyStrategy

A strategy which creates tick for numeric values in ascending order.

Author:
Stephan Sellien, University of Konstanz

Field Summary
static String ID
          ID for a ascending tick policy.
 
Constructor Summary
AscendingNumericTickPolicyStrategy()
          Creates a policy strategy for ascending order.
AscendingNumericTickPolicyStrategy(String name)
          Creates a policy strategy for ascending order.
 
Method Summary
 double calculateMappedValue(DataCell domainValueCell, double absoluteLength, double minDomainValue, double maxDomainValue)
          Calculates the mapped value.
 CoordinateMapping[] getTickPositions(double absoluteLength, double minDomainValue, double maxDomainValue, double tickDistance)
          Calculates the mappings of the ticks according to the policy.
 CoordinateMapping[] getTickPositions(int absoluteLength, int minDomainValue, int maxDomainValue, int tickDistance)
          Calculates the mappings of the ticks according to the policy.
protected  double interpolatePosition(double value, double min, double max, double absLength)
          Interpolates the correct mapping for a given value.
 
Methods inherited from class org.knime.base.util.coordinate.PolicyStrategy
calculateMappedValue, getDisplayName, getNegativeInfinity, getPositiveInfinity, getTickPositions, getTickPositions, getValues, isMappingAllowed, setValues
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

public static final String ID
ID for a ascending tick policy. Used as unique identifier in Coordinate.

See Also:
Constant Field Values
Constructor Detail

AscendingNumericTickPolicyStrategy

public AscendingNumericTickPolicyStrategy()
Creates a policy strategy for ascending order. The name is set to "Ascending".


AscendingNumericTickPolicyStrategy

public AscendingNumericTickPolicyStrategy(String name)
Creates a policy strategy for ascending order.

Parameters:
name - the name of this strategy
Method Detail

calculateMappedValue

public double calculateMappedValue(DataCell domainValueCell,
                                   double absoluteLength,
                                   double minDomainValue,
                                   double maxDomainValue)
Calculates the mapped value.

Specified by:
calculateMappedValue in class PolicyStrategy
Parameters:
domainValueCell - the value to be mapped
absoluteLength - the absolute length
minDomainValue - the minimal domain value
maxDomainValue - the maximal domain value
Returns:
the mapped value

interpolatePosition

protected double interpolatePosition(double value,
                                     double min,
                                     double max,
                                     double absLength)
Interpolates the correct mapping for a given value.

Parameters:
value - the domain value to map
min - minimum domain value
max - maximum domain value
absLength - the absolute length in pixel.
Returns:
the mapped value as a position

getTickPositions

public CoordinateMapping[] getTickPositions(double absoluteLength,
                                            double minDomainValue,
                                            double maxDomainValue,
                                            double tickDistance)
Calculates the mappings of the ticks according to the policy.

Specified by:
getTickPositions in class PolicyStrategy
Parameters:
absoluteLength - the absolute length
minDomainValue - the minimal domain value
maxDomainValue - the maximal domain value
tickDistance - the absolute distance between to ticks
Returns:
the mappings of the ticks.

getTickPositions

public CoordinateMapping[] getTickPositions(int absoluteLength,
                                            int minDomainValue,
                                            int maxDomainValue,
                                            int tickDistance)
Calculates the mappings of the ticks according to the policy.

Specified by:
getTickPositions in class PolicyStrategy
Parameters:
absoluteLength - the absolute length
minDomainValue - the minimal domain value
maxDomainValue - the maximal domain value
tickDistance - the absolute distance between to ticks
Returns:
the mappings of the ticks.


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.