public class LineControls extends Object
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).
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
LineControls(GridBagLayouter layouter,
String postfix)
Construct an instance using the given GridBagLayouter to arrange the
components.
|
Modifier and Type | Method and Description |
---|---|
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.
|
protected JButton colourButton
protected ColourIcon colourIcon
protected AstStyleBox styleBox
protected JComboBox thickBox
protected GridBagLayouter layouter
protected EventListenerList listeners
public LineControls(GridBagLayouter layouter, String postfix)
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()
Copyright © 2024 Central Laboratory of the Research Councils. All Rights Reserved.