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

Variable Index

 o apLabel
The Label with "Appearance" string
 o clLabel
The Label with "Color" string
 o colorArray
An array used to save colors which are corresponding to the color name strings of colorChoice.
 o colorChoice
Choice to set Color and Style of the cursor
 o cpLabel
The Label with "Cursor Position" string
 o cursor
The cursor to be controlled by this CursorSettingPanel.
 o cursorMaster
The component to which cursor associated.
 o htScroll
The IntScrollPanel to control width, height, and thickness
 o showBox
A Checkbox used to control and show the current cursor visible state.
 o styleChoice
Choice to set Color and Style of the cursor
 o titleLabel
The title label with "Cursor Graphics" string
 o tkScroll
The IntScrollPanel to control width, height, and thickness
 o wdScroll
The IntScrollPanel to control width, height, and thickness
 o xField
LabeledField to set and show current cursor position.
 o yField
LabeledField to set and show current cursor position.

Constructor Index

 o CursorSettingPanel(Cursor, Component)
Create a CursorSettingPanel.

Method Index

 o action(Event, Object)
Handle GUI actions.
 o getColorchoice()
Get the Color from colorChoice's current value
 o getShowbox()
Get the showBox's current state, it represents the visibility of the Cursor
 o getXfield()
Get xField value which is meant to be the x coordinate of the Cursor's current position.
 o getYfield()
Get yField value which is meant to be the y coordinate of the Cursor's current position.
 o handleEvent(Event)
 o layoutComponents()
 o layoutComponents(Container)
This method layout class member Components.
 o setColorchoice(Color)
Set a Color to colorChoice's current value
 o setFields(int, int)
Set xField and yField with cursor's current position.
 o setScrolls(int, int, int)
Set wdScroll, htScroll and tkScroll to be cursor's width, height, and thickness.
 o setShowbox(boolean)
Set showBox to be true or false
 o setStylechoice(int)
Set a Color to colorChoice's current value
 o setXfield(int)
Set xField value which is meant to be the x coordinate of the Cursor's current position.
 o setYfield(int)
Set yField value which is meant to be the y coordinate of the Cursor's current position.
 o toggleShowbox()
toggle the showBow true, false state.

Variables

 o cursor
  protected Cursor cursor
The cursor to be controlled by this CursorSettingPanel.
 o titleLabel
  protected Label titleLabel
The title label with "Cursor Graphics" string
 o cursorMaster
  protected Component cursorMaster
The component to which cursor associated.
 o showBox
  protected Checkbox showBox
A Checkbox used to control and show the current cursor visible state.
 o apLabel
  protected Label apLabel
The Label with "Appearance" string
 o cpLabel
  protected Label cpLabel
The Label with "Cursor Position" string
 o clLabel
  protected Label clLabel
The Label with "Color" string
 o xField
  protected LabeledField xField
LabeledField to set and show current cursor position.
 o yField
  protected LabeledField yField
LabeledField to set and show current cursor position.
 o colorChoice
  protected Choice colorChoice
Choice to set Color and Style of the cursor
 o styleChoice
  protected Choice styleChoice
Choice to set Color and Style of the cursor
 o colorArray
  protected Color colorArray[]
An array used to save colors which are corresponding to the color name strings of colorChoice.
See Also:
colorChoice
 o wdScroll
  protected IntScrollPanel wdScroll
The IntScrollPanel to control width, height, and thickness
 o htScroll
  protected IntScrollPanel htScroll
The IntScrollPanel to control width, height, and thickness
 o tkScroll
  protected IntScrollPanel tkScroll
The IntScrollPanel to control width, height, and thickness

Constructors

 o 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.

Methods

 o 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
 o getColorchoice
  public Color getColorchoice()
Get the Color from colorChoice's current value
 o 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
 o getXfield
  public int getXfield()
Get xField value which is meant to be the x coordinate of the Cursor's current position.
 o getYfield
  public int getYfield()
Get yField value which is meant to be the y coordinate of the Cursor's current position.
 o handleEvent
  public boolean handleEvent(Event evt)
Overrides:
handleEvent in class Component
 o layoutComponents
  public void layoutComponents()
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o 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
 o setShowbox
  public void setShowbox(boolean b)
Set showBox to be true or false
 o toggleShowbox
  public void toggleShowbox()
toggle the showBow true, false state.

All Packages  Class Hierarchy  This Package  Previous  Next  Index