|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jidesoft.chart.event.RubberBandZoomer
public class RubberBandZoomer
This class listens to mouse movements and draws 'rubber band' selections when added to an instance of Chart.
A ChartSelectionEvent is fired when the mouse button is released.
You can use property settings to constrain the shape of the rectangular region used for the zoom. Essentially there are four modes:
Field Summary | |
---|---|
static String |
PROPERTY_FILL
|
static String |
PROPERTY_KEEP_RATIO
|
static String |
PROPERTY_OUTLINE_COLOR
|
static String |
PROPERTY_OUTLINE_STROKE
|
static String |
PROPERTY_ZOOM_ORIENTATION
|
Constructor Summary | |
---|---|
RubberBandZoomer(JComponent component)
|
Method Summary | |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Add a listener that is informed when properties change |
void |
addZoomListener(ZoomListener listener)
Add a listener that is informed when the user wishes to zoom in or out |
void |
draw(Graphics g)
Draw the object implementing this interface onto the supplied Graphics context |
protected void |
fireZoomIn(Rectangle selection)
|
protected void |
fireZoomOut(Point p)
|
Paint |
getFill()
|
Stroke |
getOutlineStroke()
|
ZoomOrientation |
getZoomOrientation()
|
boolean |
isKeepWidthHeightRatio()
|
void |
mouseClicked(MouseEvent e)
|
void |
mouseDragged(MouseEvent e)
|
void |
mouseEntered(MouseEvent e)
|
void |
mouseExited(MouseEvent e)
|
void |
mouseMoved(MouseEvent e)
|
void |
mousePressed(MouseEvent e)
|
void |
mouseReleased(MouseEvent e)
|
void |
removePropertyChangeListener(PropertyChangeListener listener)
Remove a property change that was added previously |
void |
removeZoomListener(ZoomListener listener)
Remove a listener that was previously added |
void |
setFill(Paint fill)
Specify the fill for the inner region of the rubber band. |
void |
setKeepWidthHeightRatio(boolean keepWidthHeightRatio)
|
void |
setOutlineColor(Color color)
Specify the color to use for the outline of the rubber band |
void |
setOutlineStroke(Stroke stroke)
Specify the outline stroke to use for the rubber band |
void |
setZoomOrientation(ZoomOrientation zoomOrientation)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String PROPERTY_OUTLINE_STROKE
public static final String PROPERTY_OUTLINE_COLOR
public static final String PROPERTY_FILL
public static final String PROPERTY_KEEP_RATIO
public static final String PROPERTY_ZOOM_ORIENTATION
Constructor Detail |
---|
public RubberBandZoomer(JComponent component)
Method Detail |
---|
public void addPropertyChangeListener(PropertyChangeListener listener)
listener
- the property change listenerpublic void removePropertyChangeListener(PropertyChangeListener listener)
listener
- the listener to removepublic void addZoomListener(ZoomListener listener)
listener
- the listener to be informed of the zoompublic void removeZoomListener(ZoomListener listener)
listener
- the listener to be informed of the zoompublic void setOutlineStroke(Stroke stroke)
stroke
- the Stroke to usepublic Stroke getOutlineStroke()
public void setOutlineColor(Color color)
color
- the color to use for the outlinepublic Paint getFill()
public void setFill(Paint fill)
fill
- the fill to usepublic boolean isKeepWidthHeightRatio()
public void setKeepWidthHeightRatio(boolean keepWidthHeightRatio)
public ZoomOrientation getZoomOrientation()
public void setZoomOrientation(ZoomOrientation zoomOrientation)
protected void fireZoomIn(Rectangle selection)
protected void fireZoomOut(Point p)
public void mouseClicked(MouseEvent e)
mouseClicked
in interface MouseListener
public void mouseEntered(MouseEvent e)
mouseEntered
in interface MouseListener
public void mouseExited(MouseEvent e)
mouseExited
in interface MouseListener
public void mousePressed(MouseEvent e)
mousePressed
in interface MouseListener
public void mouseReleased(MouseEvent e)
mouseReleased
in interface MouseListener
public void mouseDragged(MouseEvent e)
mouseDragged
in interface MouseMotionListener
public void mouseMoved(MouseEvent e)
mouseMoved
in interface MouseMotionListener
public void draw(Graphics g)
Drawable
draw
in interface Drawable
g
- the Graphics context
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |