|
SGT Home | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||
java.lang.Object
|
+--java.awt.Component
|
+--java.awt.Container
|
+--javax.swing.JComponent
|
+--javax.swing.JLayeredPane
|
+--gov.noaa.pmel.sgt.JPane
The JPane class is extended from
javax.swing.JLayeredPane
and is the basis for using the gov.noaa.pmel.sgt
package with swing components.
The Java scientific graphics toolkit is designed to allow a
graphics client developer a great deal of flexibility and freedom.
sgt is a package that greatly aids a developer in
creating graphics applets. sgt is not a general
purpose graphics package, but provides the tools to enable
scientific graphics to be easily incorporated into JApplet.
sgt has three main components, the "pane", on which
all graphics are drawn. The JPane is a fairly simple
class and all drawing is done in "device" coordinates (pixels).
By default, the JPane will draw on the screen, but it is
designed to allow drawing in an offscreen buffer that can be
printed (for applications).
The next component is the Layer. Several
Layers can be associated with a single
JPane. The Layer class insulates
the developer from the details of device coordinates by
using "physical" coordinates. Physical coordinates are
a right-hand coordinate systems with an origin of (0.0, 0.0) in the
lower-left-hand corner and have the same scale in both the vertical
and horizontal directions. Thus, a Layer that is
5.0 units wide and 3.0 units high can be made larger and smaller
on the screen by resizing the JPane, but will not be
distorted. The Layer class is responsible for
displaying labels, keys (color, vector, and line), and rulers.
A Layer can contain a single Graph.
Finally, the Graph component transforms from
user coordinates (e.g. cm/sec, time, degC, or meters) to
physical coordinates. The Graph
classes handle the display of axes and data. Children of
the Graph class are capable of creating Cartesian,
polar, and map graphics. For Cartesian graphs, several different
axes (log, plain and time), transforms (linear, log, and
tablelookup), and CartesianGraph (pixel,
line, vector, and contour) classes are available. These classes can be
combined in almost any combination.
While only one dataset may be plotted per Layer,
co-plotting is supported by allowing layers to use the same
transform objects. The order that the layers are plotted can
be changed, allowing the developer (or user) to control what
may be obscured.
Member functions, in package gov.noaa.pmel.sgt,
follow the following naming convention. Member functions that
have a P, U, or nothing at the end of the
function name are of type double in Physical
units, type double in User units, and type int in Device
units, respectively.
Variables that start with p, u, t, or d are coordinates of type physical,
user, time, or device, respectively.
All graphics are rendered when the draw() method is invoked.
Mouse Events
Mouse events are processed by the JPane object to support
object selection and zooming. Object selection is accomplished by
left clicking the mouse on the desired object. JPane
then fires a PropertyChangeEvent of type
"objectSelected" that can be listened for by the users application.
The user application then invokes the
getSelectedObject() method. Zooming is accomplished in
several steps.
1) Begin a zoom operation by pressing the left button.
2) Describe a zoom rectangle by dragging the mouse with the left
button down.
3) Finish the zoom operation by releasing the left mouse button.
When the mouse button has been release JPane fires a
PropertyChangeEvent of type "zoomRectangle" that can
be listened for by the users application. The user application can
then obtain the zoom rectangle by invoking the
getZoomBounds() method.
...
//
// register the PropertyChangeListener listener with pane
// (assuming that application implements PropertyChangeListener)
//
mainPane_.addPropertyChangeListener(this);
//
...
//
// Implement the propertyChange() method and listen for events
//
public void propertyChange(PropertyChangeEvent event) {
//
// Listen for property change events from JPane
//
String name = event.getPropertyName();
if(name.equals("zoomRectangle")) {
//
// compute zoom rectangle in user units
//
Range2D xr = new Range2D();
Range2D yr = new Range2D();
Rectangle zm = (Rectangle)event.getNewValue();
//
// if rectangle size is one pixel or less return
//
if(zm.width <= 1 || zm.height <= 1) return;
xr.start = graph_.getXPtoU(layer_.getXDtoP(zm.x));
xr.end = graph_.getXPtoU(layer_.getXDtoP(zm.x + zm.width));
if(xr.start > xr.end) {
double temp = xr.start;
xr.start = xr.end;
xr.end = temp;
}
yr.start = graph_.getYPtoU(layer_.getYDtoP(zm.y));
yr.end = graph_.getYPtoU(layer_.getYDtoP(zm.y + zm.height));
if(yr.start > yr.end) {
double temp = yr.start;
yr.start = yr.end;
yr.end = temp;
}
//
// turn batching on so all changes will appear at the
// same time
//
mainPane_.setBatch(true);
//
// set range for transforms
//
xt_.setRangeU(xr);
yt_.setRangeU(yr);
//
// set range and origin for axes
//
Point2D.Double orig = new Point2D.Double(xr.start, yr.start);
xbot_.setRangeU(xr);
xbot_.setLocationU(orig);
yleft_.setRangeU(yr);
yleft_.setLocationU(orig);
//
// set clipping on all graphs
//
Component[] comps = mainPane_.getComponents();
Layer ly;
for(int i=0; i < comps.length; i++) {
if(comps[i] instanceof Layer) {
ly = (Layer)comps[i];
((CartesianGraph)ly.getGraph()).setClip(xr.start, xr.end,
yr.start, yr.end);
}
}
//
// done with sgt modifications, turn batching off
//
mainPane_.setBatch(false);
} else if(name.equals("objectSelected")) {
//
// An sgt object has been selected.
// If it is a PointCartesianRenderer that means the key has been
// selected and so open a dialog to modified the PointAttribute.
//
if(event.getNewValue() instanceof PointCartesianRenderer) {
PointAttribute pattr =
((PointCartesianRenderer)event.getNewValue()).getPointAttribute();
if(pAttrDialog_ == null) {
pAttrDialog_ = new PointAttributeDialog();
}
pAttrDialog_.setPointAttribute(pattr, mainPane_);
pAttrDialog_.setVisible(true);
} else {
//
// Print the name of the object selected.
//
System.out.println("objectSelected = " + event.getNewValue());
}
}
}
Layer,
Graph,
Graphics,
Serialized Form| Field Summary |
| Fields inherited from class javax.swing.JLayeredPane |
DEFAULT_LAYER, DRAG_LAYER, FRAME_CONTENT_LAYER, LAYER_PROPERTY, MODAL_LAYER, PALETTE_LAYER, POPUP_LAYER |
| Fields inherited from class javax.swing.JComponent |
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface gov.noaa.pmel.sgt.AbstractPane |
BOTTOM, CENTER, DEFAULT_SCALE, LEFT, MIDDLE, RIGHT, SHRINK_TO_FIT, SPECIFIED_LOCATION, TO_FIT, TOP |
| Fields inherited from interface java.awt.print.Printable |
NO_SUCH_PAGE, PAGE_EXISTS |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
JPane()
Default constructor. |
|
JPane(java.lang.String id,
java.awt.Dimension size)
Constructs a Pane. |
|
| Method Summary | |
java.awt.Component |
add(java.awt.Component comp)
Adds the specified component to the end of the Pane. |
java.awt.Component |
add(java.awt.Component comp,
int index)
Adds the specified component to the Pane at the
given position. |
void |
add(java.awt.Component comp,
java.lang.Object constraints)
Adds the specified component to the end of this Pane. |
void |
add(java.awt.Component comp,
java.lang.Object constraints,
int index)
Adds the specified component to the end of this Pane
at the specified index. |
java.awt.Component |
add(java.lang.String name,
java.awt.Component comp)
Adds the specified component to this Pane. |
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. |
void |
drawPage(java.awt.Graphics g,
java.awt.print.PageFormat pf,
boolean scale)
|
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.awt.Dimension |
getMaximumSize()
|
java.awt.Dimension |
getMinimumSize()
|
java.lang.Object |
getObjectAt(int x,
int y)
Get the current selected object at a point. |
java.lang.Object[] |
getObjectsAt(int x,
int y)
Return an array of objects whose bounds include x,y. |
java.lang.Object[] |
getObjectsAt(java.awt.Point pt)
Return an array of objects whose bounds are at point pt. |
int |
getPageHAlign()
Get horizontal alignment for printing. |
java.awt.Point |
getPageOrigin()
Get the printer page origin. |
int |
getPageScaleMode()
Get printing scale mode. |
java.awt.Dimension |
getPageSize()
Get the printer page size. |
int |
getPageVAlign()
Get vertical alignment for printing. |
java.awt.Dimension |
getPreferredScrollableViewportSize()
|
java.awt.Dimension |
getPreferredSize()
|
int |
getScrollableBlockIncrement(java.awt.Rectangle visibleRect,
int orientation,
int direction)
|
boolean |
getScrollableTracksViewportHeight()
|
boolean |
getScrollableTracksViewportWidth()
|
int |
getScrollableUnitIncrement(java.awt.Rectangle visibleRect,
int orientation,
int direction)
|
java.lang.Object |
getSelectedObject()
Return the last object selected. |
static StrokeDrawer |
getStrokeDrawer()
Internal method to access jdk1.1 or Java2D line drawing. |
static java.lang.String |
getVersion()
Return the version of SGT. |
java.awt.Rectangle |
getZoomBounds()
Get the current zoom bounding box. |
java.awt.Point |
getZoomStart()
Return the device coordinates of the start of the zoom action. |
void |
init()
No initialization required. |
boolean |
isBatch()
Is batching turned on? |
boolean |
isModified()
Has the plot been modified? |
boolean |
isMouseEventsEnabled()
Are MouseEvents enabled for processing by SGT? |
boolean |
isPrinter()
Test if the current Graphics object is a printer. |
void |
moveLayerDown(Layer lyr)
Move the Layer down in the stack. |
void |
moveLayerDown(java.lang.String id)
Move the Layer down in the stack. |
void |
moveLayerUp(Layer lyr)
Move the Layer up in the stack. |
void |
moveLayerUp(java.lang.String id)
Move the Layer up in the stack. |
void |
paintComponent(java.awt.Graphics g)
Override default painting by swing. |
int |
print(java.awt.Graphics g,
java.awt.print.PageFormat pf,
int pageIndex)
|
void |
processMouseEvent(java.awt.event.MouseEvent event)
Overrides the default event methods. |
void |
processMouseMotionEvent(java.awt.event.MouseEvent event)
Used internally by sgt. |
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 |
setMouseEventsEnabled(boolean enable)
Enable/disable the handling of MouseEvents by
SGT. |
void |
setPageAlign(int vert,
int horz)
Set alignment for printing. |
void |
setPageHAlign(int horz)
Set horizontal alignment for printing. |
void |
setPageOrigin(java.awt.Point p)
Set the printer page origin. |
void |
setPageScaleMode(int mode)
Set printing scale mode. |
void |
setPageVAlign(int vert)
Set vertical alignment for printing. |
void |
setScrollableBlockIncrement(int horiz,
int vert)
Set the horizontal and vertical block increments. |
void |
setScrollableUnitIncrement(int horiz,
int vert)
Set the horizontal and vertical unit increments. |
void |
setSelectedObject(java.lang.Object obj)
Primarily used internally by sgt. |
void |
setSize(java.awt.Dimension d)
Set the size. |
java.lang.String |
toString()
Get a String representatinof the
Pane. |
| Methods inherited from class javax.swing.JLayeredPane |
getAccessibleContext, getComponentCountInLayer, getComponentsInLayer, getIndexOf, getLayer, getLayer, getLayeredPaneAbove, getPosition, highestLayer, isOptimizedDrawingEnabled, lowestLayer, moveToBack, moveToFront, paint, putLayer, remove, setLayer, setLayer, setPosition |
| Methods inherited from class javax.swing.JComponent |
addAncestorListener, addNotify, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getNextFocusableComponent, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI |
| Methods inherited from class java.awt.Container |
addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, show, show, size, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface gov.noaa.pmel.sgt.AbstractPane |
getBounds |
| Constructor Detail |
public JPane(java.lang.String id,
java.awt.Dimension size)
Pane.
id - the Pane identifiersize - the size of the Pane in pixelspublic JPane()
import gov.noaa.pmel.sgt.JPane;
...
JPane pane;
...
pane = new JPane("main graph", new Dimension(400, 500));
pane.setLayout(new StackedLayout());
...
StackedLayout| Method Detail |
public static java.lang.String getVersion()
public void draw()
AbstractPaneAbstractPane 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.
draw in interface AbstractPaneGraphics,
Layerpublic void init()
init in interface AbstractPanepublic void draw(java.awt.Graphics g)
AbstractPaneAbstractPane and all of the attached Classes
will be drawn. Drawing will occur using the supplied
Graphics object.
draw in interface AbstractPaneg - User supplied Graphics objectGraphics
public void draw(java.awt.Graphics g,
int width,
int height)
AbstractPaneAbstractPane 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.
draw in interface AbstractPaneg - User supplied Graphics objectwidth - clipping widthheight - clipping heightGraphicspublic boolean isPrinter()
AbstractPaneGraphics object is a printer.
isPrinter in interface AbstractPanepublic static StrokeDrawer getStrokeDrawer()
public java.awt.Dimension getPageSize()
AbstractPane
getPageSize in interface AbstractPanepublic void paintComponent(java.awt.Graphics g)
paintComponent in class javax.swing.JComponentpublic java.awt.Component add(java.awt.Component comp)
Pane.
add in class java.awt.Containercomp - the component to be added
public java.awt.Component add(java.awt.Component comp,
int index)
Pane at the
given position.
add in class java.awt.Containercomp - the component to be addedindex - the position at which to insert the component, or -1
to insert the component at the end.
public void add(java.awt.Component comp,
java.lang.Object constraints)
Pane.
Also notifies the layout manager to add the component to this
Pane's layout using the specified constraints object.
add in class java.awt.Containercomp - the component to be addedconstraints - an object expressing layout constraints for
this component
public void add(java.awt.Component comp,
java.lang.Object constraints,
int index)
Pane
at the specified index.
Also notifies the layout manager to add the component to this
Pane's layout using the specified constraints object.
add in class java.awt.Containercomp - the component to be addedconstraints - an object expressing layout constraints for
this componentindex - the position in the Pane's list at which to
insert the component -1 means insert at the end.
public java.awt.Component add(java.lang.String name,
java.awt.Component comp)
Pane. It
is strongly advised to use add(Component, Object), in place
of this method.
add in class java.awt.Containerpublic java.lang.String getId()
AbstractPanePane identifier.
getId in interface AbstractPaneString containing the Pane identifier.public void setId(java.lang.String id)
AbstractPanePane identifier
setId in interface AbstractPane
public void setPageAlign(int vert,
int horz)
AbstractPane
setPageAlign in interface AbstractPanevert - vertical alignmenthorz - horizontal alignmentAbstractPane.TOP,
AbstractPane.MIDDLE,
AbstractPane.BOTTOM,
AbstractPane.LEFT,
AbstractPane.CENTER,
AbstractPane.RIGHT,
AbstractPane.SPECIFIED_LOCATIONpublic void setPageVAlign(int vert)
AbstractPaneTOP,
MIDDLE, and BOTTOM for vert and
LEFT, CENTER, and RIGHT
for horz. Either can be SPECIFIED_LOCATION.
setPageVAlign in interface AbstractPanevert - vertical alignmentAbstractPane.TOP,
AbstractPane.MIDDLE,
AbstractPane.BOTTOM,
AbstractPane.SPECIFIED_LOCATIONpublic void setPageHAlign(int horz)
AbstractPaneTOP,
MIDDLE, and BOTTOM.
setPageHAlign in interface AbstractPanehorz - horizontal alignmentAbstractPane.LEFT,
AbstractPane.CENTER,
AbstractPane.RIGHT,
AbstractPane.SPECIFIED_LOCATIONpublic int getPageVAlign()
AbstractPaneLEFT, CENTER, and RIGHT.
getPageVAlign in interface AbstractPaneAbstractPane.TOP,
AbstractPane.MIDDLE,
AbstractPane.BOTTOM,
AbstractPane.SPECIFIED_LOCATIONpublic int getPageHAlign()
AbstractPane
getPageHAlign in interface AbstractPaneAbstractPane.LEFT,
AbstractPane.CENTER,
AbstractPane.RIGHT,
AbstractPane.SPECIFIED_LOCATIONpublic void setPageOrigin(java.awt.Point p)
AbstractPaneSPECIFIED_LOCATION or
VAlign = SPECIFIED_LOCATION.
setPageOrigin in interface AbstractPanepublic java.awt.Point getPageOrigin()
AbstractPaneSPECIFIED_LOCATION or
VAlign = SPECIFIED_LOCATION.
getPageOrigin in interface AbstractPanepublic void setSize(java.awt.Dimension d)
setSize in class java.awt.Componentpublic Layer getFirstLayer()
AbstractPaneLayer associated with the Pane
getFirstLayer in interface AbstractPaneLayer object
public Layer getLayer(java.lang.String id)
throws LayerNotFoundException
AbstractPaneLayer associated with the
Pane indicated by the id.
getLayer in interface AbstractPaneid - identifier.
LayerNotFoundException - The Layer indicated by the id was not found.
public Layer getLayerFromDataId(java.lang.String id)
throws LayerNotFoundException
AbstractPaneLayer associated with the
Pane indicated by the data id.
getLayerFromDataId in interface AbstractPaneid - data identifier
LayerNotFoundException - The Layer indicated by the id was not found.SGTData
public void moveLayerUp(Layer lyr)
throws LayerNotFoundException
Layer up in the stack.
The order of the layers determine when they
are drawn. Moving the Layer up causes the
Layer to be drawn later and over earlier
layers.
lyr - Layer object.
LayerNotFoundException - The specified Layer was not found in the list.Layer
public void moveLayerUp(java.lang.String id)
throws LayerNotFoundException
Layer up in the stack.
The order of the layers determine when they
are drawn. Moving the Layer up causes the
Layer to be drawn later and over earlier
layers.
id - identifier.
LayerNotFoundException - The specified Layer was not found in the list.Layer
public void moveLayerDown(Layer lyr)
throws LayerNotFoundException
Layer down in the stack.
The order of the layers determine when they
are drawn. Moving the Layer down causes the
Layer to be drawn earlier.
lyr - Layer object.
LayerNotFoundException - The specified Layer was not found in the list.Layer
public void moveLayerDown(java.lang.String id)
throws LayerNotFoundException
Layer down in the stack.
The order of the layers determine when they
are drawn. Moving the Layer down causes the
Layer to be drawn earlier.
id - identifier
LayerNotFoundException - The specified Layer was not found in the list.Layerpublic java.lang.Object getSelectedObject()
AbstractPaneLayers 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.
getSelectedObject in interface AbstractPanepublic void setSelectedObject(java.lang.Object obj)
AbstractPane
setSelectedObject in interface AbstractPanepublic void processMouseEvent(java.awt.event.MouseEvent event)
processMouseEvent in class java.awt.Componentpublic void processMouseMotionEvent(java.awt.event.MouseEvent event)
processMouseMotionEvent in class javax.swing.JComponentpublic java.awt.Rectangle getZoomBounds()
getZoomBounds in interface AbstractPanepublic java.awt.Point getZoomStart()
AbstractPanePoint
is in device coordinates and may require transformation to physical units
or user units. Zoom start may be useful to indicate which graph to zoom.
getZoomStart in interface AbstractPane
public java.lang.Object getObjectAt(int x,
int y)
AbstractPane
getObjectAt in interface AbstractPane
public java.lang.Object[] getObjectsAt(int x,
int y)
AbstractPane
getObjectsAt in interface AbstractPanepublic java.lang.Object[] getObjectsAt(java.awt.Point pt)
AbstractPane
getObjectsAt in interface AbstractPanepublic java.awt.Component getComponent()
AbstractPaneComponent associated with
the pane.
getComponent in interface AbstractPanepublic java.awt.Dimension getMaximumSize()
getMaximumSize in class javax.swing.JComponentpublic java.awt.Dimension getMinimumSize()
getMinimumSize in class javax.swing.JComponentpublic java.awt.Dimension getPreferredSize()
getPreferredSize in class javax.swing.JComponentpublic java.lang.String toString()
String representatinof the
Pane.
toString in class java.awt.ComponentString representation
public void setBatch(boolean batch,
java.lang.String msg)
AbstractPanetrue 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 in interface AbstractPanepublic void setBatch(boolean batch)
AbstractPanetrue 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 in interface AbstractPanepublic boolean isBatch()
AbstractPane
isBatch in interface AbstractPane
public void setModified(boolean mod,
java.lang.String mess)
AbstractPane
setModified in interface AbstractPanepublic boolean isModified()
AbstractPane
isModified in interface AbstractPanepublic void setMouseEventsEnabled(boolean enable)
AbstractPaneMouseEvents by
SGT. Disabling mouse events will turn off object selection,
moveable, selectable, draggable, and zooming.
setMouseEventsEnabled in interface AbstractPanepublic boolean isMouseEventsEnabled()
AbstractPaneMouseEvents enabled for processing by SGT?
isMouseEventsEnabled in interface AbstractPane
public void setScrollableBlockIncrement(int horiz,
int vert)
public int getScrollableBlockIncrement(java.awt.Rectangle visibleRect,
int orientation,
int direction)
getScrollableBlockIncrement in interface javax.swing.Scrollable
public void setScrollableUnitIncrement(int horiz,
int vert)
public int getScrollableUnitIncrement(java.awt.Rectangle visibleRect,
int orientation,
int direction)
getScrollableUnitIncrement in interface javax.swing.Scrollablepublic java.awt.Dimension getPreferredScrollableViewportSize()
getPreferredScrollableViewportSize in interface javax.swing.Scrollablepublic boolean getScrollableTracksViewportHeight()
getScrollableTracksViewportHeight in interface javax.swing.Scrollablepublic boolean getScrollableTracksViewportWidth()
getScrollableTracksViewportWidth in interface javax.swing.Scrollable
public int print(java.awt.Graphics g,
java.awt.print.PageFormat pf,
int pageIndex)
print in interface java.awt.print.Printablepublic void setPageScaleMode(int mode)
AbstractPaneTO_FIT,
SHRINK_TO_FIT and
DEFAULT_SCALE. Default = DEFAULT_SCALE.
setPageScaleMode in interface AbstractPanemode - print page scalingAbstractPane.DEFAULT_SCALE,
AbstractPane.TO_FIT,
AbstractPane.SHRINK_TO_FITpublic int getPageScaleMode()
AbstractPane
getPageScaleMode in interface AbstractPaneAbstractPane.DEFAULT_SCALE,
AbstractPane.TO_FIT,
AbstractPane.SHRINK_TO_FIT
public void drawPage(java.awt.Graphics g,
java.awt.print.PageFormat pf,
boolean scale)
public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
AbstractPanePane and JPane include
"objectSelected" and "zoomRectangle".
addPropertyChangeListener in interface AbstractPaneaddPropertyChangeListener in class javax.swing.JComponentpublic void removePropertyChangeListener(java.beans.PropertyChangeListener l)
AbstractPane
removePropertyChangeListener in interface AbstractPaneremovePropertyChangeListener in class javax.swing.JComponent
|
SGT Home | |||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||||