|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent org.sourceforge.espro.elicitation.ElicitationMethod org.sourceforge.espro.elicitation.PointMethod org.sourceforge.espro.elicitation.AbstractScale
public abstract class AbstractScale
The AbstractScale is basic for the other scales.
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 int |
heightRect
Height of the scale rectangle. |
protected boolean |
invert
This sets if the scale should be inverted. |
protected int |
numberOfBetweenLinesRight
The number of small lines between the lines of the right side. |
protected int |
numberOfLinesRight
This is the number of lines on the right side of the scale. |
protected int |
padding
The space between the outline of the component and the scale. |
protected java.util.ArrayList<ScaleHint> |
verbalHintsList
This holds the list of verbal hints. |
protected int |
widthRect
Width of the scale rectangle. |
protected int |
xRect
Top left position of the scale rectangle. |
protected int |
yPointer
This holds the position of the slider. |
protected int |
yRect
Top left position of the scale rectangle. |
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 | |
---|---|
protected |
AbstractScale(java.lang.String name,
java.lang.String category)
Creates a new AbstractScale object. |
Method Summary | |
---|---|
void |
addScaleHint(ScaleHint scaleHint)
DOCUMENT ME! |
protected void |
addSelfListeners()
Adds the internal listeners to itself. |
protected abstract ScalePointSet |
calcPoints()
DOCUMENT ME! |
protected void |
drawLineLeft(double yPos,
double length)
Creates a line at the left handside of the scale at the specified y-coordinate and adds the created line in a vector. |
protected void |
drawLineRight(double yPos,
double lenght)
Creates a line at the right handside of the scale at the specified y-coordinate and adds the created line in a vector. |
protected void |
drawLines()
Draws the lines of the scale. |
protected abstract void |
drawNumberRight(double numForPos,
double yPos)
DOCUMENT ME! |
protected void |
drawSlider()
Method for drawing a slider and an invisible slider. |
protected void |
drawStringLeft(java.lang.String text,
double yPos)
Draws a string to the left side of the scale. |
protected void |
drawVerbalHints()
Draws all verbal hints from the list. |
int |
getNumberOfBetweenLinesRight()
Returns the number of lines between the main lines. |
int |
getNumberOfLinesRight()
Returns the number of main lines. |
java.util.ArrayList<ScaleHint> |
getVerbalHintsList()
Returns the verbalHintsList. |
boolean |
isInvert()
Tells if we want to invert the scale. |
boolean |
isUseRight()
Tells us if the scale uses the right side for drawing lines and numbers. |
boolean |
isVerbalHints()
Returns the verbalHints. |
void |
moveSlider(int y)
Moves the slider to the given y position. |
void |
moveSlider(int x,
int y)
Moves slider to the actual mouse-position by dragging the mouse on the slideArea. that is the baseline of the scale and the area near the scale. |
protected void |
paintComponent(java.awt.Graphics g)
Paints the component. |
void |
setInvert(boolean invert)
Sets if we want to invert the Scale. |
void |
setNumberOfBetweenLinesRight(int numberOfBetweenLines)
Sets the number of lines between the main lines. |
void |
setNumberOfLinesRight(int numberOfLines)
Sets the number of main lines. |
void |
setUseRight(boolean useRight)
Sets if we use the right side of the scale for lines and numbers. |
void |
setVerbalHints(boolean verbalHints)
Sets the verbalHints |
void |
setVerbalHintsList(java.util.ArrayList<ScaleHint> verbalHintsList)
Sets the verbalHintsList |
protected double |
valueFromYPointer()
Calculates the value from the current yPointer. |
protected abstract double |
valueFromYPointer(double pointer)
Calculates the value from a given pointer. |
protected double |
yPointerFromValue()
This calculates the yPointer from the current value. |
protected abstract int |
yPointerFromValue(double value)
Calculates the yPointer from the value of the elicitation method. |
Methods inherited from class org.sourceforge.espro.elicitation.PointMethod |
---|
getValue, setValue |
Methods inherited from class org.sourceforge.espro.elicitation.ElicitationMethod |
---|
addPropertyChangeListener, addPropertyChangeListener, getCategory, getName, initialize, 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 |
---|
protected java.util.ArrayList<ScaleHint> verbalHintsList
protected boolean invert
protected int heightRect
protected int numberOfBetweenLinesRight
protected int numberOfLinesRight
protected int padding
protected int widthRect
protected int xRect
protected int yPointer
protected int yRect
Constructor Detail |
---|
protected AbstractScale(java.lang.String name, java.lang.String category)
name
- DOCUMENT ME!category
- DOCUMENT ME!Method Detail |
---|
public void addScaleHint(ScaleHint scaleHint)
scaleHint
- DOCUMENT ME!public int getNumberOfBetweenLinesRight()
public int getNumberOfLinesRight()
public java.util.ArrayList<ScaleHint> getVerbalHintsList()
public boolean isInvert()
public boolean isUseRight()
public boolean isVerbalHints()
public void moveSlider(int y)
y
- The y position.public void moveSlider(int x, int y)
x
- x-coordinate of mousey
- y-coordinate of mousepublic void setInvert(boolean invert)
invert
- true if the scale should be inverted.public void setNumberOfBetweenLinesRight(int numberOfBetweenLines)
numberOfBetweenLines
- The number.public void setNumberOfLinesRight(int numberOfLines)
numberOfLines
- The number.public void setUseRight(boolean useRight)
useRight
- True if we want to use the right side.public void setVerbalHints(boolean verbalHints)
verbalHints
- The verbalHints to set.public void setVerbalHintsList(java.util.ArrayList<ScaleHint> verbalHintsList)
verbalHintsList
- The verbalHintsList to set.protected void addSelfListeners()
addSelfListeners
in class ElicitationMethod
protected abstract ScalePointSet calcPoints()
protected void drawLineLeft(double yPos, double length)
yPos
- y-coordinate of linelength
- The length of the line.protected void drawLineRight(double yPos, double lenght)
yPos
- y-coordinate of line.lenght
- The length of the line.protected void drawLines()
protected abstract void drawNumberRight(double numForPos, double yPos)
numForPos
- DOCUMENT ME!yPos
- DOCUMENT ME!protected void drawSlider()
protected void drawStringLeft(java.lang.String text, double yPos)
text
- The string.yPos
- The vertical position of the string.protected void drawVerbalHints()
protected void paintComponent(java.awt.Graphics g)
paintComponent
in class ElicitationMethod
g
- The graphics instance to paint the component on.ElicitationMethod.paintComponent(java.awt.Graphics)
protected abstract double valueFromYPointer(double pointer)
pointer
- The position to calculate the pointer from.
valueFromYPointer()
protected double valueFromYPointer()
protected double yPointerFromValue()
yPointerFromValue(double value)
protected abstract int yPointerFromValue(double value)
value
- The value.
valueFromYPointer()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |