Package gov.nasa.worldwind.util.tree
Class FrameResizeControl
- java.lang.Object
-
- gov.nasa.worldwind.avlist.AVListImpl
-
- gov.nasa.worldwind.util.AbstractHotSpot
-
- gov.nasa.worldwind.util.AbstractResizeHotSpot
-
- gov.nasa.worldwind.util.tree.FrameResizeControl
-
- All Implemented Interfaces:
AVList
,SelectListener
,HotSpot
,java.awt.event.KeyListener
,java.awt.event.MouseListener
,java.awt.event.MouseMotionListener
,java.awt.event.MouseWheelListener
,java.util.EventListener
public class FrameResizeControl extends AbstractResizeHotSpot
A screen control for resizing a frame. This class handles the resize input events, but does does not actually draw the resize control.
-
-
Field Summary
Fields Modifier and Type Field Description protected ScrollFrame
frame
-
Fields inherited from class gov.nasa.worldwind.util.AbstractResizeHotSpot
adjustLocationX, adjustLocationY, allowHorizontalResize, allowVerticalResize, cursor, dragging, dragRefPoint, EAST, NORTH, NORTHEAST, NORTHWEST, refLocation, refSize, SOUTH, SOUTHEAST, SOUTHWEST, WEST, xSign, ySign
-
Fields inherited from class gov.nasa.worldwind.util.AbstractHotSpot
active
-
-
Constructor Summary
Constructors Constructor Description FrameResizeControl(ScrollFrame frame)
Create a resize control.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
beginDrag(java.awt.Point point)
protected void
endDrag()
Called when a drag action ends.protected java.awt.Dimension
getMinimumSize()
Get the minimum size of the frame.protected java.awt.Point
getScreenPoint()
Get the screen point of the upper left corner of the frame.protected java.awt.Dimension
getSize()
Get the size of the frame.void
mouseWheelMoved(java.awt.event.MouseWheelEvent event)
Forwards mouse wheel events to the frame, so that the contents can be scrolled when the mouse is over the resize area.protected void
setScreenPoint(java.awt.Point newPoint)
Set the screen point of the upper left corner of the frame.protected void
setSize(java.awt.Dimension newSize)
Set the size of the frame.-
Methods inherited from class gov.nasa.worldwind.util.AbstractResizeHotSpot
drag, getCursor, isDragging, isValidSize, mouseMoved, selected, setActive, setDirection, setDirection, setDirectionFromPoint
-
Methods inherited from class gov.nasa.worldwind.util.AbstractHotSpot
isActive, isConsumed, keyPressed, keyReleased, keyTyped, mouseClicked, mouseDragged, mouseEntered, mouseExited, mousePressed, mouseReleased
-
Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl
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
-
-
-
-
Field Detail
-
frame
protected ScrollFrame frame
-
-
Constructor Detail
-
FrameResizeControl
public FrameResizeControl(ScrollFrame frame)
Create a resize control.- Parameters:
frame
- Frame to resize.
-
-
Method Detail
-
beginDrag
protected void beginDrag(java.awt.Point point)
- Overrides:
beginDrag
in classAbstractResizeHotSpot
-
endDrag
protected void endDrag()
Called when a drag action ends. This implementation setsAbstractResizeHotSpot.dragRefPoint
to null.- Overrides:
endDrag
in classAbstractResizeHotSpot
-
getSize
protected java.awt.Dimension getSize()
Get the size of the frame.- Specified by:
getSize
in classAbstractResizeHotSpot
- Returns:
- Frame size in pixels.
-
setSize
protected void setSize(java.awt.Dimension newSize)
Set the size of the frame.- Specified by:
setSize
in classAbstractResizeHotSpot
- Parameters:
newSize
- New frame size in pixels.
-
getScreenPoint
protected java.awt.Point getScreenPoint()
Get the screen point of the upper left corner of the frame.- Specified by:
getScreenPoint
in classAbstractResizeHotSpot
- Returns:
- Screen point measured from upper left corner of the screen (AWT coordinates).
-
setScreenPoint
protected void setScreenPoint(java.awt.Point newPoint)
Set the screen point of the upper left corner of the frame.- Specified by:
setScreenPoint
in classAbstractResizeHotSpot
- Parameters:
newPoint
- New screen point measured from upper left corner of the screen (AWT coordinates).
-
getMinimumSize
protected java.awt.Dimension getMinimumSize()
Get the minimum size of the frame. The user is not allowed to resize the frame to be smaller than this size. This implementation returns 0, 0.- Overrides:
getMinimumSize
in classAbstractResizeHotSpot
- Returns:
- Minimum frame size.
- See Also:
AbstractResizeHotSpot.isValidSize(int, int)
-
mouseWheelMoved
public void mouseWheelMoved(java.awt.event.MouseWheelEvent event)
Forwards mouse wheel events to the frame, so that the contents can be scrolled when the mouse is over the resize area.- Specified by:
mouseWheelMoved
in interfaceHotSpot
- Specified by:
mouseWheelMoved
in interfacejava.awt.event.MouseWheelListener
- Overrides:
mouseWheelMoved
in classAbstractHotSpot
- Parameters:
event
- The event to handle.
-
-