com.openfin.desktop
Class WindowOptions

java.lang.Object
  extended by com.openfin.desktop.WindowOptions

public class WindowOptions
extends Object

A class representing the options for a Window.


Constructor Summary
WindowOptions()
          Default constructor
WindowOptions(org.json.JSONObject options)
          Constructs an instance with a new underlying JSONObject
WindowOptions(String name, String url)
          Contructor with name and url
 
Method Summary
 boolean getAutoShow()
          The AutoShow property represents a flag to automatically show the Window when it is created.
protected  boolean getBooleanValue(String property)
          Helper method to extract data field from underlying JSONObject
protected  boolean getBooleanValue(String property, boolean defaultValue)
          Helper method to extract data field from underlying JSONObject
 boolean getContextMenu()
          The ContextMenu property represents a flag to show the context menu when right-clicking on a window.
 int getCornerRoundingHeight()
          The CornerRoundingHeight property represents the rounded corners to apply.
 int getCornerRoundingWidth()
          The CornerRoundingHeight property represents the rounded corners to apply.
 boolean getDefaultCentered()
          The DefaultCentered property specifies that the window will be positioned in the center of the primary monitor when loaded for the first time on a machine.
 int getDefaultHeight()
          The DefaultWidth property represents the window's default height in pixels.
 int getDefaultLeft()
          The DefaultLeft property represents the window's default left position.
 int getDefaultTop()
          The DefaultTop property represents the window's default top position.
 int getDefaultWidth()
          The DefaultWidth property represents the window's default width in pixels.
protected  double getDoubleValue(String property)
          Helper method to extract data field from underlying JSONObject
 boolean getFrame()
          The Frame property represents a flag to show the frame.
 boolean getHideOnClose()
          The HideOnClose property represents a flag to allow a window to be hidden when the close button is clicked.
protected  int getIntegerValue(String property)
          Helper method to extract data field from underlying JSONObject
protected  org.json.JSONObject getJson()
          Helper method to copy a JSONObject
protected  org.json.JSONObject getJsonValue(String property)
          Helper method to extract data field from underlying JSONObject
 int getMaxHeight()
          The MaxHeight property represents the maximum height of a window.
 boolean getMaximizable()
          The Maximizable property represents a flag that lets the window be maximized.
 int getMaxWidth()
          The MaxWidth property represents the maximum width of a window.
 int getMinHeight()
          The MinHeight property represents the minimum height of a window.
 boolean getMinimizable()
           
 int getMinWidth()
          The MinWidth property represents the minimum width of a window.
 String getName()
          Get name of the window
 double getOpacity()
          The Opacity property represents a flag that specifies how transparent the window will be.
 boolean getResizable()
          The Resizable property represents a flag which allows the user to resize the window.
 int getResizeRegionBottomRightCorner()
          The ResizeRegionBottomRightCorner property defines an additional square region located at the bottom right corner of a frameless window.
 int getResizeRegionSize()
          The ResizeRegionSize property defines a region in pixels that will respond to user mouse interaction for resizing a frameless window
 boolean getSaveWindowState()
          The SaveWindowState property defines whether or not a window should maintain a persistent cache of its position/size.
 boolean getShowTaskbarIcon()
          The ShowTaskbarIcon property represents a flag to show the Window's icon in the taskbar.
 String getState()
          The State property represents a string that sets the window to be "minimized", "maximized", or "normal" on creation.
