Package snap.view
Class WindowView
java.lang.Object
snap.props.PropObject
snap.view.View
snap.view.ParentView
snap.view.WindowView
- All Implemented Interfaces:
PropChange.DoChange
,XMLArchiver.Archivable
- Direct Known Subclasses:
PopupWindow
A class to manage a Window.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
static class
A class to map snap Window functionality to native platform. -
Field Summary
Modifier and TypeFieldDescriptionprotected WindowView.WindowHpr
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
static final String
Fields inherited from class snap.view.ParentView
_children, Child_Prop, NeedsLayout_Prop
Fields inherited from class snap.view.View
_align, _borderRadius, _effect, _font, _margin, _padding, _repaintRect, _showing, _spacing, _vertical, Action, Align_Prop, Border_Prop, BorderRadius_Prop, Clip_Prop, Cursor_Prop, DEFAULT_ALIGN, DEFAULT_MARGIN, DEFAULT_PADDING, DEFAULT_SPACING, Disabled_Prop, DragEvents, Effect_Prop, Fill_Prop, Focusable_Prop, Focused_Prop, FocusWhenPressed_Prop, Font_Prop, GrowHeight_Prop, GrowWidth_Prop, Height_Prop, KeyEvents, KeyPress, KeyRelease, KeyType, LeanX_Prop, LeanY_Prop, Managed_Prop, Margin_Prop, MaxHeight_Prop, MaxWidth_Prop, MinHeight_Prop, MinWidth_Prop, MouseDrag, MouseEnter, MouseEvents, MouseExit, MouseMove, MousePress, MouseRelease, Name_Prop, Opacity_Prop, Padding_Prop, Paintable_Prop, Parent_Prop, Pickable_Prop, PrefHeight_Prop, PrefWidth_Prop, Rotate_Prop, ScaleX_Prop, ScaleY_Prop, Scroll, Showing_Prop, Spacing_Prop, Text_Prop, ToolTip_Prop, TransX_Prop, TransY_Prop, Vertical_Prop, Visible_Prop, Width_Prop, X_Prop, Y_Prop
Fields inherited from class snap.props.PropObject
_pcs, EMPTY_OBJECT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
dispatchEventToWindow
(ViewEvent anEvent) Dispatch event.Returns the active cursor.Returns the view associated with the last show() call.Returns the content associated with this window.Returns the native for the window content.Returns the EventDispatcher.Returns the document file URL for the window title bar proxy icon.Returns the view that currently receives KeyEvents.Returns the previous focus view.Returns the view helper.getImage()
Returns the icon image for the window.Returns the window max size.static <T extends ViewOwner>
TgetOpenWindowOwner
(Class<T> aClass) Returns an array of all open windows.static <T extends ViewOwner>
T[]getOpenWindowOwners
(Class<T> aClass) Returns an array of all open windows.static WindowView[]
Returns an array of all open windows.getPopup()
Returns the popup window, if one was added to root view during last event.protected double
getPrefHeightImpl
(double aW) Returns the preferred height.protected double
getPrefWidthImpl
(double aH) Returns the preferred width.Returns the root view.Returns the save name.getScreenLocation
(View aView, Pos aPos, double aDX, double aDY) Returns the screen location for given view, position and offsets.getTitle()
Returns the title of the window.getToolTip
(ViewEvent anEvent) Override to try to get tool tip from mouse over stack.getType()
Returns the window type.Returns the Updater.Override to return this window.void
hide()
Hide the window.protected void
Initializes the native window.boolean
Returns whether the window is always on top.boolean
Returns whether the window will hide on deactivate.boolean
Returns whether the window is sized to maximum screen size.boolean
isModal()
Returns the modal mode of the window.boolean
Returns whether the window is resizable.boolean
Returns whether to save sizeboolean
Override to return showing, since it is eqivalent for window.protected void
Layout children.void
pack()
Packs the window.void
relayout()
Override to do layout immediately.void
repaint
(double aX, double aY, double aW, double aH) Override to change to root view.protected void
requestFocus
(View aView) Tries to makes the given view the view that receives KeyEvents.void
Resets the active cursor.void
Save frame.void
setActiveCursor
(Cursor aCursor) Sets the current cursor.void
setAlwaysOnTop
(boolean aValue) Sets whether the window is always on top.void
setContent
(View aView) Sets the content associated with this window.void
Returns the document file URL for the window title bar proxy icon.protected void
setFocused
(boolean aValue) Override to move window to front of all windows list.void
setHideOnDeactivate
(boolean aValue) Sets whether the window will hide on deacativate.void
Sets the icon image for the window.void
setMaximized
(boolean aValue) Sets whether the window is sized to maximum screen size.void
setMaximizedBounds
(Rect aRect) Sets the bounds rect to use when window is maximized (uses ViewEnv ScreenBoundsInset by default).void
setModal
(boolean aValue) Sets the modal mode of the window (defaults to false).protected void
setPopup
(PopupWindow aPopup) Sets the popup window, if one added to this root view during last event.void
setResizable
(boolean aValue) Sets whether the window is resizable (default to true).void
setSaveName
(String aName) Sets the save name.void
setSaveSize
(boolean aValue) Sets whether to save size.protected void
setShowing
(boolean aValue) Override to update global windows list.void
Sets the title of the window.void
Sets the window type.void
setVisible
(boolean aValue) Override to call show/hide.void
show()
Shows window in center of screen.void
Show the window relative to given view and View X/Y (screen x/y if view is null).void
showCentered
(View aView) Shows window in center of given view.void
toFront()
Order window to front.Methods inherited from class snap.view.ParentView
addChild, addChild, addDeepChangeListener, childDidDeepChange, childDidPropChange, fromXML, fromXMLChildren, fromXMLView, getChild, getChildAt, getChildAt, getChildCount, getChildCountManaged, getChildForClass, getChildForName, getChildLast, getChildren, getChildrenForClass, getChildrenInPaintOrder, getChildrenManaged, getFocusNext, getFocusPrev, getPropValue, getViewList, getViewProxy, indexOfChild, initProps, intersectsShape, isInLayout, isNeedsLayout, isNeedsLayoutDeep, isNeedsRepaintDeep, layout, layoutDeep, layoutDeepImpl, layoutFloatingViews, paintAbove, paintAll, paintChildren, parentFontChanged, processPropChange, removeChild, removeChild, removeChildren, removeDeepChangeListener, setChildren, setFont, setNeedsLayout, setNeedsLayoutDeep, setNeedsRepaintDeep, setOwner, setOwnerChildren, setPropValue, themeChanged, toXML, toXMLChildren, toXMLView
Methods inherited from class snap.view.View
addBinding, addEventFilter, addEventHandler, clone, contains, contains, containsShape, createActionEvent, disableEvents, enableEvents, fireActionEvent, getAlign, getAlignX, getAlignY, getAnim, getAnimCleared, getAnimTimeDeep, getBestHeight, getBestSize, getBestWidth, getBinding, getBinding, getBindingCount, getBindings, getBorder, getBorderRadius, getBounds, getBoundsLocal, getBoundsParent, getBoundsShape, getBoundsShapeParent, getClip, getClipAll, getClipAllBounds, getClipBounds, getClippedRect, getCursor, getDefaultBorder, getDefaultFill, getDefaultFont, getEffect, getEnv, getEventAdapter, getFill, getFillColor, getFocusNext, getFocusPrev, getFont, getHeight, getHost, getInsetsAll, getLean, getLeanX, getLeanY, getLocalToParent, getLocalToParent, getMargin, getMaxHeight, getMaxSize, getMaxWidth, getMaxX, getMaxY, getMidX, getMidY, getMinHeight, getMinHeightImpl, getMinSize, getMinWidth, getMinWidthImpl, getName, getOpacity, getOpacityAll, getOwner, getOwner, getPadding, getParent, getParent, getParentCount, getParentToLocal, getParentToLocal, getPhysics, getPhysics, getPrefHeight, getPrefHeight, getPrefSize, getPrefWidth, getPrefWidth, getProp, getPropDefault, getProps, getRealClassName, getRepaintRect, getRepaintRectExpanded, getRotate, getScale, getScaleX, getScaleY, getSize, getSpacing, getText, getToolTip, getTransX, getTransY, getValuePropName, getVisRect, getWidth, getX, getXY, getY, indexInHost, indexInParent, isActionable, isAncestor, isClipToBounds, isDisabled, isEnabled, isFocusable, isFocused, isFocusKeysEnabled, isFocusPainted, isFocusWhenPressed, isFontSet, isGrowHeight, isGrowWidth, isGuest, isHorizontal, isLocalToParentSimple, isManaged, isManagedVisible, isMaxHeightSet, isMaxWidthSet, isMinHeightSet, isMinWidthSet, isMouseDown, isMouseOver, isNeedsRepaint, isPaintable, isPickable, isPickableVisible, isPrefHeightSet, isPrefWidthSet, isShowing, isToolTipEnabled, isVertical, localToParent, localToParent, localToParent, localToParent, localToScreen, paintBack, paintFront, parentToLocal, parentToLocal, parentToLocal, parentToLocal, playAnimDeep, processEvent, processEventAll, processEventFilters, processEventHandlers, relayoutParent, removeBinding, removeBinding, removeEventFilter, removeEventHandler, repaint, repaint, repaintInParent, requestFocus, runDelayed, runIntervals, runLater, scrollToVisible, setActionable, setAlign, setAlignX, setAlignY, setAnimProps, setAnimString, setAnimTimeDeep, setBorder, setBorder, setBorderRadius, setBounds, setBounds, setBoundsLocal, setClip, setClipToBounds, setCursor, setDisabled, setEffect, setEnabled, setFill, setFocusable, setFocusKeysEnabled, setFocusPainted, setFocusWhenPressed, setGrowHeight, setGrowWidth, setHeight, setLean, setLeanX, setLeanY, setManaged, setMargin, setMargin, setMaxHeight, setMaxSize, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinSize, setMinWidth, setName, setOpacity, setPadding, setPadding, setPaintable, setParent, setPickable, setPrefHeight, setPrefSize, setPrefSize, setPrefWidth, setProp, setRealClassName, setRotate, setScale, setScaleX, setScaleY, setSize, setSize, setSizeLocal, setSizeToBestSize, setSizeToPrefSize, setSpacing, setText, setToolTip, setToolTipEnabled, setTransX, setTransY, setVertical, setWidth, setX, setXY, setXYLocal, setY, stopAnimDeep, stopIntervals, toStringProps
Methods inherited from class snap.props.PropObject
addPropChangeListener, addPropChangeListener, firePropChange, firePropChange, firePropChange, getPropForName, getPropParent, getPropSet, getPropsForArchival, getPropsForArchivalExtra, getPropsString, isPropDefault, removePropChangeListener, removePropChangeListener, setPropsString, setPropValues, toString
-
Field Details
-
_helper
-
TYPE_MAIN
- See Also:
-
TYPE_UTILITY
- See Also:
-
TYPE_PLAIN
- See Also:
-
ActiveCursor_Prop
- See Also:
-
AlwaysOnTop_Prop
- See Also:
-
Image_Prop
- See Also:
-
Maximized_Prop
- See Also:
-
Resizable_Prop
- See Also:
-
Title_Prop
- See Also:
-
-
Constructor Details
-
WindowView
public WindowView()Creates a WindowView.
-
-
Method Details
-
getTitle
Returns the title of the window. -
setTitle
Sets the title of the window. -
getType
Returns the window type. -
setType
Sets the window type. -
isResizable
public boolean isResizable()Returns whether the window is resizable. -
setResizable
public void setResizable(boolean aValue) Sets whether the window is resizable (default to true). -
isMaximized
public boolean isMaximized()Returns whether the window is sized to maximum screen size. -
setMaximized
public void setMaximized(boolean aValue) Sets whether the window is sized to maximum screen size. -
getMaximizedBounds
Returns the window max size. -
setMaximizedBounds
Sets the bounds rect to use when window is maximized (uses ViewEnv ScreenBoundsInset by default). -
getSaveName
Returns the save name. -
setSaveName
Sets the save name. -
isSaveSize
public boolean isSaveSize()Returns whether to save size -
setSaveSize
public void setSaveSize(boolean aValue) Sets whether to save size. -
saveFrame
public void saveFrame()Save frame. -
getRootView
Returns the root view.- Overrides:
getRootView
in classView
-
getContent
Returns the content associated with this window. -
setContent
Sets the content associated with this window. -
getContentNative
Returns the native for the window content. -
isAlwaysOnTop
public boolean isAlwaysOnTop()Returns whether the window is always on top. -
setAlwaysOnTop
public void setAlwaysOnTop(boolean aValue) Sets whether the window is always on top. -
getDocURL
Returns the document file URL for the window title bar proxy icon. -
setDocURL
Returns the document file URL for the window title bar proxy icon. -
getImage
Returns the icon image for the window. -
setImage
Sets the icon image for the window. -
isHideOnDeactivate
public boolean isHideOnDeactivate()Returns whether the window will hide on deactivate. -
setHideOnDeactivate
public void setHideOnDeactivate(boolean aValue) Sets whether the window will hide on deacativate. -
isModal
public boolean isModal()Returns the modal mode of the window. -
setModal
public void setModal(boolean aValue) Sets the modal mode of the window (defaults to false). -
getFocusedView
Returns the view that currently receives KeyEvents. -
getFocusedViewLast
Returns the previous focus view. -
requestFocus
Tries to makes the given view the view that receives KeyEvents. -
getHelper
Returns the view helper. -
initNativeWindow
protected void initNativeWindow()Initializes the native window. -
showCentered
Shows window in center of given view. -
show
Show the window relative to given view and View X/Y (screen x/y if view is null). -
show
public void show()Shows window in center of screen. -
hide
public void hide()Hide the window. -
getClientView
Returns the view associated with the last show() call. -
pack
public void pack()Packs the window. -
toFront
public void toFront()Order window to front. -
getScreenLocation
Returns the screen location for given view, position and offsets. -
getWindow
Override to return this window. -
relayout
public void relayout()Override to do layout immediately.- Overrides:
relayout
in classParentView
-
repaint
public void repaint(double aX, double aY, double aW, double aH) Override to change to root view. -
isVisible
public boolean isVisible()Override to return showing, since it is eqivalent for window. -
setVisible
public void setVisible(boolean aValue) Override to call show/hide.- Overrides:
setVisible
in classView
-
setShowing
protected void setShowing(boolean aValue) Override to update global windows list.- Overrides:
setShowing
in classParentView
-
setFocused
protected void setFocused(boolean aValue) Override to move window to front of all windows list.- Overrides:
setFocused
in classView
-
getActiveCursor
Returns the active cursor. -
setActiveCursor
Sets the current cursor. -
resetActiveCursor
public void resetActiveCursor()Resets the active cursor. -
getToolTip
Override to try to get tool tip from mouse over stack.- Overrides:
getToolTip
in classView
-
getDispatcher
Returns the EventDispatcher. -
dispatchEventToWindow
Dispatch event. -
getUpdater
Returns the Updater.- Overrides:
getUpdater
in classView
-
getPopup
Returns the popup window, if one was added to root view during last event. -
setPopup
Sets the popup window, if one added to this root view during last event. -
getPrefWidthImpl
protected double getPrefWidthImpl(double aH) Returns the preferred width.- Overrides:
getPrefWidthImpl
in classView
-
getPrefHeightImpl
protected double getPrefHeightImpl(double aW) Returns the preferred height.- Overrides:
getPrefHeightImpl
in classView
-
layoutImpl
protected void layoutImpl()Layout children.- Overrides:
layoutImpl
in classParentView
-
getOpenWindows
Returns an array of all open windows. -
getOpenWindowOwner
Returns an array of all open windows. -
getOpenWindowOwners
Returns an array of all open windows.
-