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.

Variable Index

 o customZm
The TextField for user to type in custom zooming factor and show the current zooming factor.
 o title
The title Label with "Zoom Control" string
 o unZoomOverPointButton
The button labeled "unZoom" which is below "Zoom over selected Point" Label.
This button triggers a unzoom-over-point action when pressed.
 o zoomBackButton
The "Zoom Back" Button
 o 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.
 o zpChoice
The Choice for choose Zoom over selected Point factor
 o zpLabel
The label with "Zoom over selected Point" string
 o ztbButton
The "Zoom to Box" button

Constructor Index

 o ZoomControl()
 o ZoomControl(SelectionViewer)

Method Index

 o action(Event, Object)
 o getCurrentZoom()
get currentZoom factor over selected point.
 o layoutComponents()
 o layoutComponents(Container)
layout those components to Container parent: title, zpLabel, zoomOverPointButton, unZoomOverPointButton, zpChoice, ztbButton, zoomBackButton
 o setCurrentZoom(double)
set currentZoom factor over selected point.
 o unzoomOverPoint()
Zoom out with current zooming factor with reference to the selected pixel.
 o zoomBack()
Zoom back.
 o zoomOverPoint()
Zoom in with current zooming factor with reference to the selected pixel.
 o zoomOverPoint(double)
Zoom in with given number factor with reference to the selected pixel.
 o zoomToBox()
zoom in to fit the selected box.

Variables

 o title
  protected Label title
The title Label with "Zoom Control" string
 o zpLabel
  protected Label zpLabel
The label with "Zoom over selected Point" string
 o 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.
 o 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
 o zpChoice
  protected Choice zpChoice
The Choice for choose Zoom over selected Point factor
 o customZm
  protected TextField customZm
The TextField for user to type in custom zooming factor and show the current zooming factor.
 o ztbButton
  protected Button ztbButton
The "Zoom to Box" button
 o zoomBackButton
  protected Button zoomBackButton
The "Zoom Back" Button

Constructors

 o ZoomControl
  public ZoomControl()
 o ZoomControl
  public ZoomControl(SelectionViewer viewer)

Methods

 o action
  public boolean action(Event evt,
                        Object obj)
Overrides:
action in class Component
 o getCurrentZoom
  public double getCurrentZoom()
get currentZoom factor over selected point.
Returns:
current zooming factor over selected point.
 o layoutComponents
  public void layoutComponents()
 o 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);
 }
 o setCurrentZoom
  public void setCurrentZoom(double zoom)
set currentZoom factor over selected point.
Returns:
current zooming factor over selected point.
 o unzoomOverPoint
  public void unzoomOverPoint()
Zoom out with current zooming factor with reference to the selected pixel.
 o zoomBack
  public void zoomBack()
Zoom back. The display will return to the state just before last zooming action.
 o zoomOverPoint
  public void zoomOverPoint()
Zoom in with current zooming factor with reference to the selected pixel.
 o zoomOverPoint
  public void zoomOverPoint(double zm)
Zoom in with given number factor with reference to the selected pixel.
 o zoomToBox
  public void zoomToBox()
zoom in to fit the selected box.

All Packages  Class Hierarchy  This Package  Previous  Next  Index