|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.knime.base.util.coordinate.Coordinate
org.knime.base.util.coordinate.NumericCoordinate
org.knime.base.util.coordinate.DoubleCoordinate
public class DoubleCoordinate
This class represents a numeric coordinate defined by a given
DataColumnSpec
. The class provides functionality
for extension of coordinates beyond the domain length. Furthermore the label
ticks can be determined dependent on given properties. All these sizes are
normalized (0-1) but there are also methods to convert them to absolute
values given an absolute maximum length.
Field Summary |
---|
Fields inherited from class org.knime.base.util.coordinate.Coordinate |
---|
DEFAULT_ABSOLUTE_TICK_DIST |
Constructor Summary | |
---|---|
protected |
DoubleCoordinate(DataColumnSpec dataColumnSpec)
Constructs a Coordinate according to the given column spec and predefined default values for the coordinatePrefix ,
coordinatePostfix and the
absoluteTickDistance . |
(package private) |
DoubleCoordinate(DataColumnSpec dataColumnSpec,
double coordinatePrefix,
double coordinatePostfix,
double absoluteTickDistance,
String tickPolicy,
int maxDomainLabelLength)
Constructs a coordinate from the given parameters. |
Method Summary | |
---|---|
protected double |
calculateMappedValueInternal(DataCell domainValueCell,
double absoluteLength)
Calculates a numeric mapping assuming a DoubleCell . |
String |
formatNumber(double number)
Formats a number according to the maximum length allowed for a domain label. |
protected CoordinateMapping[] |
getTickPositionsInternal(double absoluteLength)
Returns an array with the positions of all ticks and their corresponding domain values given an absolute length. |
boolean |
isMaxDomainValueSet()
|
boolean |
isMinDomainValueSet()
|
void |
setMaxDomainValue(double maxDomainValue)
Sets the upper domain value. |
void |
setMinDomainValue(double minDomainValue)
Sets the lower domain value. |
Methods inherited from class org.knime.base.util.coordinate.NumericCoordinate |
---|
addDesiredValues, getDesiredValues, getMaxDomainValue, getMinDomainValue, getNegativeInfinity, getPositiveInfinity, getTickPositionsWithLabels, getUnusedDistBetweenTicks, isNominal |
Methods inherited from class org.knime.base.util.coordinate.Coordinate |
---|
addCoordinateFactory, addMappingMethod, addPolicy, applyMappingMethod, calculateMappedValue, calculateMappedValue, clearDesiredValues, createCoordinate, getActiveMappingMethod, getCompatibleMappingMethods, getCompatiblePolicies, getCurrentPolicy, getDataColumnSpec, getDesiredValuesSet, getDomain, getMappingMethod, getPolicyStategy, getTickPositions, getTickPositions, setActiveMappingMethod, setPolicy, setPolicy |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected DoubleCoordinate(DataColumnSpec dataColumnSpec)
coordinatePrefix
,
coordinatePostfix
and the
absoluteTickDistance
.
dataColumnSpec
- the column spec to create this coordinate fromDoubleCoordinate(DataColumnSpec dataColumnSpec, double coordinatePrefix, double coordinatePostfix, double absoluteTickDistance, String tickPolicy, int maxDomainLabelLength)
dataColumnSpec
- the column spec to create this coordinate fromcoordinatePrefix
- the prefix to append before the domain size. A
value larger or equal 0 is expected and is assumed to be a
percent value.coordinatePostfix
- the postfix to append after the end of the
domain. A value larger or equal 0 is expected and is assumed
to be a percent value.absoluteTickDistance
- the distance used to calculate absolute tick
positions when given an maximum lengthtickPolicy
- the policy to determine the position of the ticks for
this coordinatemaxDomainLabelLength
- the number digits after the decimal dot for
rounding accuracyMethod Detail |
---|
protected CoordinateMapping[] getTickPositionsInternal(double absoluteLength)
getTickPositionsInternal
in class NumericCoordinate
absoluteLength
- the absolute length the domain is mapped on
public String formatNumber(double number)
number
- the number to format
protected double calculateMappedValueInternal(DataCell domainValueCell, double absoluteLength)
DoubleCell
.
Returns the mapping of a domain value for this coordinate axis. The
mapping is done according to the given absolute length.
The value is not the position on the screen. Since the java coordinate system is upside down simply subtract the returned value from the screen height to calculate the screen position.
calculateMappedValueInternal
in class NumericCoordinate
domainValueCell
- the data cell with the domain value to mapabsoluteLength
- the absolute length on which the domain value is
mapped on
public boolean isMinDomainValueSet()
isMinDomainValueSet
in class NumericCoordinate
true
if the lower domain range is set properlypublic boolean isMaxDomainValueSet()
isMaxDomainValueSet
in class NumericCoordinate
true
if the upper domain range is set properlypublic void setMaxDomainValue(double maxDomainValue)
setMaxDomainValue
in class NumericCoordinate
maxDomainValue
- the upper valuepublic void setMinDomainValue(double minDomainValue)
setMinDomainValue
in class NumericCoordinate
minDomainValue
- the lower value
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |