org.sourceforge.espro.elicitation
Class Scale

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by org.sourceforge.espro.elicitation.ElicitationMethod
                  extended by org.sourceforge.espro.elicitation.PointMethod
                      extended by org.sourceforge.espro.elicitation.AbstractScale
                          extended by org.sourceforge.espro.elicitation.Scale
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, ModelInterface

public class Scale
extends AbstractScale

The scale elicitation method.

Version:
1.1
Author:
Martin Kaffanke
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  boolean invLog
          Is the logarithmus inverted?
protected  double logBase
          Base of the logarithm.
protected  double max
          The maximum of the scale.
protected  double min
          The minimum of the scale.
protected  ScalePointSet points
          Holds the points of the scale.
 
Fields inherited from class org.sourceforge.espro.elicitation.AbstractScale
heightRect, invert, numberOfBetweenLinesRight, numberOfLinesRight, padding, verbalHintsList, widthRect, xRect, yPointer, yRect
 
Fields inherited from class org.sourceforge.espro.elicitation.PointMethod
value
 
Fields inherited from class org.sourceforge.espro.elicitation.ElicitationMethod
frozen, g2, pcs
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
  Scale()
          This constructs the 'scale' elicitation method.
protected Scale(java.lang.String name, java.lang.String category)
          This constructor is for subclasses, in order to create a new method.
 
Method Summary
protected  ScalePointSet calcLinearPoints()
          Calculates sthe distances and lines between on the scale.
protected  ScalePointSet calcLogarithmicPoints()
          DOCUMENT ME!
protected  ScalePointSet calcPoints()
          DOCUMENT ME!
protected  void drawNumberRight(double numForPos, double yPos)
          Draws a number on the right side.
 int getDigits()
          Returns the digits, which is the number of numbers behind the coma-seperator.
 double getLogBase()
          Returns the logBase.
 double getMax()
          Returns the maximum value of the scale.
 double getMin()
          Returns the minimum value of the scale.
 int[] getPositionFromValue(double d)
          DOCUMENT ME!
protected  void initialize()
          Initializes the Scale.
 boolean isInvLog()
          DOCUMENT ME!
 boolean isLogarithmic()
          DOCUMENT ME!
 void setDigits(int digits)
          Sets the digits, which is the number of numbers behind the coma-seperator.
 void setInvLog(boolean invLog)
          DOCUMENT ME!
 void setLogarithmic(boolean logarithmic)
          DOCUMENT ME!
 void setLogBase(double logBase)
          Sets the logBase
 void setMax(double max)
          Sets a maximum value for the scale.
 void setMin(double min)
          Sets the minimum value of the Scale.
protected  double valueFromYPointer(double pointer)
          Calculates the value from a given pointer.
protected  int yPointerFromValue(double value)
          Calculates the yPointer from the value of the elicitation method.
 
Methods inherited from class org.sourceforge.espro.elicitation.AbstractScale
addScaleHint, addSelfListeners, drawLineLeft, drawLineRight, drawLines, drawSlider, drawStringLeft, drawVerbalHints, getNumberOfBetweenLinesRight, getNumberOfLinesRight, getVerbalHintsList, isInvert, isUseRight, isVerbalHints, moveSlider, moveSlider, paintComponent, setInvert, setNumberOfBetweenLinesRight, setNumberOfLinesRight, setUseRight, setVerbalHints, setVerbalHintsList, valueFromYPointer, yPointerFromValue
 
Methods inherited from class org.sourceforge.espro.elicitation.PointMethod
getValue, setValue
 
Methods inherited from class org.sourceforge.espro.elicitation.ElicitationMethod
addPropertyChangeListener, addPropertyChangeListener, getCategory, getName, isEdit, isFrozen, removePropertyChangeListener, removePropertyChangeListener, setEdit, setFrozen, smothed
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

points

protected ScalePointSet points
Holds the points of the scale.

See Also:
ScalePointSet

invLog

protected boolean invLog
Is the logarithmus inverted?


logBase

protected double logBase
Base of the logarithm.


max

protected double max
The maximum of the scale.


min

protected double min
The minimum of the scale.

Constructor Detail

Scale

public Scale()
This constructs the 'scale' elicitation method.


Scale

protected Scale(java.lang.String name,
                java.lang.String category)
This constructor is for subclasses, in order to create a new method.

Parameters:
name - The name.
category - The category.
See Also:
ElicitationMethod
Method Detail

getDigits

public int getDigits()
Returns the digits, which is the number of numbers behind the coma-seperator.

Returns:
The number of digits.

getLogBase

public double getLogBase()
Returns the logBase.

Returns:
The logBase.

getMax

public double getMax()
Returns the maximum value of the scale.

Returns:
The maximum value of the scale.

getMin

public double getMin()
Returns the minimum value of the scale.

Returns:
The minimum value of the scale.

getPositionFromValue

public int[] getPositionFromValue(double d)
DOCUMENT ME!

Parameters:
d - DOCUMENT ME!
Returns:
DOCUMENT ME!

isInvLog

public boolean isInvLog()
DOCUMENT ME!

Returns:
The invertlog.

isLogarithmic

public boolean isLogarithmic()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setDigits

public void setDigits(int digits)
Sets the digits, which is the number of numbers behind the coma-seperator.

Parameters:
digits - The number of numbers behind the coma-seperator.

setInvLog

public void setInvLog(boolean invLog)
DOCUMENT ME!

Parameters:
invLog - The invertlog to set.

setLogBase

public void setLogBase(double logBase)
Sets the logBase

Parameters:
logBase - The logBase to set.

setLogarithmic

public void setLogarithmic(boolean logarithmic)
DOCUMENT ME!

Parameters:
logarithmic - DOCUMENT ME!

setMax

public void setMax(double max)
Sets a maximum value for the scale.

Parameters:
max - The maximum value.

setMin

public void setMin(double min)
Sets the minimum value of the Scale.

Parameters:
min - The minimum value.

calcLinearPoints

protected ScalePointSet calcLinearPoints()
Calculates sthe distances and lines between on the scale. This can be easily overridden, to create a new scale.

Returns:
A list of ScalePoints.

calcLogarithmicPoints

protected ScalePointSet calcLogarithmicPoints()
DOCUMENT ME!

Returns:
DOCUMENT ME!

calcPoints

protected ScalePointSet calcPoints()
DOCUMENT ME!

Specified by:
calcPoints in class AbstractScale
Returns:
DOCUMENT ME!

drawNumberRight

protected void drawNumberRight(double numForPos,
                               double yPos)
Draws a number on the right side.

Specified by:
drawNumberRight in class AbstractScale
Parameters:
numForPos - The number to draw.
yPos - The y position.

initialize

protected void initialize()
Initializes the Scale.

Specified by:
initialize in class ElicitationMethod
See Also:
ElicitationMethod.initialize()

valueFromYPointer

protected double valueFromYPointer(double pointer)
Calculates the value from a given pointer. You don't have to use the return value, because this will be automatically set to the elicitation methods value.

Specified by:
valueFromYPointer in class AbstractScale
Parameters:
pointer - The position to calculate the pointer from.
Returns:
The calculated value.
See Also:
AbstractScale.valueFromYPointer()

yPointerFromValue

protected int yPointerFromValue(double value)
Calculates the yPointer from the value of the elicitation method. Note that you don't have to use the return value, because this will be set automatically when you recalculate the yPointer.

Specified by:
yPointerFromValue in class AbstractScale
Parameters:
value - The value.
Returns:
The yPointer.
See Also:
AbstractScale.valueFromYPointer()