gov.noaa.pmel.sgt
Interface AbstractPane

All Known Implementing Classes:
JPane, Pane

public interface AbstractPane

Defines the basic sgt Pane functionality. Pane and JPane implement the AbstractPane interface.

Since:
2.0
Version:
$Revision: 1.14 $, $Date: 2001/12/13 00:16:15 $
Author:
Donald Denbo
See Also:
Pane, JPane

Field Summary
static int BOTTOM
          Align to bottom of Page.
static int CENTER
          Align to center of Page.
static int LEFT
          Align to left of Page.
static int MIDDLE
          Align to middle of Page.
static int RIGHT
          Align to right of Page.
static int SPECIFIED_LOCATION
          Align to location specified.
static int TOP
          Align to top of Page.
 
Method Summary
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
          Add a PropertyChangeListener to the list.
 void draw()
          The AbstractPane and all of the attached Classes will be drawn.
 void draw(java.awt.Graphics g)
          The AbstractPane and all of the attached Classes will be drawn.
 void draw(java.awt.Graphics g, int width, int height)
          The AbstractPane and all of the attached Classes will be drawn.
 java.awt.Rectangle getBounds()
          Get the bounding rectangle in pixels (device units).
 java.awt.Component getComponent()
          Get the Component associated with the pane.
 Layer getFirstLayer()
          Get the first Layer associated with the Pane
 java.lang.String getId()
          Get the Pane identifier.
 Layer getLayer(java.lang.String id)
          Get the Layer associated with the Pane indicated by the id.
 Layer getLayerFromDataId(java.lang.String id)
          Get the Layer associated with the Pane indicated by the data id.
 java.lang.Object getObjectAt(int x, int y)
          Get the current selected object at a point.
 int getPageHAlign()
          Get horizontal alignment
 java.awt.Point getPageOrigin()
          Get the printer page origin.
 java.awt.Dimension getPageSize()
          Get the printer page size.
 int getPageVAlign()
          Get vertical alignment.
 java.lang.Object getSelectedObject()
          Return the last object selected.
 java.awt.Rectangle getZoomBounds()
          Return the device coordinates of the zoom action.
 void init()
          This method is called when the AbstractPane first becomes visible.
 boolean isBatch()
          Is batching turned on?
 boolean isModified()
          Has the plot been modified?
 boolean isPrinter()
          Test if the current Graphics object is a printer.
 void removePropertyChangeListener(java.beans.PropertyChangeListener l)
          Remove the PropertyChangeListener from the list.
 void setBatch(boolean batch)
          Turn on/off batching of updates to the pane.
 void setBatch(boolean batch, java.lang.String msg)
          Turn on/off batching of updates to the pane.
 void setId(java.lang.String id)
          Set the Pane identifier
 void setModified(boolean mod, java.lang.String mess)
          Notify the pane that something has changed and a redraw is required.
 void setPageAlign(int vert, int horz)
          Set alignment.
 void setPageHAlign(int horz)
          Set horizontal alignment.
 void setPageOrigin(java.awt.Point p)
          Set the printer page origin.
 void setPageVAlign(int vert)
          Set vertical alignment.
 void setSelectedObject(java.lang.Object obj)
          Primarily used internally by sgt.
 

Field Detail

TOP

public static final int TOP
Align to top of Page.

MIDDLE

public static final int MIDDLE
Align to middle of Page.

BOTTOM

public static final int BOTTOM
Align to bottom of Page.

LEFT

public static final int LEFT
Align to left of Page.

CENTER

public static final int CENTER
Align to center of Page.

RIGHT

public static final int RIGHT
Align to right of Page.

SPECIFIED_LOCATION

public static final int SPECIFIED_LOCATION
Align to location specified.
Method Detail

draw

public void draw()
The AbstractPane and all of the attached Classes will be drawn. Drawing will occur in an offscreen image and then copied to the screen. A new offscreen image is created on the first call to draw() or if the size of the pane has been changed. The offscreen image will be used as a "double" buffer when the screen requires redrawing.

Each Layer that has been added will be drawn in the order added, except if that order has been change using the moveLayerUp() or moveLayerDown() methods.

See Also:
Graphics, Layer

draw

public void draw(java.awt.Graphics g)
The AbstractPane and all of the attached Classes will be drawn. Drawing will occur using the supplied Graphics object.
Parameters:
g - User supplied Graphics object
See Also:
Graphics

draw

public void draw(java.awt.Graphics g,
                 int width,
                 int height)
The AbstractPane and all of the attached Classes will be drawn. Drawing will occur using the supplied Graphics object. And clipping will be done to the width and height.
Parameters:
g - User supplied Graphics object
width - clipping width
height - clipping height
See Also:
Graphics

