Class ncsa.horizon.modules.CursorSettingPanel
All Packages Class Hierarchy This Package Previous Next Index
Class ncsa.horizon.modules.CursorSettingPanel
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----ncsa.horizon.modules.CursorSettingPanel
- public class CursorSettingPanel
- extends Panel
- implements LayoutRearrangeable
This class provides a graphic interface to control the
ncsa.horizon.awt.Cursor. It is implemented as a panel with
Checkbox, ncsa.horizon.awt.LabeledFields, Choices, and
ncsa.horizon.awt.IntScrollPanels to make Cursor visible or invisible,
set Cursor appearence, color, position, width, height, and
thickness. The panel updates its position text field,
and visibility CheckBox as Cursor
changes position and becomes visible or invisible.
- See Also:
- LineSelectionSettingPanel, ROISettingPanel
-
apLabel
- The Label with "Appearance" string
-
clLabel
- The Label with "Color" string
-
colorArray
- An array used to save colors which are corresponding to
the color name strings of colorChoice.
-
colorChoice
- Choice to set Color and Style of the cursor
-
cpLabel
- The Label with "Cursor Position" string
-
cursor
- The cursor to be controlled by this CursorSettingPanel.
-
cursorMaster
- The component to which cursor associated.
-
htScroll
- The IntScrollPanel to control width, height, and thickness
-
showBox
- A Checkbox used to control and show the current cursor visible
state.
-
styleChoice
- Choice to set Color and Style of the cursor
-
titleLabel
- The title label with "Cursor Graphics" string
-
tkScroll
- The IntScrollPanel to control width, height, and thickness
-
wdScroll
- The IntScrollPanel to control width, height, and thickness
-
xField
- LabeledField to set and show current cursor position.
-
yField
- LabeledField to set and show current cursor position.
-
CursorSettingPanel(Cursor, Component)
- Create a CursorSettingPanel.
-
action(Event, Object)
- Handle GUI actions.
-
getColorchoice()
- Get the Color from colorChoice's current value
-
getShowbox()
- Get the showBox's current state, it represents the visibility of
the Cursor
-
getXfield()
- Get xField value which is meant to be the x coordinate
of the Cursor's current position.
-
getYfield()
- Get yField value which is meant to be the y coordinate
of the Cursor's current position.
-
handleEvent(Event)
-
-
layoutComponents()
-
-
layoutComponents(Container)
- This method layout class member Components.
-
setColorchoice(Color)
- Set a Color to colorChoice's current value
-
setFields(int, int)
- Set xField and yField with cursor's current position.
-
setScrolls(int, int, int)
- Set wdScroll, htScroll and tkScroll to be cursor's width, height,
and thickness.
-
setShowbox(boolean)
- Set showBox to be true or false
-
setStylechoice(int)
- Set a Color to colorChoice's current value
-
setXfield(int)
- Set xField value which is meant to be the x coordinate
of the Cursor's current position.
-
setYfield(int)
- Set yField value which is meant to be the y coordinate
of the Cursor's current position.
-
toggleShowbox()
- toggle the showBow true, false state.
cursor
protected Cursor cursor
- The cursor to be controlled by this CursorSettingPanel.
titleLabel
protected Label titleLabel
- The title label with "Cursor Graphics" string
cursorMaster
protected Component cursorMaster
- The component to which cursor associated.
showBox
protected Checkbox showBox
- A Checkbox used to control and show the current cursor visible
state.
apLabel
protected Label apLabel
- The Label with "Appearance" string
cpLabel
protected Label cpLabel
- The Label with "Cursor Position" string
clLabel
protected Label clLabel
- The Label with "Color" string
xField
protected LabeledField xField
- LabeledField to set and show current cursor position.
yField
protected LabeledField yField
- LabeledField to set and show current cursor position.
colorChoice
protected Choice colorChoice
- Choice to set Color and Style of the cursor
styleChoice
protected Choice styleChoice
- Choice to set Color and Style of the cursor
colorArray
protected Color colorArray[]
- An array used to save colors which are corresponding to
the color name strings of colorChoice.
- See Also:
- colorChoice
wdScroll
protected IntScrollPanel wdScroll
- The IntScrollPanel to control width, height, and thickness
htScroll
protected IntScrollPanel htScroll
- The IntScrollPanel to control width, height, and thickness
tkScroll
protected IntScrollPanel tkScroll
- The IntScrollPanel to control width, height, and thickness
CursorSettingPanel
public CursorSettingPanel(Cursor cursor,
Component c)
- Create a CursorSettingPanel.
- Parameters:
- cursor - The cursor to be controlled by this
CursorSettingPanel.
- c - The Component which the cursor associated to.
action
public boolean action(Event ev,
Object obj)
- Handle GUI actions. This responds to user input/selection using
the GUI controls.
- Parameters:
- ev - The Event to handle.
- obj - AN Event-specific object.
- Returns:
- false.
- Overrides:
- action in class Component
getColorchoice
public Color getColorchoice()
- Get the Color from colorChoice's current value
getShowbox
public boolean getShowbox()
- Get the showBox's current state, it represents the visibility of
the Cursor
- Returns:
- true if the Cursor is visible, false if the Cursor is
hiden
getXfield
public int getXfield()
- Get xField value which is meant to be the x coordinate
of the Cursor's current position.
getYfield
public int getYfield()
- Get yField value which is meant to be the y coordinate
of the Cursor's current position.
handleEvent
public boolean handleEvent(Event evt)
- Overrides:
- handleEvent in class Component
layoutComponents
public void layoutComponents()
layoutComponents
public void layoutComponents(Container parent)
- This method layout class member Components.
The components have been instantiated in the
constructor. This method is called inside constructor
if it is not overwritten.
The member Components are protected. The Components to be
layouted are:
titleLabel, showBox, apLabel, cpLabel, styleChoice,
xField, clLabel, yField, colorChoice, wdScroll, htScroll,
and, tkScroll.
The default setting source codes are:
public void layoutComponents(Container parent)
{
// layout the components
GridBagLayout gbl = new GridBagLayout();
setLayout(gbl);
GridBagConstraints gbc = new GridBagConstraints();
//
// layout titleLabel
gbc.gridwidth = GridBagConstraints.REMAINDER;
gbl.setConstraints(titleLabel, gbc);
parent.add(titleLabel);
//
// layout showBox
gbc.gridwidth = GridBagConstraints.RELATIVE;
gbl.setConstraints(showBox, gbc);
parent.add(showBox);
//
// layout apLabel
gbc.gridwidth = GridBagConstraints.REMAINDER;
gbc.anchor = GridBagConstraints.SOUTH;
gbl.setConstraints(apLabel, gbc);
parent.add(apLabel);
gbc.anchor = GridBagConstraints.CENTER;
//
// layout cpLabel
gbc.gridwidth = GridBagConstraints.RELATIVE;
gbc.anchor = GridBagConstraints.SOUTH;
gbl.setConstraints(cpLabel, gbc);
parent.add(cpLabel);
//
// layout styleChoice
gbc.anchor = GridBagConstraints.CENTER;
gbc.gridwidth = GridBagConstraints.REMAINDER;
gbc.ipadx = 12;
gbl.setConstraints(styleChoice, gbc);
parent.add(styleChoice);
gbc.ipadx = 0;
//
// layout xField
gbc.gridwidth = GridBagConstraints.RELATIVE;
gbl.setConstraints(xField, gbc);
parent.add(xField);
//
// layout clLabel
gbc.gridwidth = GridBagConstraints.REMAINDER;
gbc.anchor = GridBagConstraints.SOUTH;
gbl.setConstraints(clLabel, gbc);
parent.add(clLabel);
//
// layout yField
gbc.anchor = GridBagConstraints.CENTER;
gbc.gridwidth = GridBagConstraints.RELATIVE;
gbl.setConstraints(yField, gbc);
parent.add(yField);
//
// layout colorChoice
gbc.gridwidth = GridBagConstraints.REMAINDER;
gbc.anchor = GridBagConstraints.NORTH;
gbl.setConstraints(colorChoice, gbc);
parent.add(colorChoice);
//
// layout wdScroll
gbc.anchor = GridBagConstraints.CENTER;
gbc.ipady = 6;
gbl.setConstraints(wdScroll, gbc);
parent.add(wdScroll);
//
// layout htScroll
gbl.setConstraints(htScroll, gbc);
parent.add(htScroll);
//
// layout tkScroll
gbl.setConstraints(tkScroll, gbc);
parent.add(tkScroll);
}
- Parameters:
- parent - the Container on which the Components are
to be layouted.
- See Also:
- titleLabel, showBox, apLabel, cpLabel, styleChoice, xField, clLabel, yField, colorChoice, wdScroll, htScroll, tkScroll
setColorchoice
public void setColorchoice(Color color)
- Set a Color to colorChoice's current value
- Parameters:
- color - Following value acceptable:(default Color.red)
Color.red, Color.green, Color.blue, Color.cyan,
Color.magenta, Color.yellow, Color.black,
Color.white, Color.gray
setFields
public void setFields(int x,
int y)
- Set xField and yField with cursor's current position.
- Parameters:
- x - x coordinate of current cursor with respect to
the left top of cursorMaster
- y - y coordinate of current cursor with respect to
the left top of cursorMaster
setStylechoice
public void setStylechoice(int style)
- Set a Color to colorChoice's current value
- Parameters:
- color - Following value acceptable:(default Color.red)
Color.red, Color.green, Color.blue, Color.cyan,
Color.magenta, Color.yellow, Color.black,
Color.white, Color.gray
setXfield
public void setXfield(int x)
- Set xField value which is meant to be the x coordinate
of the Cursor's current position.
- Parameters:
- x - x coordinate of the cursor's position with respect to
the left top of lsMaster
setYfield
public void setYfield(int y)
- Set yField value which is meant to be the y coordinate
of the Cursor's current position.
- Parameters:
- y - y coordinate of the cursor's position with respect to
the left top of lsMaster
setScrolls
public void setScrolls(int w,
int h,
int t)
- Set wdScroll, htScroll and tkScroll to be cursor's width, height,
and thickness.
- Parameters:
- w - width
- h - height
- t - thickness
setShowbox
public void setShowbox(boolean b)
- Set showBox to be true or false
toggleShowbox
public void toggleShowbox()
- toggle the showBow true, false state.
All Packages Class Hierarchy This Package Previous Next Index