public class DragRectangleToScale extends DefaultInteractionHandler
command, fixedTranslate, multiplyScale, multiplyTranslate
Constructor and Description |
---|
DragRectangleToScale()
Create a rectangle handler to generate scale edits.
|
Modifier and Type | Method and Description |
---|---|
boolean |
altKeyPressed(RecordPlot plot,
KeyEvent event)
Called when the alt key is pressed.
|
boolean |
altKeyReleased(RecordPlot plot,
KeyEvent event)
Called when the alt key is released.
|
void |
changeCursor(RecordPlot plot,
InputEvent event)
Called to allow the InteractionHandler to change the cursor.
|
String |
getDescription()
Returns a one line description.
|
Icon |
getIcon(int size)
Returns associated icon
|
boolean |
isSupportedBy(GraphicsPanel panel)
Returns true if this Interaction Handler is supported by this Graphics
Panel.
|
void |
mouseButton1Clicked(RecordPlot plot,
MouseEvent event)
Translate point to center and zoom in (or out if alt key pressed).
|
void |
mouseButton1DragEnded(RecordPlot plot,
MouseEvent event)
Update end point of rectangle, translate and scale, and remove rectangle.
|
void |
mouseButton1Dragged(RecordPlot plot,
MouseEvent event)
Update moving point of rectangle and draw.
|
void |
mouseButton1DragStarted(RecordPlot plot,
MouseEvent event)
Store starting point of rectangle.
|
void |
mouseButton1Released(RecordPlot plot,
MouseEvent event)
Called when mouse button 1 is released
|
void |
mouseEntered(RecordPlot plot,
MouseEvent event)
Called when the mouse is entering the component
|
void |
reset(RecordPlot plot,
InputEvent event)
Called to reset the interaction handler in its initial state.
|
boolean |
shiftKeyPressed(RecordPlot plot,
KeyEvent event)
Called when the shift key is pressed.
|
boolean |
shiftKeyReleased(RecordPlot plot,
KeyEvent event)
Called when the esc key is released.
|
String |
toString() |
static void |
translateAndScale(RecordPlot plot,
Rectangle2D rectangle,
boolean fixedRatio) |
getInstance, getLastScale, isControlMetaDown, isMac, mouseWheelMoved, otherKeyPressed
ctrlKeyPressed, ctrlKeyReleased, ctrlMetaKeyPressed, ctrlMetaKeyReleased, equals, escKeyPressed, escKeyReleased, getHeight, getID, getName, getWidth, hashCode, keyTyped, metaKeyPressed, metaKeyReleased, mouseButton1Pressed, mouseExited, mouseMoved, otherKeyReleased, restore, save, setRecord, setSelected, setSize
public DragRectangleToScale()
public Icon getIcon(int size)
InteractionHandler
getIcon
in interface InteractionHandler
getIcon
in class AbstractInteractionHandler
public String getDescription()
InteractionHandler
getDescription
in interface InteractionHandler
getDescription
in class DefaultInteractionHandler
public boolean isSupportedBy(GraphicsPanel panel)
InteractionHandler
isSupportedBy
in interface InteractionHandler
isSupportedBy
in class DefaultInteractionHandler
public void changeCursor(RecordPlot plot, InputEvent event)
InteractionHandler
changeCursor
in interface InteractionHandler
changeCursor
in class DefaultInteractionHandler
public void reset(RecordPlot plot, InputEvent event)
InteractionHandler
reset
in interface InteractionHandler
reset
in class AbstractInteractionHandler
public void mouseEntered(RecordPlot plot, MouseEvent event)
InteractionHandler
mouseEntered
in interface InteractionHandler
mouseEntered
in class DefaultInteractionHandler
public void mouseButton1DragStarted(RecordPlot plot, MouseEvent event)
mouseButton1DragStarted
in interface InteractionHandler
mouseButton1DragStarted
in class AbstractInteractionHandler
public void mouseButton1Dragged(RecordPlot plot, MouseEvent event)
mouseButton1Dragged
in interface InteractionHandler
mouseButton1Dragged
in class AbstractInteractionHandler
public void mouseButton1DragEnded(RecordPlot plot, MouseEvent event)
mouseButton1DragEnded
in interface InteractionHandler
mouseButton1DragEnded
in class AbstractInteractionHandler
public static void translateAndScale(RecordPlot plot, Rectangle2D rectangle, boolean fixedRatio)
public void mouseButton1Released(RecordPlot plot, MouseEvent event)
InteractionHandler
mouseButton1Released
in interface InteractionHandler
mouseButton1Released
in class AbstractInteractionHandler
public boolean shiftKeyPressed(RecordPlot plot, KeyEvent event)
InteractionHandler
shiftKeyPressed
in interface InteractionHandler
shiftKeyPressed
in class AbstractInteractionHandler
public boolean shiftKeyReleased(RecordPlot plot, KeyEvent event)
InteractionHandler
shiftKeyReleased
in interface InteractionHandler
shiftKeyReleased
in class AbstractInteractionHandler
public boolean altKeyPressed(RecordPlot plot, KeyEvent event)
InteractionHandler
altKeyPressed
in interface InteractionHandler
altKeyPressed
in class AbstractInteractionHandler
public boolean altKeyReleased(RecordPlot plot, KeyEvent event)
InteractionHandler
altKeyReleased
in interface InteractionHandler
altKeyReleased
in class AbstractInteractionHandler
public void mouseButton1Clicked(RecordPlot plot, MouseEvent event)
mouseButton1Clicked
in interface InteractionHandler
mouseButton1Clicked
in class AbstractInteractionHandler
Copyright © 1996-2014 FreeHEP. All Rights Reserved.