protected  String getStringValue(String property)
          Helper method to extract data field from underlying JSONObject
 String getTaskbarIcon()
          The TaskbarIcon property represents the URL of an icon to be shown on the desktop.
 String getUrl()
          Get URL of the window
 void setAutoShow(boolean autoShow)
          The AutoShow property represents a flag to automatically show the Window when it is created.
 void setContextMenu(boolean contextMenu)
          The ContextMenu property represents a flag to show the context menu when right-clicking on a window.
 void setCornerRounding(int width, int height)
          The CornerRoundingHeight property represents the rounded corners to apply.
 void setDefaultCentered(boolean defaultCentered)
          The DefaultCentered property specifies that the window will be positioned in the center of the primary monitor when loaded for the first time on a machine.
 void setDefaultHeight(int defaultHeight)
          The DefaultWidth property represents the window's default height in pixels.
 void setDefaultLeft(int defaultLeft)
          The DefaultLeft property represents the window's default left position.
 void setDefaultTop(int defaultTop)
          The DefaultTop property represents the window's default top position.
 void setDefaultWidth(int defaultWidth)
           
 void setFrame(boolean frame)
          The Frame property represents a flag to show the frame.
 void setHideOnClose(boolean hideOnClose)
          The HideOnClose property represents a flag to allow a window to be hidden when the close button is clicked.
 void setMaxHeight(int maxHeight)
          The MaxHeight property represents the maximum height of a window.
 void setMaximizable(boolean maximizable)
          The Maximizable property represents a flag that lets the window be maximized.
 void setMaxWidth(int maxWidth)
          The MaxWidth property represents the maximum width of a window.
 void setMinHeight(int minHeight)
          The MinHeight property represents the minimum height of a window.
 void setMinimizable(boolean maximizable)
          The Minimizable property represents a flag that lets the window be minimized.
 void setMinWidth(int minWidth)
          The MinWidth property represents the minimum width of a window.
 void setName(String name)
          Set name of the window
 void setOpacity(double opacity)
          The Opacity property represents a flag that specifies how transparent the window will be.
 void setResizable(boolean resizable)
          The Resizable property represents a flag which allows the user to resize the window.
 void setResizeRegionBottomRightCorner(int resizeRegionBottomRightCorner)
          The ResizeRegionBottomRightCorner property defines an additional square region located at the bottom right corner of a frameless window.
 void setResizeRegionSize(int resizeRegionSize)
          The ResizeRegionSize property defines a region in pixels that will respond to user mouse interaction for resizing a frameless window Default value: 2
 void setSaveWindowState(boolean saveWindowState)
          The SaveWindowState property defines whether or not a window should maintain a persistent cache of its position/size.
 void setShowTaskbarIcon(boolean showTaskbarIcon)
          The ShowTaskbarIcon property represents a flag to show the Window's icon in the taskbar.
 void setState(String state)
          The State property represents a string that sets the window to be "minimized", "maximized", or "normal" on creation.
 void setTaskbarIcon(String taskbarIcon)
          The TaskbarIcon property represents the URL of an icon to be shown on the desktop.
 void setUrl(String url)
          Set name of the window
 org.json.JSONObject toJsonObject()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WindowOptions

public WindowOptions()
Default constructor


WindowOptions

public WindowOptions(String name,
                     String url)
Contructor with name and url

Parameters:
name - name of the Window
url - URL of the window

WindowOptions

public WindowOptions(org.json.JSONObject options)
Constructs an instance with a new underlying JSONObject

Parameters:
options - underlying options
Method Detail

setShowTaskbarIcon

public void setShowTaskbarIcon(boolean showTaskbarIcon)
The ShowTaskbarIcon property represents a flag to show the Window's icon in the taskbar. Default: false

Parameters:
showTaskbarIcon - show taskbar icon if true

getName

public String getName()
Get name of the window

Returns:
name

setName

public void setName(String name)
Set name of the window

Parameters:
name - name of the Window

getUrl

public String getUrl()
Get URL of the window

Returns:
url of the Window

setUrl

public void setUrl(String url)
Set name of the window

Parameters:
url - name of the window

getShowTaskbarIcon

public boolean getShowTaskbarIcon()
The ShowTaskbarIcon property represents a flag to show the Window's icon in the taskbar. Default: false

Returns:
value of showTaskbarIcon

setDefaultWidth

public void setDefaultWidth(int defaultWidth)

getDefaultWidth

public int getDefaultWidth()
The DefaultWidth property represents the window's default width in pixels. Default: 800

Returns:
value of defaultWidth

setDefaultHeight

public void setDefaultHeight(int defaultHeight)
The DefaultWidth property represents the window's default height in pixels. Default: 500

Parameters:
defaultHeight - value of defaultHeight

getDefaultHeight

public int getDefaultHeight()
The DefaultWidth property represents the window's default height in pixels. Default: 500

Returns:
value of defaultHeight

setDefaultTop

public void setDefaultTop(int defaultTop)
The DefaultTop property represents the window's default top position. Default: 100

Parameters:
defaultTop - value of defaultTop

getDefaultTop

public int getDefaultTop()
The DefaultTop property represents the window's default top position. Default: 100

Returns:
value of defaultTop

setDefaultLeft

