org.rosuda.ibase.toolkit
Class BaseCanvas

java.lang.Object
  extended by org.rosuda.ibase.toolkit.PlotComponent
      extended by org.rosuda.ibase.toolkit.PGSCanvas
          extended by org.rosuda.ibase.toolkit.BaseCanvas
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.print.Printable, java.util.EventListener, Commander, Dependent
Direct Known Subclasses:
BarCanvas, CustomCanvas, HamCanvas, HistCanvas, KapMeCanvas, MapCanvas, MosaicCanvas, ParallelAxesCanvas, ScatterCanvas

public class BaseCanvas
extends PGSCanvas
implements Dependent, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.KeyListener, java.awt.event.ActionListener

BaseCanvas - basis for all interactive plots which rely on plot primitives concept. To ensure consistent behavior all plots should be based on this class whenever possible. BaseCanvas includes key and mouse handling, selection and queries.

Although BaseCanvas is not abstract, is it not usable on its own (except maybe for testing). Any subclasses should override at least the updateObjects() method to initialize plot primitives. Displaying and selection of following plot primitives is supported out-of-the-box: points, rectangles and polygons. The subclass constructor should (beside calling super constructor) set any of the control flags to customize the behavior of this class.

BaseCanvas implements all key and mouse listeners as well as commander interface (actions are mapped into commands). This implies that a subclass it free to overload any individual methods of those. Just make sure that you provide calls to parent methods to preserve all functionality.

Version:
$Id: BaseCanvas.java 3473 2013-05-22 14:16:00Z urbanek $

Nested Class Summary
 
Nested classes/interfaces inherited from class org.rosuda.ibase.toolkit.PGSCanvas
PGSCanvas.IDlgCL
 
Field Summary
protected  boolean allow180
          if set to false then rotating is allowed only between orientation values 0 and 1 (ergo rotation over 180 degrees is not allowed)
protected  boolean allowDragMove
          if set to true then move-dragging is allowed.
protected  boolean allowDragZoom
          if set to true then zoom-dragging is allowed.
protected  boolean allowZoom
          if set to true then zoom is allowed
protected  boolean alphaHighlighting
          if set to true alpha will be applied to highlighting, too
 boolean autoAdjustMargins
          if set to true then the margins can be adjusted automatically
protected  boolean baseDrag
          run-time flag is set to true if baseDragging is in process
protected  int baseDragX1
           
protected  int baseDragX2
           
protected  int baseDragY1
           
protected  int baseDragY2
           
 java.awt.Color borderColor
           
 java.awt.Color borderColorSel
           
protected static java.lang.String C_BLACK
           
protected  int changingHilitingNeedsUpdateRoot
           
 java.awt.Color COL_INVALID
           
 java.awt.Color COL_OUTLINE
           
 java.awt.Color COL_SELBG
           
 java.awt.Color COL_ZOOMBG
           
protected  int defaultMBottom
           
protected  int defaultMBottom1
           
protected  int defaultMBottom2
           
protected  int defaultMBottom3
           
protected  int defaultMLeft
           
protected  int defaultMLeft1
           
protected  int defaultMLeft2
           
protected  int defaultMLeft3
           
protected  int defaultMRight
           
protected  int defaultMRight1
           
protected  int defaultMRight2
           
protected  int defaultMRight3
           
protected  int defaultMTop
           
protected  int defaultMTop1
           
protected  int defaultMTop2
           
protected  int defaultMTop3
           
protected  boolean dontCache
          by default BaseCanvas caches layers whenever possible, that is only paintInit(org.rosuda.pograss.PoGraSS) is guaranteed to be run before paintBack(org.rosuda.pograss.PoGraSS), paintObjects(org.rosuda.pograss.PoGraSS) and paintSelected(org.rosuda.pograss.PoGraSS).
protected  boolean dontPaint
          prevents painting (and thus calling updateObjects) until set to false.
 java.awt.Color fillColor
           
 java.awt.Color fillColorSel
           
protected  boolean fillInside
          if set to true plot primitives are filled.
protected  int H
           
 int horizontalMedDist
           
 int horizontalMinDist
           
protected  boolean ignoreNotifications
          if set to true all notifications are rejected.
protected  boolean inQuery
          run-time flag is set to true if query mode is on - (currently it means that is held down)
