Class ncsa.horizon.modules.LineSelectionSettingPanel
All Packages Class Hierarchy This Package Previous Next Index
Class ncsa.horizon.modules.LineSelectionSettingPanel
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----ncsa.horizon.modules.LineSelectionSettingPanel
- public class LineSelectionSettingPanel
- extends Panel
- implements LayoutRearrangeable
This class provide a graphic interface to control the
ncsa.horizon.awt.LineSelection.
It is implemented as a panel with Checkbox, ncsa.horizon.
awt.LabeledFields, Choices, and ncsa.horizon.awt.IntScrollPanels
to make LineSelection visible or invisible,
set LineSelection color, position, delta_x, delta_y,
and thickness. The panel will update its position,
width, height text field, and visibility CheckBox as
LineSelection changes position and becomes visible or invisible.
- See Also:
- CursorSettingPanel, ROISettingPanel
-
clLabel
- 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 ls's Color
-
delta_xField
- LabeledField to set and show ls's current position, width,
and height.
-
delta_yField
- LabeledField to set and show ls's current position, width,
and height.
-
ls
- The LineSelection to be controlled by this
LineSelectionSettingPanel.
-
lsMaster
- The component to which ls associated.
-
rpLabel
- Label with "ROI Postition and Size" string
-
showBox
- A Checkbox used to control and show ls's current visible state.
-
tkScroll
- An IntScrollPanel to control ls thickness
-
xField
- LabeledField to set and show ls's current position, width,
and height.
-
yField
- LabeledField to set and show ls's current position, width,
and height.
-
LineSelectionSettingPanel(LineSelection, Component)
- Create a LineSelectionSettingPanel.
-
action(Event, Object)
- Handle applet GUI actions.
-
getColorchoice()
- Get the Color from colorChoice's current value
-
getDelta_xfield()
- Get delta_xField value which is meant to be the LineSelection's x component.
-
getDelta_yfield()
- Get delta_yField value which is meant to be the LineSelection's y component.
-
getShowbox()
- Get the showBox's current state, it represents the visibility of
the LineSelection.
-
getXfield()
- Get xField value which is meant to be the x coordinate
of the LineSelection's start point.
-
getYfield()
- Get yField value which is meant to be the y coordinate
of the LineSelection's start point.
-
handleEvent(Event)
-
-
init()
-
-
layoutComponents()
-
-
layoutComponents(Container)
- Layout Components on Container parent.
-
setColorchoice(Color)
- Set a Color to colorChoice's current value
-
setDelta_xfield(int)
- Set delta_xField which is meant to be the LineSelection's
x component.
-
setDelta_yfield(int)
- Set delta_yField which is meant to be the LineSelection's
y component.
-
setFields(int, int, int, int)
- Set xField, yField, delta_xField, and delta_xField which are meant to be the
LineSelection's start point, x component, and y component.
-
setScroll(int)
- Set tkScroll to be LineSelection's thickness.
-
setShowbox(boolean)
- Set showBox to be true or false
-
setXfield(int)
- Set xField value which is meant to be the x coordinate
of the LineSelection's start point.
-
setYfield(int)
- Set yField value which is meant to be the y coordinate
of the LineSelection's start point.
-
toggleShowbox()
- toggle the showBow true, false state.
ls
protected LineSelection ls
- The LineSelection to be controlled by this
LineSelectionSettingPanel.
lsMaster
protected Component lsMaster
- The component to which ls associated.
showBox
protected Checkbox showBox
- A Checkbox used to control and show ls's current visible state.
rpLabel
protected Label rpLabel
- Label with "ROI Postition and Size" string
clLabel
protected Label clLabel
- Label with "Color" string
xField
protected LabeledField xField
- LabeledField to set and show ls's current position, width,
and height.
yField
protected LabeledField yField
- LabeledField to set and show ls's current position, width,
and height.
delta_xField
protected LabeledField delta_xField
- LabeledField to set and show ls's current position, width,
and height.
delta_yField
protected LabeledField delta_yField
- LabeledField to set and show ls's current position, width,
and height.
colorChoice
protected Choice colorChoice
- Choice to set ls's Color
colorArray
protected Color colorArray[]
- An array used to save colors which are corresponding to the color
name strings of colorChoice.
tkScroll
protected IntScrollPanel tkScroll
- An IntScrollPanel to control ls thickness
LineSelectionSettingPanel
public LineSelectionSettingPanel(LineSelection ls,
Component c)
- Create a LineSelectionSettingPanel.
- Parameters:
- cursor - The LineSelection to be controlled by
this LineSelectionSettingPanel.
- c - The Component to which the cursor is associated.
action
public boolean action(Event ev,
Object obj)
- Handle applet 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
- Returns:
- the current Color of colorChoice which is LineSelection's drawing color
getDelta_xfield
public int getDelta_xfield()
- Get delta_xField value which is meant to be the LineSelection's x component.
- Returns:
- current value of delta_xField
getDelta_yfield
public int getDelta_yfield()
- Get delta_yField value which is meant to be the LineSelection's y component.
- Returns:
- current value of delta_yField
getShowbox
public boolean getShowbox()
- Get the showBox's current state, it represents the visibility of
the LineSelection.
- Returns:
- true if the LineSelection is visible, false if the
LineSelection is hiden.
getXfield
public int getXfield()
- Get xField value which is meant to be the x coordinate
of the LineSelection's start point.
- Returns:
- current value of xField
getYfield
public int getYfield()
- Get yField value which is meant to be the y coordinate
of the LineSelection's start point.
- Returns:
- current value of yField
handleEvent
public boolean handleEvent(Event evt)
- Overrides:
- handleEvent in class Component
init
protected void init()
layoutComponents
public void layoutComponents()
layoutComponents
public void layoutComponents(Container parent)
- Layout Components on Container parent.
This is the implementation of LayoutRearrangeable
interface.
Components have been instantiated and to be layouted
here. They are: titleLabel, showBox, clLabel,
colorChoice, rpLabel, xField, delta_xField,
yField, delta_yField, and tkScroll.
- Parameters:
- parent - the Container on which Components
are layouted
Here is the source code of default layout.
public void layoutComponents(Container parent)
{
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 clLabel
gbc.gridwidth = GridBagConstraints.REMAINDER;
gbl.setConstraints(clLabel, gbc);
parent.add(clLabel);
//
// Layout colorChoice
gbc.gridwidth = GridBagConstraints.RELATIVE;
gbc.ipady = 10;
// emptyLabel is used to take some space, so that
// colorChoice would not cover rpLabel
Label emptyLabel = new Label(" ");
gbl.setConstraints(emptyLabel, gbc);
parent.add(emptyLabel);
gbc.ipady = 0;
gbc.gridwidth = GridBagConstraints.REMAINDER;
gbc.anchor = GridBagConstraints.NORTHEAST;
gbc.ipadx = 12;
gbl.setConstraints(colorChoice, gbc);
parent.add(colorChoice);
//
// Layout rpLabel
gbc.ipadx = 0;
gbc.anchor = GridBagConstraints.CENTER;
gbl.setConstraints(rpLabel, gbc);
parent.add(rpLabel);
//
// Layout xField
gbc.gridwidth = GridBagConstraints.RELATIVE;
gbl.setConstraints(xField, gbc);
parent.add(xField);
//
// Layout delta_xField
gbc.gridwidth = GridBagConstraints.REMAINDER;
gbl.setConstraints(delta_xField, gbc);
parent.add(delta_xField);
//
// Layout yField
gbc.gridwidth = GridBagConstraints.RELATIVE;
gbl.setConstraints(yField, gbc);
parent.add(yField);
//
// Layout delta_yField
gbc.gridwidth = GridBagConstraints.REMAINDER;
gbl.setConstraints(delta_yField, gbc);
parent.add(delta_yField);
//
// Layout tkScroll
gbc.ipady = 10;
gbl.setConstraints(tkScroll, gbc);
parent.add(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,
int dx,
int dy)
- Set xField, yField, delta_xField, and delta_xField which are meant to be the
LineSelection's start point, x component, and y component.
LineSelectionSettingPanel also call the LineSelection to update its
start point, x component, and y component
- Parameters:
- x - x coordinate of the LineSelection's start point with respect to
the left top of lsMaster
- y - y coordinate of the LineSelection's start point with respect to
the left top of lsMaster
- dx - the LineSelection's x component
- dy - the LineSelection's y component
setDelta_xfield
public void setDelta_xfield(int dx)
- Set delta_xField which is meant to be the LineSelection's
x component.
LineSelectionSettingPanel also call the LineSelection to update its
x component.
- Parameters:
- dx - the LineSelection's x component
setDelta_yfield
public void setDelta_yfield(int dy)
- Set delta_yField which is meant to be the LineSelection's
y component.
LineSelectionSettingPanel also call the LineSelection to update its
y component.
- Parameters:
- dy - the LineSelection's y component
setXfield
public void setXfield(int x)
- Set xField value which is meant to be the x coordinate
of the LineSelection's start point.
- Parameters:
- x - x coordinate of the LineSelection's start point 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 LineSelection's start point.
- Parameters:
- y - y coordinate of the LineSelection's start point with respect to
the left top of lsMaster
setScroll
public void setScroll(int t)
- Set tkScroll to be LineSelection's thickness.
- Parameters:
- 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