public void setDefaultLeft(int defaultLeft)
The DefaultLeft property represents the window's default left position. Default: 100

Parameters:
defaultLeft - value of defaultLeft

getDefaultLeft

public int getDefaultLeft()
The DefaultLeft property represents the window's default left position. Default: 100

Returns:
value of defaultLeft

setFrame

public void setFrame(boolean frame)
The Frame property represents a flag to show the frame. Default: true

Parameters:
frame - value of frame

getFrame

public boolean getFrame()
The Frame property represents a flag to show the frame. Default: true

Returns:
value of frame

setResizable

public void setResizable(boolean resizable)
The Resizable property represents a flag which allows the user to resize the window. This property will be deprecated in a future release. Default: true

Parameters:
resizable - value of resizable

getResizable

public boolean getResizable()
The Resizable property represents a flag which allows the user to resize the window. This property will be deprecated in a future release. Default: true

Returns:
value of resizable

setAutoShow

public void setAutoShow(boolean autoShow)
The AutoShow property represents a flag to automatically show the Window when it is created. Default: false

Parameters:
autoShow - value of autoShow

getAutoShow

public boolean getAutoShow()
The AutoShow property represents a flag to automatically show the Window when it is created. Default: false

Returns:
value of autoShow

setState

public void setState(String state)
The State property represents a string that sets the window to be "minimized", "maximized", or "normal" on creation. Default: "normal"

Parameters:
state - value of state

getState

public String getState()
The State property represents a string that sets the window to be "minimized", "maximized", or "normal" on creation. Default: "normal"

Returns:
value of state

setOpacity

public void setOpacity(double opacity)
The Opacity property represents a flag that specifies how transparent the window will be. Default: 1.0

Parameters:
opacity - value of opacity

getOpacity

public double getOpacity()
The Opacity property represents a flag that specifies how transparent the window will be. Default: 1.0

Returns:
value of opacity

setCornerRounding

public void setCornerRounding(int width,
                              int height)
The CornerRoundingHeight property represents the rounded corners to apply.

Parameters:
width - width of rounded corners
height - height of rounded corners

getCornerRoundingHeight

public int getCornerRoundingHeight()
The CornerRoundingHeight property represents the rounded corners to apply.

Returns:
height of rounded corners

getCornerRoundingWidth

public int getCornerRoundingWidth()
The CornerRoundingHeight property represents the rounded corners to apply.

Returns:
width of of rounded corners

setMinWidth

public void setMinWidth(int minWidth)
The MinWidth property represents the minimum width of a window. Default: 0

Parameters:
minWidth - value of minWidth

getMinWidth

public int getMinWidth()
The MinWidth property represents the minimum width of a window. Default: 0

Returns:
value of minWidth

setMaxWidth

public void setMaxWidth(int maxWidth)
The MaxWidth property represents the maximum width of a window. Will default to the OS defined value if set to -1. Default: -1

Parameters:
maxWidth - value of maxWidth

getMaxWidth

public int getMaxWidth()
The MaxWidth property represents the maximum width of a window. Will default to the OS defined value if set to -1. Default: -1

Returns:
value of maxWidth

setMinHeight

public void setMinHeight(int minHeight)
The MinHeight property represents the minimum height of a window. Default: 0

Parameters:
minHeight - value of minHeight

getMinHeight

public int getMinHeight()
The MinHeight property represents the minimum height of a window. Default: 0

Returns:
value of minHeight

setMaxHeight

public void setMaxHeight(int maxHeight)
The MaxHeight property represents the maximum height of a window. Will default to the OS defined value if set to -1. Default: -1

Parameters:
maxHeight - value of maxHeight

getMaxHeight

public int getMaxHeight()
The MaxHeight property represents the maximum height of a window. Will default to the OS defined value if set to -1. Default: -1

Returns:
value of maxHeight

setSaveWindowState

public void setSaveWindowState(boolean saveWindowState)
The SaveWindowState property defines whether or not a window should maintain a persistent cache of its position/size. Default: true

Parameters:
saveWindowState - value of saveWindowState

getSaveWindowState

public boolean getSaveWindowState()
The SaveWindowState property defines whether or not a window should maintain a persistent cache of its position/size. Default: true

Returns:
value of saveWindowState

setMinimizable

