sgtplot
Interface AbstractPane
-
- All Known Implementing Classes:
- JGraphicLayout, JLineProfileLayout, JPane, JPlotLayout, JPlotPane, Pane
public interface AbstractPaneDefines the basic sgtplot Pane functionality.PaneandJPaneimplement theAbstractPaneinterface.
-
-
Field Summary
Fields Modifier and Type Field and Description static intBOTTOMAlign to bottom of printer page.static intCENTERAlign to center of printer page.static intDEFAULT_SCALEDefault scale for printing.static intLEFTAlign to left of printer page.static intMIDDLEAlign to middle of printer page.static intRIGHTAlign to right of printer page.static intSHRINK_TO_FITShrink to fit onto printer page.static intSPECIFIED_LOCATIONAlign to location specified on printer page.static intTO_FITFit onto printer page.static intTOPAlign to top of printer page.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description voidaddPropertyChangeListener(java.beans.PropertyChangeListener l)Add a PropertyChangeListener to the list.voiddraw()TheAbstractPaneand all of the attached Classes will be drawn.voiddraw(java.awt.Graphics g)TheAbstractPaneand all of the attached Classes will be drawn.voiddraw(java.awt.Graphics g, int width, int height)TheAbstractPaneand all of the attached Classes will be drawn.java.awt.RectanglegetBounds()Get the bounding rectangle in pixels (device units).java.awt.ComponentgetComponent()Get theComponentassociated with the pane.LayergetFirstLayer()Get the firstLayerassociated with thePanejava.lang.StringgetId()Get thePaneidentifier.LayergetLayer(java.lang.String id)Get theLayerassociated with thePaneindicated by the id.LayergetLayerFromDataId(java.lang.String id)Get theLayerassociated with thePaneindicated by the data id.java.lang.ObjectgetObjectAt(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.intgetPageHAlign()Get horizontal alignment for printing.java.awt.PointgetPageOrigin()Get the printer page origin.intgetPageScaleMode()Get printing scale mode.java.awt.DimensiongetPageSize()Get the printer page size.intgetPageVAlign()Get vertical alignment for printing.java.lang.ObjectgetSelectedObject()Return the last object selected.java.awt.RectanglegetZoomBounds()Return the device coordinates of the zoom action.java.awt.PointgetZoomStart()Return the device coordinates of the start of the zoom action.voidinit()This method is called when theAbstractPanefirst becomes visible.booleanisBatch()Is batching turned on?booleanisModified()Has the plot been modified?booleanisMouseEventsEnabled()AreMouseEvents enabled for processing by SGT?booleanisPrinter()Test if the currentGraphicsobject is a printer.voidremovePropertyChangeListener(java.beans.PropertyChangeListener l)Remove the PropertyChangeListener from the list.voidsetBatch(boolean batch)Turn on/off batching of updates to the pane.voidsetBatch(boolean batch, java.lang.String msg)Turn on/off batching of updates to the pane.voidsetId(java.lang.String id)Set thePaneidentifiervoidsetModified(boolean mod, java.lang.String mess)Notify the pane that something has changed and a redraw is required.voidsetMouseEventsEnabled(boolean enable)Enable/disable the handling ofMouseEvents by SGT.voidsetPageAlign(int vert, int horz)Set alignment for printing.voidsetPageHAlign(int horz)Set horizontal alignment for printing.voidsetPageOrigin(java.awt.Point p)Set the printer page origin.voidsetPageScaleMode(int mode)Set printing scale mode.voidsetPageVAlign(int vert)Set vertical alignment for printing.voidsetSelectedObject(java.lang.Object obj)Primarily used internally by sgtplot.
-
-
-
Field Detail
-
TOP
static final int TOP
Align to top of printer page.- See Also:
- Constant Field Values
-
MIDDLE
static final int MIDDLE
Align to middle of printer page.- See Also:
- Constant Field Values
-
BOTTOM
static final int BOTTOM
Align to bottom of printer page.- See Also:
- Constant Field Values
-
LEFT
static final int LEFT
Align to left of printer page.- See Also:
- Constant Field Values
-
CENTER
static final int CENTER
Align to center of printer page.- See Also:
- Constant Field Values
-
RIGHT
static final int RIGHT
Align to right of printer page.- See Also:
- Constant Field Values
-
SPECIFIED_LOCATION
static final int SPECIFIED_LOCATION
Align to location specified on printer page.- See Also:
- Constant Field Values
-
TO_FIT
static final int TO_FIT
Fit onto printer page. Magnify or shrink to fit onto printer page.- Since:
- 3.0
- See Also:
- Constant Field Values
-
DEFAULT_SCALE
static final int DEFAULT_SCALE
Default scale for printing. A value of 1.0 physical units = 72 pts.- Since:
- 3.0
- See Also:
- Constant Field Values
-
SHRINK_TO_FIT
static final int SHRINK_TO_FIT
Shrink to fit onto printer page. Will not magnify if graphic will already fit.- Since:
- 3.0
- See Also:
- Constant Field Values
-
-
Method Detail
-
draw
void draw()
TheAbstractPaneand 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
Layerthat has been added will be drawn in the order added, except if that order has been change using themoveLayerUp()ormoveLayerDown()methods.- See Also:
Graphics,Layer
-
draw
void draw(java.awt.Graphics g)
TheAbstractPaneand all of the attached Classes will be drawn. Drawing will occur using the suppliedGraphicsobject.- Parameters:
g- User suppliedGraphicsobject- See Also:
Graphics
-
draw
void draw(java.awt.Graphics g, int width, int height)TheAbstractPaneand all of the attached Classes will be drawn. Drawing will occur using the suppliedGraphicsobject. And clipping will be done to the width and height.- Parameters:
g- User suppliedGraphicsobjectwidth- clipping widthheight- clipping height- See Also:
Graphics
-
init
void init()
This method is called when theAbstractPanefirst becomes visible. The types of operations that should be implemented here include those that require a validGraphicsobject.
-
isPrinter
boolean isPrinter()
Test if the currentGraphicsobject is a printer.- Returns:
- true if a printer
-
getObjectsAt
java.lang.Object[] getObjectsAt(int x, int y)Return an array of objects whose bounds include x,y.- Since:
- 3.0
-
getObjectsAt
java.lang.Object[] getObjectsAt(java.awt.Point pt)
Return an array of objects whose bounds are at point pt.- Since:
- 3.0
-
getPageSize
java.awt.Dimension getPageSize()
Get the printer page size.- Returns:
- page size
-
getId
java.lang.String getId()
Get thePaneidentifier.- Returns:
Stringcontaining thePaneidentifier.
-
setId
void setId(java.lang.String id)
Set thePaneidentifier
-
setPageScaleMode
void setPageScaleMode(int mode)
Set printing scale mode. Allowable choices areTO_FIT,SHRINK_TO_FITandDEFAULT_SCALE. Default = DEFAULT_SCALE.- Parameters:
mode- print page scaling- Since:
- 3.0
- See Also:
DEFAULT_SCALE,TO_FIT,SHRINK_TO_FIT
-
setPageAlign
void setPageAlign(int vert, int horz)Set alignment for printing.
-
setPageVAlign
void setPageVAlign(int vert)
Set vertical alignment for printing. Allowed choices includeTOP,MIDDLE, andBOTTOMfor vert andLEFT,CENTER, andRIGHTfor horz. Either can beSPECIFIED_LOCATION.- Parameters:
vert- vertical alignment- See Also:
TOP,MIDDLE,BOTTOM,SPECIFIED_LOCATION
-
setPageHAlign
void setPageHAlign(int horz)
Set horizontal alignment for printing. Allowed choices includeTOP,MIDDLE, andBOTTOM.- Parameters:
horz- horizontal alignment- See Also:
LEFT,CENTER,RIGHT,SPECIFIED_LOCATION
-
getPageScaleMode
int getPageScaleMode()
Get printing scale mode.- Returns:
- AUTO_SCALE, TO_FIT, or SHRINK_TO_FIT
- Since:
- 3.0
- See Also:
DEFAULT_SCALE,TO_FIT,SHRINK_TO_FIT
-
getPageVAlign
int getPageVAlign()
Get vertical alignment for printing. Allowed choices includeLEFT,CENTER, andRIGHT.- Returns:
- vertical alignment
- See Also:
TOP,MIDDLE,BOTTOM,SPECIFIED_LOCATION
-
getPageHAlign
int getPageHAlign()
Get horizontal alignment for printing.- Returns:
- horizontal alignment
- See Also:
LEFT,CENTER,RIGHT,SPECIFIED_LOCATION
-
setPageOrigin
void setPageOrigin(java.awt.Point p)
Set the printer page origin. Valid for HAlign =SPECIFIED_LOCATIONor VAlign =SPECIFIED_LOCATION.
-
getPageOrigin
java.awt.Point getPageOrigin()
Get the printer page origin. Valid for HAlign =SPECIFIED_LOCATIONor VAlign =SPECIFIED_LOCATION.
-
getFirstLayer
Layer getFirstLayer()
Get the firstLayerassociated with thePane- Returns:
- the first
Layerobject
-
getLayer
Layer getLayer(java.lang.String id) throws LayerNotFoundException
Get theLayerassociated with thePaneindicated by the id.- Parameters:
id- identifier.- Throws:
LayerNotFoundException- TheLayerindicated by the id was not found.
-
getLayerFromDataId
Layer getLayerFromDataId(java.lang.String id) throws LayerNotFoundException
Get theLayerassociated with thePaneindicated by the data id.- Parameters:
id- data identifier- Throws:
LayerNotFoundException- TheLayerindicated by the id was not found.- See Also:
SGTData
-
getSelectedObject
java.lang.Object getSelectedObject()
Return the last object selected. Returns only objects that are part ofLayers currently connected to the pane.AbstractPanetests 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
void setSelectedObject(java.lang.Object obj)
Primarily used internally by sgtplot. This can also be used to mark an object as selected for use in an event handler.
-
getZoomBounds
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
-
getZoomStart
java.awt.Point getZoomStart()
Return the device coordinates of the start of the zoom action. ThePointis in device coordinates and may require transformation to physical units or user units. Zoom start may be useful to indicate which graph to zoom.- Returns:
- zoom start
- Since:
- 3.0
-
getObjectAt
java.lang.Object getObjectAt(int x, int y)Get the current selected object at a point. Used internally by sgtplot.
-
getBounds
java.awt.Rectangle getBounds()
Get the bounding rectangle in pixels (device units).- Returns:
- Rectangle object containing the bounding box for the pane.
-
getComponent
java.awt.Component getComponent()
Get theComponentassociated with the pane.
-
setBatch
void setBatch(boolean batch, java.lang.String msg)Turn on/off batching of updates to the pane. While batching istrueproperty 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
void setBatch(boolean batch)
Turn on/off batching of updates to the pane. While batching istrueproperty 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
boolean isBatch()
Is batching turned on?
-
setModified
void setModified(boolean mod, java.lang.String mess)Notify the pane that something has changed and a redraw is required. Used internally by sgtplot.
-
isModified
boolean isModified()
Has the plot been modified?
-
setMouseEventsEnabled
void setMouseEventsEnabled(boolean enable)
Enable/disable the handling ofMouseEvents by SGT. Disabling mouse events will turn off object selection, moveable, selectable, draggable, and zooming.- Since:
- 3.0
-
isMouseEventsEnabled
boolean isMouseEventsEnabled()
AreMouseEvents enabled for processing by SGT?- Since:
- 3.0
-
addPropertyChangeListener
void addPropertyChangeListener(java.beans.PropertyChangeListener l)
Add a PropertyChangeListener to the list. Properties forPaneandJPaneinclude "objectSelected" and "zoomRectangle".
-
removePropertyChangeListener
void removePropertyChangeListener(java.beans.PropertyChangeListener l)
Remove the PropertyChangeListener from the list.
-
-
DMelt 3.0 © DataMelt by jWork.ORG