protected  boolean inZoom
          run-time flag is set to true if zoom mode is on
protected  boolean isExtQuery
          if set to true extended query is used
protected  int lastQueriedIndex
           
protected  PlotPrimitive lastQueriedPrimitive
           
protected  SMarker m
          marker of the plot.
protected static java.lang.String M_ALPHADOWN
           
protected static java.lang.String M_ALPHAUP
           
protected static java.lang.String M_RESETZOOM
           
protected static java.lang.String M_SETCB1
           
protected static java.lang.String M_SETCB64
           
protected static java.lang.String M_TRANSHIGHL
           
protected  int mBottom
          plot area margins.
protected  java.awt.MenuItem MItransHighl
           
protected  int mLeft
          plot area margins.
protected  int mouseX
           
protected  int mouseY
           
protected  boolean moveDrag
          run-time flag is set to true if the current baseDrag is a move
protected  int mRight
          plot area margins.
protected  int mTop
          plot area margins.
protected  boolean objectClipping
          if set to true don't paint objects outside the margins defined by mLeft etc.
protected  Axis[] opAx
          arrays of additional axes that are updated upon resize. can be null
protected  Axis[] opAy
           
protected  int orientation
          orientation of the plot.
protected  boolean paintOutline
          if set to true outline of plot primitives is painted (applies to default paint handler. subclasses of BaseCanvas don't have to respect this flag if may display more complex primitives)
protected  java.awt.PopupMenu pop
           
protected  PlotPrimitive[] pp
          plot primitives which form the basis for data display and selection
protected  float ppAlpha
           
protected  float ppAlphaH
          alpha value for hilited primitives; is only used when seperateAlphas is true
protected  QueryPopup qi
          query popup window
protected  java.util.List queryables
          List of objects that respond to queries not including those contained in pp.
protected  boolean resizeOnRotate
          if set to true then rotating the canvas also results in flipped size geometry of the canvas.
 boolean rotateYLabels
           
 double rotateYLabelsBy
           
protected  boolean selDrag
          run-time flag is set to true if the current baseDrag is a selection
protected  boolean selectedPaintOutline
          same functionality as paintOutline but applies to selected objects only
protected  boolean seperateAlphas
          if set to true hilited and normal primitives can have different alphas
protected  boolean showOnlyHilited
          if set to true only hilighted primitives will be shown
protected  boolean showQuery
           
protected  boolean updateGeometry
          if set to true then next repaint will force update of geometry, that is it will behave as if the canvas size was changed resulting in updated axes and objects.
 int verticalMedDist
           
 int verticalMinDist
           
protected  int W
           
protected  PlotTextVector xLabels
          PlotText object containing labels.
protected  PlotTextVector yLabels
           
protected  boolean zoomDrag
          run-time flag is set to true if the current baseDrag is a zoom
protected  boolean zoomRetainsAspect
          if set to true then zooming-in always retians the aspect ratio (at least default zoom handling via axes does.
protected  java.util.List zoomSequence
          this list can be used to track the sequence of zooms.
 
Fields inherited from class org.rosuda.ibase.toolkit.PGSCanvas
ax, ay, cancel, desc, inProgress, intDlg, myFrame, pageFormat, paintLayerCounter, pm
 
Fields inherited from class org.rosuda.ibase.toolkit.PlotComponent
AWTGrDevID, GrDevID, JOGLGrDevID, layers, SWINGGrDevID
 
Fields inherited from interface java.awt.print.Printable
NO_SUCH_PAGE, PAGE_EXISTS
 
Constructor Summary
BaseCanvas(int gd, java.awt.Frame f, SMarker mark)
          basic constructor.
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void addXLabels(PoGraSS g, Axis axis, java.lang.String[] names, int[] maxWidths, int[] positions, boolean ticks, boolean abbreviate)
           
 void addXLabels(PoGraSS g, Axis axis, java.lang.String[] names, int[] maxWidths, int[] positions, boolean ticks, boolean abbreviate, boolean top)
           
 void addXLabels(PoGraSS g, Axis axis, java.lang.String[] names, int maxWidth, int[] positions, boolean ticks, boolean abbreviate)
           
 void addXLabels(PoGraSS g, Axis axis, java.lang.String[] names, int maxWidth, int[] positions, boolean ticks, boolean abbreviate, boolean top)
           
 void addYLabels(PoGraSS g, Axis axis, boolean ticks, boolean abbreviate)
           
 void addYLabels(PoGraSS g, Axis axis, java.lang.String[] names, int[] maxH, int[] positions, boolean ticks, boolean abbreviate)
           
 void addYLabels(PoGraSS g, Axis axis, SVar sVar, boolean ticks, boolean abbreviate)
           
 boolean adjustMargin(PoGraSS g)
          Possibly adjust mLeft etc.
protected  void createMenu(java.awt.Frame f, boolean rotate, boolean zoom, boolean transparency, boolean activeCB, java.lang.String[] view)
           
 void dispose()
           
protected  void endAddingLabels()
           
protected  java.lang.String getAxisQuery(int x, int y)
           
 Axis getAxisX()
           
 Axis getAxisY()
           
 double[] getBoundValues()
           
protected  int getDefaultMLeft()
           
protected  PlotPrimitive getFirstPrimitiveContaining(int x, int y)
          Determine the first plot primitive containing the given point.
 int getMBottom()
           
 java.awt.Dimension getMinimumSize()
           
 int getMLeft()
           
 int getMRight()
           
 int getMTop()
           
protected  PlotPrimitive[] getPrimitivesContaining(int x, int y)
          Determine the plot primitives containing the given point.
protected  PlotPrimitive[] getPrimitivesIntersecting(java.awt.Rectangle rec)
          Determine the plot primitives intersecting the given rectangle.
 boolean isShowLabels()
           
 void keyPressed(java.awt.event.KeyEvent e)
           
 void keyReleased(java.awt.event.KeyEvent e)
           
 void keyTyped(java.awt.event.KeyEvent e)
           
 void mouseClicked(java.awt.event.MouseEvent ev)
           
 void mouseDragged(java.awt.event.MouseEvent e)
           
 void mouseEntered(java.awt.event.MouseEvent e)
           
 void mouseExited(java.awt.event.MouseEvent e)
           
 void mouseMoved(java.awt.event.MouseEvent ev)
           
 void mousePressed(java.awt.event.MouseEvent ev)
           
 void mouseReleased(java.awt.event.MouseEvent e)
           
 void Notifying(NotifyMsg msg, java.lang.Object o, java.util.Vector path)
          notification handler - rebuild objects if necessary (AxisDataChange/VarChange) and repaint
 void paintBack(PoGraSS g)
           
 void paintInit(PoGraSS g)
           
 void paintObjects(PoGraSS g)
           
 void paintPoGraSS(PoGraSS g)
          actual paint method - subclasses should NOT override this method!
 void paintPost(PoGraSS g)
           
 void paintSelected(PoGraSS g)
           
 void performZoomIn(int x1, int y1, int x2, int y2)
           
 void performZoomIn(int x1, int y1, int x2, int y2, Axis xAx, Axis xAy)
           
 void performZoomOut(int x, int y)
           
 java.lang.String queryObject(int i)
           
 java.lang.String queryObject(PlotPrimitive p)
           
 java.lang.String queryPlotSpace()
           
 void resetZoom()
           
 void rotate()
           
 void rotate(int amount)
           
 java.lang.Object run(java.lang.Object o, java.lang.String cmd)
          default handing of commands "exportPGS" and "exportPS".
protected  void setAxDefaultGeometry()
           
protected  void setAyDefaultGeometry()
           
protected  void setColors(PPrimBase ppb)
           
 void setDefaultMargins(int[] margins)
          sets the default margins. order: left, right, top, bottom
 void setExtQueryString(java.lang.String str)
          needed for setting manually extended query string
 void setMBottom(int mBottom)
           
 void setMLeft(int mLeft)
           
 void setMRight(int mRight)
           
 void setMTop(int mTop)
           
 void setQueryText(java.lang.String s)
           
 void setQueryText(java.lang.String s, int cid)
           
 void setQueryText(java.lang.String s, int[] cid)
           
 void setShowLabels(boolean showLabels)
           
protected  void startAddingLabels()
           
 void updateObjects()
          rebuilds plot primitives - subclasses should override this method.
 void useExtQuery(boolean b)
           
 
Methods inherited from class org.rosuda.ibase.toolkit.PGSCanvas
beginPaint, endPaint, finalize, forcedFlush, getData, getFrame, getGlobalNotifier, getPlotManager, getTitle, getXAxis, getYAxis, nextLayer, paintLayer, print, setFrame, setOption, setOption, setOption, setOption, setOption, setOption, setTitle
 
Methods inherited from class org.rosuda.ibase.toolkit.PlotComponent
addKeyListener, addMouseListener, addMouseMotionListener, getBounds, getComponent, getHeight, getLocation, getParent, getSize, getWidth, newQueryPopup, newQueryPopup, paintLayer, repaint, setBackground, setCursor, setSize, setSize, setToolTipText, setUpdateRoot
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

COL_OUTLINE

public java.awt.Color COL_OUTLINE

COL_INVALID

public java.awt.Color COL_INVALID

COL_SELBG

public java.awt.Color COL_SELBG

COL_ZOOMBG

public java.awt.Color COL_ZOOMBG

C_BLACK

protected static final java.lang.String C_BLACK
See Also:
Constant Field Values

M_RESETZOOM

protected static final java.lang.String M_RESETZOOM
See Also:
Constant Field Values

M_TRANSHIGHL

protected static final java.lang.String M_TRANSHIGHL
See Also:
Constant Field Values

M_ALPHADOWN

protected static final java.lang.String M_ALPHADOWN
See Also:
Constant Field Values

M_ALPHAUP

protected static final java.lang.String M_ALPHAUP
See Also:
Constant Field Values

M_SETCB1

protected static final java.lang.String M_SETCB1
See Also:
Constant Field Values

M_SETCB64

protected static final java.lang.String M_SETCB64
See Also:
Constant Field Values

fillColor

public java.awt.Color fillColor

borderColor

public java.awt.Color borderColor

fillColorSel

public java.awt.Color fillColorSel

borderColorSel

public java.awt.Color borderColorSel

qi

protected QueryPopup qi
query popup window


pp

protected PlotPrimitive[] pp
plot primitives which form the basis for data display and selection


queryables

protected java.util.List queryables
List of objects that respond to queries not including those contained in pp. Should contain only objects which implement the interface Queryable.


dontCache

protected boolean dontCache
by default BaseCanvas caches layers whenever possible, that is only paintInit(org.rosuda.pograss.PoGraSS) is guaranteed to be run before paintBack(org.rosuda.pograss.PoGraSS), paintObjects(org.rosuda.pograss.PoGraSS) and paintSelected(org.rosuda.pograss.PoGraSS). This implies that none of the later three can rely on anything happening in the preceeding paint methods. This is not the usual behavior of PoGraSS. Setting this dontCache flag to true will enforce the defined PoGraSS behavior which means that all paint.. parts are called in the specified order, no matter which layer is being updated.


m

protected SMarker m
marker of the plot. This marker is used for linked highlighting.


autoAdjustMargins

public boolean autoAdjustMargins
if set to true then the margins can be adjusted automatically


mLeft

protected int mLeft
plot area margins. Axes are set in a way to always respect those margins. They default to 0 for BaseCanvas.


mRight

protected int mRight
plot area margins. Axes are set in a way to always respect those margins. They default to 0 for BaseCanvas.


mTop

protected int mTop
plot area margins. Axes are set in a way to always respect those margins. They default to 0 for BaseCanvas.


mBottom

protected int mBottom
plot area margins. Axes are set in a way to always respect those margins. They default to 0 for BaseCanvas.


orientation

protected int orientation
orientation of the plot. Value between 0 and 3. Increasing orientation results in plot rotating by 90 degrees clock-wise.


resizeOnRotate

protected boolean resizeOnRotate
if set to true then rotating the canvas also results in flipped size geometry of the canvas.


allow180

protected boolean allow180
if set to false then rotating is allowed only between orientation values 0 and 1 (ergo rotation over 180 degrees is not allowed)


allowZoom

protected boolean allowZoom
if set to true then zoom is allowed


allowDragZoom

protected boolean allowDragZoom
if set to true then zoom-dragging is allowed. Otherwise stepwise zoom by clicing is the only available zoom method.


zoomRetainsAspect

protected boolean zoomRetainsAspect
if set to true then zooming-in always retians the aspect ratio (at least default zoom handling via axes does. If you implement a subclass providing its own zooming features you should honor this flag where applicable)


allowDragMove

protected boolean allowDragMove
if set to true then move-dragging is allowed.


baseDrag

protected boolean baseDrag
run-time flag is set to true if baseDragging is in process


selDrag

protected boolean selDrag
run-time flag is set to true if the current baseDrag is a selection


zoomDrag

protected boolean zoomDrag
run-time flag is set to true if the current baseDrag is a zoom


moveDrag

protected boolean moveDrag
run-time flag is set to true if the current baseDrag is a move


inQuery

protected boolean inQuery
run-time flag is set to true if query mode is on - (currently it means that is held down)


inZoom

protected boolean inZoom
run-time flag is set to true if zoom mode is on


showOnlyHilited

protected boolean showOnlyHilited
if set to true only hilighted primitives will be shown


ignoreNotifications

protected boolean ignoreNotifications
if set to true all notifications are rejected. Any subclass is free to use it, BaseCanvas modifies this flag in default zoom processing methods to prevent partial updates when ax and ay are updated sequentially. Any method changing this flag should always restore the state of the flag after it finishes! Also use with care in multi-threaded applications to prevent deadlocks.


zoomSequence

protected java.util.List zoomSequence
this list can be used to track the sequence of zooms. Zoom out should return to the state before last zoom in (if sensible in the context of the given plot). Any implementation of performZoomIn(int, int, int, int) and performZoomOut(int, int) is free to use this list in any way which suits the implementation.

The current default implementation uses pairs of ZoomDescriptorComponent objects to store status of PGSCanvas.ax and PGSCanvas.ay axes. The list is automatically initilized to an empty list by the base constructor.


W

protected int W

H

protected int H

baseDragX1

protected int baseDragX1

baseDragX2

protected int baseDragX2

baseDragY1

protected int baseDragY1

baseDragY2

protected int baseDragY2

paintOutline

protected boolean paintOutline
if set to true outline of plot primitives is painted (applies to default paint handler. subclasses of BaseCanvas don't have to respect this flag if may display more complex primitives)


selectedPaintOutline

protected boolean selectedPaintOutline
same functionality as paintOutline but applies to selected objects only


fillInside

protected boolean fillInside
if set to true plot primitives are filled.


dontPaint

protected boolean dontPaint
prevents painting (and thus calling updateObjects) until set to false.


updateGeometry

protected boolean updateGeometry
if set to true then next repaint will force update of geometry, that is it will behave as if the canvas size was changed resulting in updated axes and objects. paintPoGraSS(org.rosuda.pograss.PoGraSS) resets this flag to false after calling updateObjects() and setting everything up.


objectClipping

protected boolean objectClipping
if set to true don't paint objects outside the margins defined by mLeft etc.


alphaHighlighting

protected boolean alphaHighlighting
if set to true alpha will be applied to highlighting, too


seperateAlphas

protected boolean seperateAlphas
if set to true hilited and normal primitives can have different alphas


ppAlpha

protected float ppAlpha

ppAlphaH

protected float ppAlphaH
alpha value for hilited primitives; is only used when seperateAlphas is true


opAx

protected Axis[] opAx
arrays of additional axes that are updated upon resize. can be null


opAy

protected Axis[] opAy

xLabels

protected PlotTextVector xLabels
PlotText object containing labels. Can be null.


yLabels

protected PlotTextVector yLabels

isExtQuery

protected boolean isExtQuery
if set to true extended query is used


MItransHighl

protected java.awt.MenuItem MItransHighl

pop

protected java.awt.PopupMenu pop

mouseX

protected int mouseX

mouseY

protected int mouseY

lastQueriedPrimitive

protected PlotPrimitive lastQueriedPrimitive

lastQueriedIndex

protected int lastQueriedIndex

defaultMLeft

protected int defaultMLeft

defaultMRight

protected int defaultMRight

defaultMTop

protected int defaultMTop

defaultMBottom

protected int defaultMBottom

defaultMLeft1

protected int defaultMLeft1

defaultMRight1

protected int defaultMRight1

defaultMTop1

protected int defaultMTop1

defaultMBottom1

protected int defaultMBottom1

defaultMLeft2

protected int defaultMLeft2

defaultMRight2

protected int defaultMRight2

defaultMTop2

protected int defaultMTop2

defaultMBottom2

protected int defaultMBottom2

defaultMLeft3

protected int defaultMLeft3

defaultMRight3

protected int defaultMRight3

defaultMTop3

protected int defaultMTop3

defaultMBottom3

protected int defaultMBottom3

horizontalMedDist

public int horizontalMedDist

horizontalMinDist

public int horizontalMinDist

verticalMedDist

public int verticalMedDist

verticalMinDist

public int verticalMinDist

rotateYLabels

public boolean rotateYLabels

rotateYLabelsBy

public double rotateYLabelsBy

changingHilitingNeedsUpdateRoot

protected int changingHilitingNeedsUpdateRoot

showQuery

protected boolean showQuery
Constructor Detail

BaseCanvas

public BaseCanvas(int gd,
                  java.awt.Frame f,
                  SMarker mark)
basic constructor. Every subclass must call this constructor

Parameters:
f - frame owning this canvas. since BaseCanvas itself doesn't modify any attribute of the frame except for title it is possible to put more canvases into one frame. This doesn't have to hold for subclasses, especially those providing their own menus.
mark - marker which will be used for selection/linked highlighting
Method Detail

Notifying

public void Notifying(NotifyMsg msg,
                      java.lang.Object o,
                      java.util.Vector path)
notification handler - rebuild objects if necessary (AxisDataChange/VarChange) and repaint

Specified by:
Notifying in interface Dependent
Overrides:
Notifying in class PGSCanvas
o - Object that sent the notification. The actual content is implementation-dependent.
path - This parameter is null for non-cascaded notify - in that case further calls to NotifyAll are not allowed. Otherwise it contains a Vector with all objects notified so far during cascaded notify. To aviod cyclic notifications every instance must either reject cascaded notifications (i.e. no calls to NotifyAll at all) or check for occurence of itself in the chain before calling NotifyAll. The only valid recursive calls in Notifying are NotifyAll(path) and NotifyAll(..,path), because only these two pass the "path" parameter to avoid cyclic loops.

dispose

public void dispose()
Overrides:
dispose in class PGSCanvas

updateObjects

public void updateObjects()
rebuilds plot primitives - subclasses should override this method. It is not defined as abstract only for convenience, but minimal subclass simply overrides this method.


getMinimumSize

public java.awt.Dimension getMinimumSize()

getAxisX

public Axis getAxisX()

getAxisY

public Axis getAxisY()

paintPoGraSS

public void paintPoGraSS(PoGraSS g)
actual paint method - subclasses should NOT override this method! use paintInit/Back/Objects/Selected/Post instead. Splitting into pieces allows more effective layer caching and results in better performance

Overrides:
paintPoGraSS in class PGSCanvas

paintInit

public void paintInit(PoGraSS g)

paintBack

public void paintBack(PoGraSS g)

paintObjects

public void paintObjects(PoGraSS g)

paintSelected

public void paintSelected(PoGraSS g)

paintPost

public void paintPost(PoGraSS g)

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent ev)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

queryObject

public java.lang.String queryObject(int i)

queryObject

public java.lang.String queryObject(PlotPrimitive p)

queryPlotSpace

public java.lang.String queryPlotSpace()

rotate

public void rotate(int amount)

rotate

public void rotate()

performZoomIn

public void performZoomIn(int x1,
                          int y1,
                          int x2,
                          int y2)

performZoomIn

public void performZoomIn(int x1,
                          int y1,
                          int x2,
                          int y2,
                          Axis xAx,
                          Axis xAy)

performZoomOut

public void performZoomOut(int x,
                           int y)

resetZoom

public void resetZoom()

mousePressed

public void mousePressed(java.awt.event.MouseEvent ev)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent ev)
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener

getAxisQuery

protected java.lang.String getAxisQuery(int x,
                                        int y)

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Specified by:
keyTyped in interface java.awt.event.KeyListener

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Specified by:
keyReleased in interface java.awt.event.KeyListener

run

public java.lang.Object run(java.lang.Object o,
                            java.lang.String cmd)
Description copied from class: PGSCanvas
default handing of commands "exportPGS" and "exportPS". Any descendant should call super.run(o,cmd) to retain this functionality

Specified by:
run in interface Commander
Overrides:
run in class PGSCanvas
Parameters:
o - origin of the command
cmd - command string
Returns:
any object, the actual interpretation is up to the calling object

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener

setQueryText

public void setQueryText(java.lang.String s)

setQueryText

public void setQueryText(java.lang.String s,
                         int cid)

setQueryText

public void setQueryText(java.lang.String s,
                         int[] cid)

isShowLabels

public boolean isShowLabels()

setShowLabels

public void setShowLabels(boolean showLabels)

getPrimitivesContaining

protected PlotPrimitive[] getPrimitivesContaining(int x,
                                                  int y)
Determine the plot primitives containing the given point. Can be overridden to achieve better performance.

Returns:
Array of matching primitives.

getFirstPrimitiveContaining

protected PlotPrimitive getFirstPrimitiveContaining(int x,
                                                    int y)
Determine the first plot primitive containing the given point. Can be overridden to achieve better performance.

Returns:
The matching primitive or null if point doesn't belong to any primitive.

getPrimitivesIntersecting

protected PlotPrimitive[] getPrimitivesIntersecting(java.awt.Rectangle rec)
Determine the plot primitives intersecting the given rectangle. Can be overridden to achieve better performance.

Returns:
Array of intersecting primitives.

getBoundValues

public double[] getBoundValues()
Returns:
min and max values (first=min,second=max)

adjustMargin

public boolean adjustMargin(PoGraSS g)
Possibly adjust mLeft etc.

Returns:
Returns true if margins have been changed

createMenu

protected void createMenu(java.awt.Frame f,
                          boolean rotate,
                          boolean zoom,
                          boolean transparency,
                          boolean activeCB,
                          java.lang.String[] view)

setExtQueryString

public void setExtQueryString(java.lang.String str)
needed for setting manually extended query string


useExtQuery

public void useExtQuery(boolean b)

setDefaultMargins

public void setDefaultMargins(int[] margins)
sets the default margins. order: left, right, top, bottom


addXLabels

public void addXLabels(PoGraSS g,
                       Axis axis,
                       java.lang.String[] names,
                       int maxWidth,
                       int[] positions,
                       boolean ticks,
                       boolean abbreviate)

addXLabels

public void addXLabels(PoGraSS g,
                       Axis axis,
                       java.lang.String[] names,
                       int maxWidth,
                       int[] positions,
                       boolean ticks,
                       boolean abbreviate,
                       boolean top)

addXLabels

public void addXLabels(PoGraSS g,
                       Axis axis,
                       java.lang.String[] names,
                       int[] maxWidths,
                       int[] positions,
                       boolean ticks,
                       boolean abbreviate)

addXLabels

public void addXLabels(PoGraSS g,
                       Axis axis,
                       java.lang.String[] names,
                       int[] maxWidths,
                       int[] positions,
                       boolean ticks,
                       boolean abbreviate,
                       boolean top)

addYLabels

public void addYLabels(PoGraSS g,
                       Axis axis,
                       boolean ticks,
                       boolean abbreviate)

addYLabels

public void addYLabels(PoGraSS g,
                       Axis axis,
                       SVar sVar,
                       boolean ticks,
                       boolean abbreviate)

addYLabels

public void addYLabels(PoGraSS g,
                       Axis axis,
                       java.lang.String[] names,
                       int[] maxH,
                       int[] positions,
                       boolean ticks,
                       boolean abbreviate)

getMBottom

public int getMBottom()

setMBottom

public void setMBottom(int mBottom)

getMLeft

public int getMLeft()

setMLeft

public void setMLeft(int mLeft)

getMRight

public int getMRight()

setMRight

public void setMRight(int mRight)

getMTop

public int getMTop()

setMTop

public void setMTop(int mTop)

setColors

protected void setColors(PPrimBase ppb)

endAddingLabels

protected void endAddingLabels()

startAddingLabels

protected void startAddingLabels()

getDefaultMLeft

protected int getDefaultMLeft()

setAyDefaultGeometry

protected void setAyDefaultGeometry()

setAxDefaultGeometry

protected void setAxDefaultGeometry()