|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.ast.gui.LineControls
public class LineControls
LineControls add a series of controls for showing and changing the display properties of any drawn lines (the thickness, style and colour).
This class assumes that it will be laying out its components as part of a GridBagLayouter scheme. It adds the controls in a set of incrementing rows, starting from the current GridBagLayouter position.
Users of this class should register a ChangeListener to be informed when the line properties are changed (get the actual value using the get methods).
Field Summary | |
---|---|
protected JButton |
colourButton
Colour button. |
protected ColourIcon |
colourIcon
Colour Icon of colour button. |
protected GridBagLayouter |
layouter
The GridBagLayouter. |
protected EventListenerList |
listeners
|
protected AstStyleBox |
styleBox
Style selection. |
protected JComboBox |
thickBox
List of pre-selected thicknesses. |
Constructor Summary | |
---|---|
LineControls(GridBagLayouter layouter,
String postfix)
Construct an instance using the given GridBagLayouter to arrange the components. |
Method Summary | |
---|---|
void |
addChangeListener(ChangeListener l)
Registers a listener who wants to be informed about changes. |
protected void |
changeStyle()
Send event to signal the line style has changed. |
protected void |
changeThick()
Send event to signal a line thickness change event. |
protected void |
chooseColour()
Create a dialog to select a new colour. |
protected void |
fireChanged()
Send ChangeEvent event to all listeners. |
Color |
getColour()
Return the current colour. |
int |
getStyle()
Return the current line style (as AST integer). |
int |
getThick()
Return the current line thickness. |
void |
reset()
Reset controls to defaults. |
void |
setColour(Color colour)
Set the current colour. |
void |
setStyle(int style)
Set the current line style (as AST integer). |
void |
setThick(int thick)
Set the current line thickness. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected JButton colourButton
protected ColourIcon colourIcon
protected AstStyleBox styleBox
protected JComboBox thickBox
protected GridBagLayouter layouter
protected EventListenerList listeners
Constructor Detail |
---|
public LineControls(GridBagLayouter layouter, String postfix)
Method Detail |
---|
public void reset()
protected void changeThick()
public void setThick(int thick)
public int getThick()
protected void changeStyle()
public void setStyle(int style)
public int getStyle()
protected void chooseColour()
public Color getColour()
public void setColour(Color colour)
public void addChangeListener(ChangeListener l)
l
- the ChangeListener listener.protected void fireChanged()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |