|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
org.pzgui.PZWindow
public class PZWindow
A single pan-zoom GUI window.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JFrame |
|---|
javax.swing.JFrame.AccessibleJFrame |
| Nested classes/interfaces inherited from class java.awt.Frame |
|---|
java.awt.Frame.AccessibleAWTFrame |
| Nested classes/interfaces inherited from class java.awt.Window |
|---|
java.awt.Window.AccessibleAWTWindow |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
java.awt.Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
static java.lang.String |
BASE_TITLE
string to prefix to the title in the window bar |
java.lang.String |
customTitle
custom string to use for the title (if null, BASE_TITLE will be used) |
protected PZManager |
manager
the manager which is managing this window |
| Fields inherited from class javax.swing.JFrame |
|---|
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled |
| Fields inherited from class java.awt.Frame |
|---|
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface javax.swing.WindowConstants |
|---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
PZWindow(PZManager manager,
int screenX,
int screenY,
int width,
int height,
int drawX,
int drawY)
Creates new form display window |
|
| Method Summary | |
|---|---|
void |
addEventListener(PZWindowEventListener l)
Registers the listener for component, key, mouse, and window events. |
void |
applyPanInProgress()
apply the pan in progress |
void |
componentHidden(java.awt.event.ComponentEvent e)
|
void |
componentMoved(java.awt.event.ComponentEvent e)
|
void |
componentResized(java.awt.event.ComponentEvent e)
|
void |
componentShown(java.awt.event.ComponentEvent e)
|
javax.swing.JLabel |
getCanvas()
Returns the canvas on which the scene will be drawn for this window |
java.lang.String |
getCustomTitle()
Gets the custom title of this window bar |
java.awt.Graphics2D |
getDisplayGfx()
|
DockLocation |
getDockLocation()
get the location where the window is docked, if any |
int |
getDrawOffsetX()
get the aggregate x-axis pan |
int |
getDrawOffsetY()
get the aggregate y-axis pan |
PZManager |
getManager()
Gets the manager of this window |
int |
getMX(java.awt.event.MouseEvent evt)
get the y position of the mouse relative to the scene's origin (e.g. |
int |
getMY(java.awt.event.MouseEvent evt)
get the y position of the mouse relative to the scene's origin (e.g. |
int |
getPanX()
get the current x-axis pan |
int |
getPanY()
get the current y-axis pan |
int |
getReservedHeightBottom()
gets how much of the bottom side of the window is reserved for other content |
int |
getReservedWidthRight()
gets how much of the right side of the window is reserved for other content |
java.lang.String |
getTitle()
Gets the title of this window bar |
float |
getZoom()
get the current zoom |
void |
panDown()
pan down by the standard amount |
void |
panLeft()
pan left by the standard amount |
void |
panRight()
pan right by the standard amount |
void |
panUp()
pan up by the standard amount |
void |
redraw()
|
void |
removeEventListener(PZWindowEventListener l)
Registers the listener for component, key, mouse, and window events. |
void |
resetView()
reset the pan to the origin and zoom to 1.0 |
void |
screenshot()
tells the GUI to save a screenshot when it finishes the next redraw |
void |
setCustomTitle(java.lang.String title)
Sets the custom title of this window bar |
void |
setDockLocation(DockLocation dockLocation)
set how the window is docked |
void |
setHeight(int h)
set the height of this window |
void |
setMySize(int w,
int h)
set the height and width of this window |
void |
setMySize(int w,
int h,
float zoom)
set the height, width, and zoom of this window |
void |
setPanInProgress(int x,
int y)
set the pan in progress to the specified amount |
void |
setPanX(int x)
set the aggregate x-axis pan |
void |
setPanY(int y)
set the aggregate y-axis pan |
void |
setPos(Vector2i pos)
set the x and y coordinates of this window |
void |
setReservedHeightBottom(int reservedHeightBottom)
sets how much of the bottom side of the window is reserved for other content |
void |
setReservedWidthRight(int reservedWidthRight)
sets how much of the right side of the window is reserved for other content |
void |
setWidth(int w)
set the width of this window |
void |
setX(int x)
set the x-coordinate of this window |
void |
setY(int y)
set the y-coordinate of this window |
void |
setZoom(float z)
set the current zoom |
void |
startPanZoomAnimation(int toX,
int toY,
float zoomTo,
long duration_msec)
Starts a pan-zoom animation with zoomPanAnimationInterpolationPower == 1.0f (a linear interpolation between the endpoints). |
void |
startPanZoomAnimation(int toX,
int toY,
float zoomTo,
long duration_msec,
float zoomPanAnimationInterpolationPower)
Starts a pan-zoom animation. |
void |
startPanZoomAnimationToArea(int left,
int right,
int top,
int bottom,
long duration_msec,
float zoomPanAnimationInterpolationPower)
Starts a pan-zoom animation to focus on the specified area. |
void |
startPanZoomAnimationToLayoutables(java.util.Collection<Layoutable> layoutablesToInclude,
long duration_msec,
float zoomPanAnimationInterpolationPower)
Starts a pan-zoom animation to focus on a set of layoutables. |
void |
stopPanZoomAnimation()
stops any ongoing pan-zoom animation in its tracks |
java.lang.String |
toString()
print out a string representation of the window's settings |
void |
zoomIn()
zoom in by the standard amount |
void |
zoomOut()
zoom out by the standard amount |
| Methods inherited from class javax.swing.JFrame |
|---|
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update |
| Methods inherited from class java.awt.Frame |
|---|
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
| Methods inherited from class java.awt.Window |
|---|
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setVisible, show, toBack, toFront |
| Methods inherited from class java.awt.Container |
|---|
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
| Methods inherited from class java.awt.Component |
|---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.awt.MenuContainer |
|---|
getFont, postEvent |
| Field Detail |
|---|
protected final PZManager manager
public static java.lang.String BASE_TITLE
public java.lang.String customTitle
| Constructor Detail |
|---|
public PZWindow(PZManager manager,
int screenX,
int screenY,
int width,
int height,
int drawX,
int drawY)
| Method Detail |
|---|
public PZManager getManager()
public void addEventListener(PZWindowEventListener l)
public void removeEventListener(PZWindowEventListener l)
public java.lang.String getTitle()
getTitle in class java.awt.Framepublic java.lang.String getCustomTitle()
public void setCustomTitle(java.lang.String title)
public javax.swing.JLabel getCanvas()
public java.awt.Graphics2D getDisplayGfx()
public void redraw()
public void screenshot()
public int getReservedWidthRight()
public void setReservedWidthRight(int reservedWidthRight)
public int getReservedHeightBottom()
public void setReservedHeightBottom(int reservedHeightBottom)
public void setX(int x)
public void setY(int y)
public void setPos(Vector2i pos)
public DockLocation getDockLocation()
public void setDockLocation(DockLocation dockLocation)
public void setWidth(int w)
public void setHeight(int h)
public void setMySize(int w,
int h)
public void setMySize(int w,
int h,
float zoom)
public void componentResized(java.awt.event.ComponentEvent e)
componentResized in interface java.awt.event.ComponentListenerpublic void componentMoved(java.awt.event.ComponentEvent e)
componentMoved in interface java.awt.event.ComponentListenerpublic void componentShown(java.awt.event.ComponentEvent e)
componentShown in interface java.awt.event.ComponentListenerpublic void componentHidden(java.awt.event.ComponentEvent e)
componentHidden in interface java.awt.event.ComponentListenerpublic int getDrawOffsetX()
public int getDrawOffsetY()
public int getPanX()
public void setPanX(int x)
public int getPanY()
public void setPanY(int y)
public void panLeft()
public void panRight()
public void panDown()
public void panUp()
public void applyPanInProgress()
public void setPanInProgress(int x,
int y)
public int getMX(java.awt.event.MouseEvent evt)
public int getMY(java.awt.event.MouseEvent evt)
public float getZoom()
public void setZoom(float z)
public void zoomIn()
public void zoomOut()
public void resetView()
public void startPanZoomAnimation(int toX,
int toY,
float zoomTo,
long duration_msec)
public void startPanZoomAnimation(int toX,
int toY,
float zoomTo,
long duration_msec,
float zoomPanAnimationInterpolationPower)
toX - what x coordinate to zoom totoY - what y coordinate to zoom tozoomTo - the new zoom factorduration_msec - how long to animatezoomPanAnimationInterpolationPower - 1 means a linear
interpolation will be done between the two
animation endpoints. 2 would be quadratic, etc.
A higher the number causes a faster beginning and
a slower and smoother the ending.
public void startPanZoomAnimationToLayoutables(java.util.Collection<Layoutable> layoutablesToInclude,
long duration_msec,
float zoomPanAnimationInterpolationPower)
layoutablesToInclude - the layoutables to zoom in onduration_msec - how long to animatezoomPanAnimationInterpolationPower - see startPanZoomAnimation()
public void startPanZoomAnimationToArea(int left,
int right,
int top,
int bottom,
long duration_msec,
float zoomPanAnimationInterpolationPower)
left - the leftmost coordinate to includeright - the rightmost coordinate to includetop - the uppermost coordinate to includebottom - the bottom-most coordinate to includeduration_msec - how long to animatezoomPanAnimationInterpolationPower - see startPanZoomAnimation()public void stopPanZoomAnimation()
public java.lang.String toString()
toString in class java.awt.Component
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||