|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjsynoptic.builtin.PlotZoom
public class PlotZoom
This class performs the additional drawing required to perform some zooms on one or several selected plots Zoom box - Its location and size are defined thanks to mouse events received through the ContextualDrawing interface.When zoom defintion is over, on button 2 release, the rectangle coordinates are used to compute the zoom aplied to the selected plots. If there is one plot selected then the zoom concerns all the axes (even the secondary axes if thy exist). If there is more than a plot selected, the zoom is restricted to the axis with intersection with the zoom rectangle. In that case only one axis is changed but it is done on all the selected plots. - A red dashed rectangle is drawn. Zoom wheel - Its location and direction of rotation are defined thanks to mouse events received through the ContextualDrawing interface. Zoom wheel is performed on the selected plot that contains mouse position. Zoom whell concerns all the axes (even the secondary axes if thy exist). Translation * - The translation vector is defined thanks to mouse events received through the ContextualDrawing interface. The translation concerns all the axes and all the selected plots.
Field Summary | |
---|---|
protected static java.awt.BasicStroke |
dashStroke
on ZOOM_BOX, a stroke used to display the zoom rectangle |
protected boolean |
firstTranslation
on TRANSLATION: During draging operation, , several translation are performed, but a unique event is stored into undo operation stack. |
protected int |
kindOfZoom
Kind of zoom |
protected Plot |
plot1
the plot on which the zoom definition starts |
protected static int |
TRANSLATION
|
protected int |
x1
Zoom coordinates |
protected int |
x2
Zoom coordinates |
protected int |
y1
Zoom coordinates |
protected int |
y2
Zoom coordinates |
protected static int |
ZOOM_BOX
|
protected static int |
ZOOM_WHEEL
|
protected java.awt.Rectangle |
zoomArea
on ZOOM_BOX, the zoom area shape |
protected static java.awt.Color |
zoomColor
on ZOOM_BOX, the zoom area line color |
protected static double |
zoomWheelFactor
on TRANSLATION: Zoom wheel factor |
Constructor Summary | |
---|---|
PlotZoom(DiagramSelection sel)
Creates a new PlotZoom for the current selection |
Method Summary | |
---|---|
void |
abort()
Abort the zoom |
boolean |
consumeKeyEvent(java.awt.event.KeyEvent e)
During this specific context, the key events can be consumed and thus nt handled as in normal mode |
boolean |
consumeMouseEvent(java.awt.event.MouseEvent e)
During this specific context, the mouse events can be consumed and thus nt handled as in normal mode |
protected void |
displayCrossLocation(int x,
int y)
Display the plot coordinates for this point |
void |
drag(int x,
int y)
Extends the zoom area according to dragged mouse location |
void |
draw(java.awt.Graphics2D g2,
java.awt.Point pMax)
Do the additional drawing |
protected Plot |
getSelectedPlot(double x,
double y)
Get the first plot part of selection which contains this point |
void |
press(int x,
int y)
Start the zoom at the mouse pressed location |
void |
release(int x,
int y)
When the mouse is released, do the zoom according to zoom area definition |
void |
selectionChanged(DiagramSelection sel)
The selection calls each listener when the selection changes |
void |
translate()
When the mouse is released, do the translation according to the vector (x1,y1) (x2,y2) |
protected void |
wheel(int x,
int y,
boolean zoomIn)
make a zoom wheel |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected int kindOfZoom
protected static final int ZOOM_BOX
protected static final int ZOOM_WHEEL
protected static final int TRANSLATION
protected int x1
protected int y1
protected int x2
protected int y2
protected Plot plot1
protected static final double zoomWheelFactor
protected static java.awt.Color zoomColor
protected static java.awt.BasicStroke dashStroke
protected java.awt.Rectangle zoomArea
protected boolean firstTranslation
Constructor Detail |
---|
public PlotZoom(DiagramSelection sel)
sel
- the selection to zoomMethod Detail |
---|
public boolean consumeKeyEvent(java.awt.event.KeyEvent e)
DiagramComponent.ContextualDrawing
consumeKeyEvent
in interface DiagramComponent.ContextualDrawing
e
- the key event
public boolean consumeMouseEvent(java.awt.event.MouseEvent e)
DiagramComponent.ContextualDrawing
consumeMouseEvent
in interface DiagramComponent.ContextualDrawing
e
- the mouse event (including motion events)
protected void wheel(int x, int y, boolean zoomIn)
x
- y
- zoomIn
- public void abort()
public void press(int x, int y)
x
- mouse location X coordinatey
- mouse location Y coordinatepublic void drag(int x, int y)
x
- mouse location X coordinatey
- mouse location Y coordinatepublic void release(int x, int y)
x
- mouse location X coordinatey
- mouse location Y coordinatepublic void translate()
x
- mouse location X coordinatey
- mouse location Y coordinateprotected Plot getSelectedPlot(double x, double y)
x
- X coordinate location wrt diagram framey
- Y coordinate location wrt diagram frame
protected void displayCrossLocation(int x, int y)
x
- X coordinate location wrt diagram framey
- Y coordinate location wrt diagram framepublic void draw(java.awt.Graphics2D g2, java.awt.Point pMax)
DiagramComponent.ContextualDrawing
draw
in interface DiagramComponent.ContextualDrawing
g2
- the current graphicpMax
- the max point to compute diagram sizepublic void selectionChanged(DiagramSelection sel)
DiagramSelectionListener
selectionChanged
in interface DiagramSelectionListener
sel
- the selection
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |