public class BalloonResizeController extends AbstractResizeHotSpot
Balloon
by dragging the mouse. This class should usually not be instantiated
directly. Instead, BalloonController
will instantiate it when a balloon needs to be resized.BalloonController
Modifier and Type | Field and Description |
---|---|
protected Balloon |
balloon |
protected Rectangle |
bounds |
protected static Dimension |
DEFAULT_MIN_SIZE |
protected WorldWindow |
wwd |
adjustLocationX, adjustLocationY, allowHorizontalResize, allowVerticalResize, cursor, dragging, dragRefPoint, EAST, NORTH, NORTHEAST, NORTHWEST, refLocation, refSize, SOUTH, SOUTHEAST, SOUTHWEST, WEST, xSign, ySign
active
Constructor and Description |
---|
BalloonResizeController(WorldWindow wwd,
Balloon balloon)
Create a resize controller.
|
Modifier and Type | Method and Description |
---|---|
void |
detach()
Remove this controller as an event listener.
|
Rectangle |
getBounds()
Gets the bounds of the Balloon being sized.
|
protected Rectangle |
getBounds(PickedObject pickedObject)
Get the balloon bounds from a SelectEvent.
|
protected Dimension |
getMinimumSize()
Get the minimum size of the frame.
|
protected Point |
getScreenPoint()
Get the screen point of the upper left corner of the frame.
|
protected Dimension |
getSize()
Get the size of the frame.
|
boolean |
isResizing()
Is the controller currently resizing a balloon?
|
void |
mouseMoved(MouseEvent e)
Update the resize cursor when the mouse moves.
|
void |
setBounds(Rectangle bounds)
Specifies the bounds of the Balloon to be sized.
|
protected void |
setScreenPoint(Point newPoint)
Set the screen point of the upper left corner of the frame.
|
protected void |
setSize(Dimension newSize)
Set the size of the frame.
|
protected void |
updateCursor()
Update the World Window's cursor to the current resize cursor.
|
beginDrag, drag, endDrag, getCursor, isDragging, isValidSize, selected, setActive, setDirection, setDirection, setDirectionFromPoint
isActive, isConsumed, keyPressed, keyReleased, keyTyped, mouseClicked, mouseDragged, mouseEntered, mouseExited, mousePressed, mouseReleased, mouseWheelMoved
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getBooleanValue, getBooleanValue, getChangeSupport, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getRestorableStateForAVPair, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
protected Balloon balloon
protected Rectangle bounds
protected static final Dimension DEFAULT_MIN_SIZE
protected WorldWindow wwd
public BalloonResizeController(WorldWindow wwd, Balloon balloon)
wwd
- WorldWindow to interact with.balloon
- Balloon to resize.public void detach()
public Rectangle getBounds()
null
if no bounds have been set.protected Rectangle getBounds(PickedObject pickedObject)
pickedObject
- Top picked object. The bounds are expected to be attached to the to PickedObject
under AVKey.BOUNDS.null
if no bounds are found in the top PickedObject.protected Dimension getMinimumSize()
getMinimumSize
in class AbstractResizeHotSpot
AbstractResizeHotSpot.isValidSize(int, int)
protected Point getScreenPoint()
getScreenPoint
in class AbstractResizeHotSpot
protected Dimension getSize()
getSize
in class AbstractResizeHotSpot
public boolean isResizing()
public void mouseMoved(MouseEvent e)
AbstractResizeHotSpot
mouseMoved
in interface HotSpot
mouseMoved
in interface MouseMotionListener
mouseMoved
in class AbstractResizeHotSpot
e
- Mouse event.public void setBounds(Rectangle bounds)
bounds
- Balloon bounds, in AWT coordinates.protected void setScreenPoint(Point newPoint)
setScreenPoint
in class AbstractResizeHotSpot
newPoint
- New screen point measured from upper left corner of the screen (AWT coordinates).protected void setSize(Dimension newSize)
setSize
in class AbstractResizeHotSpot
newSize
- New frame size in pixels.protected void updateCursor()