|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JPanel | +--uk.co.ist.mwt.ScalePanel
The ScalePanel implements the behaviour of a Motif XmScale widget; it is a Panel subclass and can thus take children. If you want to use a simple scale component - that is, one without children - you should use the Scale component
Inner classes inherited from class javax.swing.JPanel |
javax.swing.JPanel.AccessibleJPanel |
Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
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 |
Constructor Summary | |
ScalePanel()
Create a new ScalePanel with default settings (vertical orientation, and default values for the Scale child). |
Method Summary | |
protected void |
addImpl(java.awt.Component comp,
java.lang.Object constraints,
int pos)
Add a component to the Panel; overriden so that any children added are put into the scaleChildPanel. |
java.awt.Component |
getComponentAt(int x,
int y)
Locate a component; as we're hiding the existence of the internal scaleChildPanel, we must return one of its children if the click is inside it. |
int |
getDecimalPoints()
Gets the number of digits to the right of the decimal point if we've decided to show the value |
int |
getMaximum()
Gets the maximum value for the scale |
int |
getMinimum()
Gets the minimum value for the scale |
int |
getMultiple()
What is the multiple's value? (The multiple is the amount (in terms of the maximum and minimum values) that the scale will move its thumb when a non-thumb place in the scale is clicked.) Because the multiple, if it has never been set, is dynamically calculated, all access to it should be through this method - even from inside this class. |
boolean |
getShowValue()
Are we showing the scale's value at the moment? |
int |
getValue()
Gets the value of the scale |
boolean |
isMaxTopRight()
Returns whether the top/right part of the scale is where its maximum value is |
boolean |
isVertical()
Gets the Scale's orientation |
void |
remove(java.awt.Component comp)
Remove a component from the panel; overriden so that any children are removed from the scaleChildPanel. |
void |
removeAll()
Remove all components from the panel; actually removes those from the scaleChildPanel. |
void |
setDecimalPoints(int dp)
Sets the number of digits to the right of the decimal point if we've decided to show the value |
void |
setMaximum(int max)
Sets the maximum value for the scale |
void |
setMaxTopRight(boolean mtr)
Sets the scale up so that the minimum value is on the right/at the top (as appropriate for the orientation). |
void |
setMinimum(int min)
Sets the minimum value for the scale |
void |
setMultiple(int mult)
Sets the multiple's value. |
void |
setShowValue(boolean whether)
Tell the scale to display its current value |
void |
setValue(int val)
Sets the current value of the scale, rounded up or down to the minimum or maximum if appropriate |
void |
setVertical(boolean vert)
Sets the Scale's orientation, and reorganise the children of this panel to reflect this. |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext,
getUIClassID,
paramString,
updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener,
addNotify,
addPropertyChangeListener,
addPropertyChangeListener,
addVetoableChangeListener,
computeVisibleRect,
contains,
createToolTip,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
fireVetoableChange,
getActionForKeyStroke,
getAlignmentX,
getAlignmentY,
getAutoscrolls,
getBorder,
getBounds,
getClientProperty,
getComponentGraphics,
getConditionForKeyStroke,
getDebugGraphicsOptions,
getGraphics,
getHeight,
getInsets,
getInsets,
getLocation,
getMaximumSize,
getMinimumSize,
getNextFocusableComponent,
getPreferredSize,
getRegisteredKeyStrokes,
getRootPane,
getSize,
getToolTipLocation,
getToolTipText,
getToolTipText,
getTopLevelAncestor,
getVisibleRect,
getWidth,
getX,
getY,
grabFocus,
hasFocus,
isDoubleBuffered,
isFocusCycleRoot,
isFocusTraversable,
isLightweightComponent,
isManagingFocus,
isOpaque,
isOptimizedDrawingEnabled,
isPaintingTile,
isRequestFocusEnabled,
isValidateRoot,
paint,
paintBorder,
paintChildren,
paintComponent,
paintImmediately,
paintImmediately,
processComponentKeyEvent,
processFocusEvent,
processKeyEvent,
processMouseMotionEvent,
putClientProperty,
registerKeyboardAction,
registerKeyboardAction,
removeAncestorListener,
removeNotify,
removePropertyChangeListener,
removePropertyChangeListener,
removeVetoableChangeListener,
repaint,
repaint,
requestDefaultFocus,
requestFocus,
resetKeyboardActions,
reshape,
revalidate,
scrollRectToVisible,
setAlignmentX,
setAlignmentY,
setAutoscrolls,
setBackground,
setBorder,
setDebugGraphicsOptions,
setDoubleBuffered,
setEnabled,
setFont,
setForeground,
setMaximumSize,
setMinimumSize,
setNextFocusableComponent,
setOpaque,
setPreferredSize,
setRequestFocusEnabled,
setToolTipText,
setUI,
setVisible,
unregisterKeyboardAction,
update |
Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
countComponents,
deliverEvent,
doLayout,
findComponentAt,
findComponentAt,
getComponent,
getComponentAt,
getComponentCount,
getComponents,
getLayout,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paintComponents,
preferredSize,
print,
printComponents,
processContainerEvent,
processEvent,
remove,
removeContainerListener,
setCursor,
setLayout,
validate,
validateTree |
Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addInputMethodListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
bounds,
checkImage,
checkImage,
coalesceEvents,
contains,
createImage,
createImage,
disable,
disableEvents,
dispatchEvent,
enable,
enable,
enableEvents,
enableInputMethods,
getBackground,
getBounds,
getColorModel,
getComponentOrientation,
getCursor,
getDropTarget,
getFont,
getFontMetrics,
getForeground,
getInputContext,
getInputMethodRequests,
getLocale,
getLocation,
getLocationOnScreen,
getName,
getParent,
getPeer,
getSize,
getToolkit,
getTreeLock,
gotFocus,
handleEvent,
hide,
imageUpdate,
inside,
isDisplayable,
isEnabled,
isLightweight,
isShowing,
isValid,
isVisible,
keyDown,
keyUp,
list,
list,
list,
location,
lostFocus,
mouseDown,
mouseDrag,
mouseEnter,
mouseExit,
mouseMove,
mouseUp,
move,
nextFocus,
paintAll,
postEvent,
prepareImage,
prepareImage,
printAll,
processComponentEvent,
processInputMethodEvent,
processMouseEvent,
remove,
removeComponentListener,
removeFocusListener,
removeInputMethodListener,
removeKeyListener,
removeMouseListener,
removeMouseMotionListener,
repaint,
repaint,
repaint,
resize,
resize,
setBounds,
setBounds,
setComponentOrientation,
setDropTarget,
setLocale,
setLocation,
setLocation,
setName,
setSize,
setSize,
show,
show,
size,
toString,
transferFocus |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public ScalePanel()
Method Detail |
public void setVertical(boolean vert)
vert
- if true, set the orientation to vertical; if false,
set orientation to horizontal.public boolean isVertical()
public void setShowValue(boolean whether)
whether
- if true, the value will be displayed; if false, it won'tsetDecimalPoints(int)
,
getShowValue()
public boolean getShowValue()
setShowValue(boolean)
public void setDecimalPoints(int dp)
setShowValue(boolean)
,
getDecimalPoints()
public int getDecimalPoints()
setShowValue(boolean)
,
setDecimalPoints(int)
public void setValue(int val)
val
- the new valuegetValue()
public int getValue()
setValue(int)
public void setMaxTopRight(boolean mtr)
mtr
- true to set the maximum value to the right or top, false
for the maximum at the bottom or left.public boolean isMaxTopRight()
public void setMaximum(int max)
max
- the new maximumpublic int getMaximum()
public void setMinimum(int min)
min
- the new minimumpublic int getMinimum()
public void setMultiple(int mult)
mult
- the new multiplepublic int getMultiple()
protected void addImpl(java.awt.Component comp, java.lang.Object constraints, int pos)
comp
- the component to addconstraints
- any constraints specifiedpos
- the position in the list of children at which to add it;
-1 means 'at the end'.public void remove(java.awt.Component comp)
comp
- the component to removepublic void removeAll()
public java.awt.Component getComponentAt(int x, int y)
x
- the x co-ordinate within this component which the desired
component containsy
- the y co-ordinate within this component which the desired
component contains
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |