Class ncsa.horizon.control.ZoomControl
All Packages Class Hierarchy This Package Previous Next Index
Class ncsa.horizon.control.ZoomControl
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Panel
|
+----ncsa.horizon.control.ZoomControl
- public class ZoomControl
- extends Panel
- implements LayoutRearrangeable
ZoomControl is a control panel. It provides graphical interfaces
for user to set zoom parameters and to send control commands
to a SelectionViewer.
-
customZm
- The TextField for user to
type in custom zooming factor and
show the current zooming factor.
-
title
- The title Label with "Zoom Control" string
-
unZoomOverPointButton
- The button labeled "unZoom" which is below
"Zoom over selected Point" Label.
This button triggers a unzoom-over-point action when pressed.
-
zoomBackButton
- The "Zoom Back" Button
-
zoomOverPointButton
- The button with "Zoom" string which is below
"Zoom over selected Point" Label in the default layout.
This button triggers a zoom-over-point action when pressed.
-
zpChoice
- The Choice for choose
Zoom over selected Point factor
-
zpLabel
- The label with "Zoom over selected Point" string
-
ztbButton
- The "Zoom to Box" button
-
ZoomControl()
-
-
ZoomControl(SelectionViewer)
-
-
action(Event, Object)
-
-
getCurrentZoom()
- get currentZoom factor over selected point.
-
layoutComponents()
-
-
layoutComponents(Container)
- layout those components to Container parent:
title, zpLabel, zoomOverPointButton, unZoomOverPointButton,
zpChoice, ztbButton, zoomBackButton
-
setCurrentZoom(double)
- set currentZoom factor over selected point.
-
unzoomOverPoint()
- Zoom out with current zooming factor with reference to
the selected pixel.
-
zoomBack()
- Zoom back.
-
zoomOverPoint()
- Zoom in with current zooming factor with reference to
the selected pixel.
-
zoomOverPoint(double)
- Zoom in with given number factor with reference to
the selected pixel.
-
zoomToBox()
- zoom in to fit the selected box.
title
protected Label title
- The title Label with "Zoom Control" string
zpLabel
protected Label zpLabel
- The label with "Zoom over selected Point" string
zoomOverPointButton
protected Button zoomOverPointButton
- The button with "Zoom" string which is below
"Zoom over selected Point" Label in the default layout.
This button triggers a zoom-over-point action when pressed.
unZoomOverPointButton
protected Button unZoomOverPointButton
- The button labeled "unZoom" which is below
"Zoom over selected Point" Label.
This button triggers a unzoom-over-point action when pressed.
"unzoom" means zoom with reversed zoom factor. The zoom factor
is shown in the customZm TextField.
- See Also:
- customZm
zpChoice
protected Choice zpChoice
- The Choice for choose
Zoom over selected Point factor
customZm
protected TextField customZm
- The TextField for user to
type in custom zooming factor and
show the current zooming factor.
ztbButton
protected Button ztbButton
- The "Zoom to Box" button
zoomBackButton
protected Button zoomBackButton
- The "Zoom Back" Button
ZoomControl
public ZoomControl()
ZoomControl
public ZoomControl(SelectionViewer viewer)
action
public boolean action(Event evt,
Object obj)
- Overrides:
- action in class Component
getCurrentZoom
public double getCurrentZoom()
- get currentZoom factor over selected point.
- Returns:
- current zooming factor over selected point.
layoutComponents
public void layoutComponents()
layoutComponents
public void layoutComponents(Container parent)
- layout those components to Container parent:
title, zpLabel, zoomOverPointButton, unZoomOverPointButton,
zpChoice, ztbButton, zoomBackButton
- Parameters:
- parent - Container above components are layouted
here is the source code of default layout. User can modify
it to get what he/she want.
public void layoutComponents(Container parent)
{
GridBagLayout bag = new GridBagLayout();
GridBagConstraints c = new GridBagConstraints();
parent.setLayout(bag);
//
// layout title
c.gridwidth = GridBagConstraints.REMAINDER;
bag.setConstraints(title, c);
parent.add(title);
//
// layout the horizontal Separator
Separator separator = new Separator();
c.fill = GridBagConstraints.HORIZONTAL;
bag.setConstraints(separator, c);
parent.add(separator);
//
// layout zpLabel
c.fill = GridBagConstraints.NONE;
bag.setConstraints(zpLabel, c);
parent.add(zpLabel);
//
// layout zoomOverPointButton
c.gridwidth = GridBagConstraints.RELATIVE;
bag.setConstraints(zoomOverPointButton, c);
parent.add(zoomOverPointButton);
//
// layout unZoomOverPointButton
c.gridwidth = GridBagConstraints.REMAINDER;
bag.setConstraints(unZoomOverPointButton, c);
parent.add(unZoomOverPointButton);
//
// layout zpChoice
c.gridwidth = GridBagConstraints.RELATIVE;
c.anchor = GridBagConstraints.EAST;
bag.setConstraints(zpChoice, c);
parent.add(zpChoice);
//
// layout customZm
c.gridwidth = GridBagConstraints.REMAINDER;
c.anchor = GridBagConstraints.CENTER;
bag.setConstraints(customZm, c);
parent.add(customZm);
//
// layout next horizontal Separator
c.anchor = GridBagConstraints.CENTER;
c.weightx = 550;
c.weighty = 550;
Separator separator1 = new Separator();
c.fill = GridBagConstraints.HORIZONTAL;
bag.setConstraints(separator1, c);
parent.add(separator1);
//
// layout ztbButton
c.fill = GridBagConstraints.NONE;
bag.setConstraints(ztbButton, c);
parent.add(ztbButton);
//
// layout next horizontal Separator
Separator separator2 = new Separator();
c.fill = GridBagConstraints.HORIZONTAL;
bag.setConstraints(separator2, c);
parent.add(separator2);
//
// layout zoomBackButton
c.fill = GridBagConstraints.NONE;
bag.setConstraints(zoomBackButton, c);
parent.add(zoomBackButton);
}
setCurrentZoom
public void setCurrentZoom(double zoom)
- set currentZoom factor over selected point.
- Returns:
- current zooming factor over selected point.
unzoomOverPoint
public void unzoomOverPoint()
- Zoom out with current zooming factor with reference to
the selected pixel.
zoomBack
public void zoomBack()
- Zoom back. The display will return to the state
just before last zooming action.
zoomOverPoint
public void zoomOverPoint()
- Zoom in with current zooming factor with reference to
the selected pixel.
zoomOverPoint
public void zoomOverPoint(double zm)
- Zoom in with given number factor with reference to
the selected pixel.
zoomToBox
public void zoomToBox()
- zoom in to fit the selected box.
All Packages Class Hierarchy This Package Previous Next Index