|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.AbstractButton
com.threerings.stage.tools.editor.DirectionButton
public class DirectionButton
A button that allows for selection from the compass directions.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.AbstractButton |
|---|
AbstractButton.AccessibleAbstractButton, AbstractButton.ButtonChangeListener |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected int |
_armed
|
protected int |
_cdia
Diameter of selection circles. |
protected int[][] |
_coords
Coordinates of each of the selection circles. |
protected int |
_dia
Diameter of the drawn enclosing circle. |
protected int |
_direction
The current direction displayed by the button. |
protected int |
_prefdia
Our preferred diameter. |
| 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 javax.swing.SwingConstants |
|---|
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
DirectionButton()
Construct a 41x41 DirectionButton. |
|
DirectionButton(int preferredDiameter)
Construct a DirectionButton with the specified preferred diameter. |
|
| Method Summary | |
|---|---|
protected void |
configSize(int diameter)
Reconfigure the way we look for a new size |
int |
getDirection()
Get the direction that is currently selected. |
protected int |
getDirection(int x,
int y)
Get the direction specified by the mouse coordinates |
Dimension |
getPreferredSize()
|
void |
paintComponent(Graphics g)
Paint this component and the selected direction, dimmed if we're inactive. |
void |
setDirection(int direction)
Set the currently displayed direction |
void |
setSize(Dimension d)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected int _direction
protected int _armed
protected int _dia
protected int _cdia
protected int[][] _coords
protected int _prefdia
| Constructor Detail |
|---|
public DirectionButton()
public DirectionButton(int preferredDiameter)
| Method Detail |
|---|
public void paintComponent(Graphics g)
paintComponent in class JComponentpublic int getDirection()
public void setDirection(int direction)
protected int getDirection(int x,
int y)
public void setSize(Dimension d)
setSize in class Componentprotected void configSize(int diameter)
public Dimension getPreferredSize()
getPreferredSize in class JComponent
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||