public void setMinimizable(boolean maximizable)
The Minimizable property represents a flag that lets the window be minimized. Default: true

Parameters:
maximizable - value of maximizable

getMinimizable

public boolean getMinimizable()

setMaximizable

public void setMaximizable(boolean maximizable)
The Maximizable property represents a flag that lets the window be maximized. Default: true

Parameters:
maximizable - value of maximizable

getMaximizable

public boolean getMaximizable()
The Maximizable property represents a flag that lets the window be maximized. Default: true

Returns:
value of maximizable

setHideOnClose

public void setHideOnClose(boolean hideOnClose)
The HideOnClose property represents a flag to allow a window to be hidden when the close button is clicked.

Parameters:
hideOnClose - value of hideOnClose

getHideOnClose

public boolean getHideOnClose()
The HideOnClose property represents a flag to allow a window to be hidden when the close button is clicked.

Returns:
value of hideOnClose

setContextMenu

public void setContextMenu(boolean contextMenu)
The ContextMenu property represents a flag to show the context menu when right-clicking on a window. Default: false

Parameters:
contextMenu - value of contextMenu

getContextMenu

public boolean getContextMenu()
The ContextMenu property represents a flag to show the context menu when right-clicking on a window. Default: false

Returns:
value of contextMenu

setTaskbarIcon

public void setTaskbarIcon(String taskbarIcon)
The TaskbarIcon property represents the URL of an icon to be shown on the desktop.

Parameters:
taskbarIcon - value of taskbarIcon

getTaskbarIcon

public String getTaskbarIcon()
The TaskbarIcon property represents the URL of an icon to be shown on the desktop.

Returns:
value of taskbarIcon

setResizeRegionBottomRightCorner

public void setResizeRegionBottomRightCorner(int resizeRegionBottomRightCorner)
The ResizeRegionBottomRightCorner property defines an additional square region located at the bottom right corner of a frameless window. Default value: 4

Parameters:
resizeRegionBottomRightCorner - an additional square region

getResizeRegionBottomRightCorner

public int getResizeRegionBottomRightCorner()
The ResizeRegionBottomRightCorner property defines an additional square region located at the bottom right corner of a frameless window.

Returns:
value of resizeRegionBottomRightCorner, or -1 if it is not set

setResizeRegionSize

public void setResizeRegionSize(int resizeRegionSize)
The ResizeRegionSize property defines a region in pixels that will respond to user mouse interaction for resizing a frameless window Default value: 2

Parameters:
resizeRegionSize - new value of resizeRegionSize

getResizeRegionSize

public int getResizeRegionSize()
The ResizeRegionSize property defines a region in pixels that will respond to user mouse interaction for resizing a frameless window

Returns:
value of resizeRegionSize, or -1 if it is not set

setDefaultCentered

public void setDefaultCentered(boolean defaultCentered)
The DefaultCentered property specifies that the window will be positioned in the center of the primary monitor when loaded for the first time on a machine. Default: false

Parameters:
defaultCentered - new value of defaultCentered

getDefaultCentered

public boolean getDefaultCentered()
The DefaultCentered property specifies that the window will be positioned in the center of the primary monitor when loaded for the first time on a machine. Default: false

Returns:
value of defaultCentered

toJsonObject

public org.json.JSONObject toJsonObject()
Returns:
underlying JSONObject of this object

getJson

protected org.json.JSONObject getJson()
Helper method to copy a JSONObject

Returns:
json object

getStringValue

protected String getStringValue(String property)
Helper method to extract data field from underlying JSONObject

Returns:
String value of a field

getIntegerValue

protected int getIntegerValue(String property)
Helper method to extract data field from underlying JSONObject

Returns:
Integer value of a field

getDoubleValue

protected double getDoubleValue(String property)
Helper method to extract data field from underlying JSONObject

Returns:
Double value of a field

getBooleanValue

protected boolean getBooleanValue(String property)
Helper method to extract data field from underlying JSONObject

Returns:
Boolean value of a field

getBooleanValue

protected boolean getBooleanValue(String property,
                                  boolean defaultValue)
Helper method to extract data field from underlying JSONObject

Returns:
Boolean value of a field

getJsonValue

protected org.json.JSONObject getJsonValue(String property)
Helper method to extract data field from underlying JSONObject

Returns:
JSONObject value of a field


Copyright © 2016. All rights reserved.