init

public void init()
This method is called when the AbstractPane first becomes visible. The types of operations that should be implemented here include those that require a valid Graphics object.

isPrinter

public boolean isPrinter()
Test if the current Graphics object is a printer.
Returns:
true if a printer

getPageSize

public java.awt.Dimension getPageSize()
Get the printer page size.
Returns:
page size

getId

public java.lang.String getId()
Get the Pane identifier.
Returns:
String containing the Pane identifier.

setId

public void setId(java.lang.String id)
Set the Pane identifier

setPageAlign

public void setPageAlign(int vert,
                         int horz)
Set alignment.
Parameters:
vert - vertical alignment
horz - horizontal alignment

setPageVAlign

public void setPageVAlign(int vert)
Set vertical alignment. Allowed choices include TOP, MIDDLE, and BOTTOM for vert and LEFT, CENTER, and RIGHT for horz.
Parameters:
vert - vertical alignment
See Also:
TOP, MIDDLE, BOTTOM, LEFT, CENTER, RIGHT

setPageHAlign

public void setPageHAlign(int horz)
Set horizontal alignment. Allowed choices include TOP, MIDDLE, and BOTTOM.
Parameters:
horz - horizontal alignment
See Also:
TOP, MIDDLE, BOTTOM

getPageVAlign

public int getPageVAlign()
Get vertical alignment. Allowed choices include LEFT, CENTER, and RIGHT.
Returns:
vertical alignment
See Also:
LEFT, CENTER, RIGHT

getPageHAlign

public int getPageHAlign()
Get horizontal alignment
Returns:
horizontal alignment

setPageOrigin

public void setPageOrigin(java.awt.Point p)
Set the printer page origin.

getPageOrigin

public java.awt.Point getPageOrigin()
Get the printer page origin.

getFirstLayer

public Layer getFirstLayer()
Get the first Layer associated with the Pane
Returns:
the first Layer object

getLayer

public Layer getLayer(java.lang.String id)
               throws LayerNotFoundException
Get the Layer associated with the Pane indicated by the id.
Parameters:
id - identifier.
Throws:
LayerNotFoundException - The Layer indicated by the id was not found.

getLayerFromDataId

public Layer getLayerFromDataId(java.lang.String id)
                         throws LayerNotFoundException
Get the Layer associated with the Pane indicated by the data id.
Parameters:
id - data identifier
Throws:
LayerNotFoundException - The Layer indicated by the id was not found.
See Also:
SGTData

getSelectedObject

public java.lang.Object getSelectedObject()
Return the last object selected. Returns only objects that are part of Layers currently connected to the pane. AbstractPane tests each layer after a MOUSE_DOWN event for an object whose bounding box contains the mouse. The pane object then passes the event on to the next level.

setSelectedObject

public void setSelectedObject(java.lang.Object obj)
Primarily used internally by sgt. This can also be used to mark an object as selected for use in an event handler.

getZoomBounds

public java.awt.Rectangle getZoomBounds()
Return the device coordinates of the zoom action. The coordinates are in device units and may require transformation to the physical units or user units.
Returns:
zoom rectangle

getObjectAt

public java.lang.Object getObjectAt(int x,
                                    int y)
Get the current selected object at a point. Used internally by sgt.

getBounds

public java.awt.Rectangle getBounds()
Get the bounding rectangle in pixels (device units).
Returns:
Rectangle object containing the bounding box for the pane.

getComponent

public java.awt.Component getComponent()
Get the Component associated with the pane.

setBatch

public void setBatch(boolean batch,
                     java.lang.String msg)
Turn on/off batching of updates to the pane. While batching is true property change events will not cause pane to redraw. When batching is turned back on if the pane has been modified it will then redraw.

setBatch

public void setBatch(boolean batch)
Turn on/off batching of updates to the pane. While batching is true property change events will not cause pane to redraw. When batching is turned back on if the pane has been modified it will then redraw.

isBatch

public boolean isBatch()
Is batching turned on?

setModified

public void setModified(boolean mod,
                        java.lang.String mess)
Notify the pane that something has changed and a redraw is required. Used internally by sgt.

isModified

public boolean isModified()
Has the plot been modified?

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Add a PropertyChangeListener to the list. Properties for Pane and JPane include "objectSelected" and "zoomRectangle".

removePropertyChangeListener

public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Remove the PropertyChangeListener from the list.


Send comments about the Scientific Graphics toolkit to dwd@pmel.noaa.gov. For more information about Java Development in the EPIC Group see the EPIC Software Page
Generated on December 13 2001