NASA World Wind

gov.nasa.worldwind.util.tree
Class FrameResizeControl

java.lang.Object
  extended by gov.nasa.worldwind.avlist.AVListImpl
      extended by gov.nasa.worldwind.util.AbstractHotSpot
          extended by gov.nasa.worldwind.util.AbstractResizeHotSpot
              extended by gov.nasa.worldwind.util.tree.FrameResizeControl
All Implemented Interfaces:
AVList, SelectListener, HotSpot, KeyListener, MouseListener, MouseMotionListener, MouseWheelListener, 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
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
FrameResizeControl(ScrollFrame frame)
          Create a resize control.
 
Method Summary
protected  void beginDrag(Point point)
          
protected  void endDrag()
          Called when a drag action ends.
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.
 void mouseWheelMoved(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(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.
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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(Point point)

Overrides:
beginDrag in class AbstractResizeHotSpot

endDrag

protected void endDrag()
Called when a drag action ends. This implementation sets AbstractResizeHotSpot.dragRefPoint to null.

Overrides:
endDrag in class AbstractResizeHotSpot

getMinimumSize

protected 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 class AbstractResizeHotSpot
Returns:
Minimum frame size.
See Also:
AbstractResizeHotSpot.isValidSize(int, int)

getScreenPoint

protected Point getScreenPoint()
Get the screen point of the upper left corner of the frame.

Specified by:
getScreenPoint in class AbstractResizeHotSpot
Returns:
Screen point measured from upper left corner of the screen (AWT coordinates).

getSize

protected Dimension getSize()
Get the size of the frame.

Specified by:
getSize in class AbstractResizeHotSpot
Returns:
Frame size in pixels.

mouseWheelMoved

public void mouseWheelMoved(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 interface HotSpot
Specified by:
mouseWheelMoved in interface MouseWheelListener
Overrides:
mouseWheelMoved in class AbstractHotSpot
Parameters:
event - The event to handle.

setScreenPoint

protected void setScreenPoint(Point newPoint)
Set the screen point of the upper left corner of the frame.

Specified by:
setScreenPoint in class AbstractResizeHotSpot
Parameters:
newPoint - New screen point measured from upper left corner of the screen (AWT coordinates).

setSize

protected void setSize(Dimension newSize)
Set the size of the frame.

Specified by:
setSize in class AbstractResizeHotSpot
Parameters:
newSize - New frame size in pixels.

NASA World Wind