public class WindowInfo extends Object implements Persistent
set
methods (setX
, setY
,
setHeight
, etc) are immediately reflected on the
window.
The update
methods doesn't update the window, because
they are used to update the WindowInfo object when the associated
window was modified by user interaction.Modifier and Type | Class and Description |
---|---|
static class |
WindowInfo.RegisterPersistence |
Modifier and Type | Field and Description |
---|---|
static Integer |
DIALOG_PROFILE
Specifies that this window has an editor profile
|
static Integer |
EDITOR_PROFILE
Specifies that this window has an editor profile
|
static int |
ICONIFIABLE
Specifies that the window is iconifiable
|
static int |
MAXIMIZABLE
Specifies that the window is maximizable
|
static int |
MODALDIALOG
Specifies that the window is modal
|
static int |
MODELESSDIALOG
Specifies that the window is modeless (it's on the top but doesn't block any other window)
|
static int |
NOTCLOSABLE
Specifies that the window may be closed
|
static int |
PALETTE
Specifies that the window may be docked inside another window
|
static String |
PERSISTENCE_DEFINITION_NAME |
static Integer |
PROJECT_PROFILE
Specifies that this window has an editor profile
|
static Integer |
PROPERTIES_PROFILE
Specifies that this window has an editor profile
|
static int |
RESIZABLE
Specifies that the window is resizable
|
static Integer |
TOOL_PROFILE
Specifies that this window has an editor profile
|
Constructor and Description |
---|
WindowInfo()
Creates a new WindowInfo object with the default properties:
not resizable
not maximizable
not iconifiable
not modal
not modeless
not palette
|
WindowInfo(int code)
Creates a new WindowInfo object with the provided properties.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
Adds a PropertyChangeListener to the listener list.
|
boolean |
checkPersistence()
Checks if the geometry of this window should be persisted in the
project file.
|
static WindowInfo |
createFromXMLEntity(XMLEntity xml)
Creates a WindowInfo object from an XMLEntity containing the
window properties.
|
String |
getAdditionalInfo()
Obtiene información adicional de la ventana.
|
Rectangle |
getBounds()
Gets the bounds of the associated window.
|
int |
getHeight()
Gets the window height.
|
int |
getId()
Gets the window ID.
|
Dimension |
getMinimumSize()
Gets the minimum allowed size for the associated window.
|
Rectangle |
getNormalBounds()
Gets the normal bounds of the associated window.
|
int |
getNormalHeight()
Gets the height of the window's origin when the window is not
maximized.
|
int |
getNormalWidth()
Gets the width of the window's origin when the window is not
maximized.
|
int |
getNormalX() |
int |
getNormalY()
Gets the x coordinate of the window's origin when the window is not
maximized.
|
void |
getPropertiesFromXMLEntity(XMLEntity xml)
Updates this WindowInfo object according to the properties
provided by the XMLEntity parameter.
|
Map |
getSelectedTools()
Gets the list of selected tools for this window.
|
String |
getTitle()
Gets the title property
|
int |
getWidth()
Gets the window width.
|
int |
getX()
Returns the current x coordinate of the window's origin
(left-upper corner of the window).
|
XMLEntity |
getXMLEntity()
Gets the window properties in an XMLEntity object, suitable
for persistence.
|
int |
getY()
Gets the value of the y coordinate for the origin
(left-upper corner of the window) of the associated
window.
|
boolean |
isClosed()
Finds out whether a view is open (showing) or closed
|
boolean |
isIconifiable()
Determines whether the associated window is iconifiable or not
|
boolean |
isMaximizable()
Determines whether the associated window is maximizable or not
|
boolean |
isMaximized()
Determines whether the window is maximized or not
|
boolean |
isModal()
Determines whether the associated window is modal or not
|
boolean |
isModeless()
Determines whether the associated window is modeless
(it is on the top but does not block any other window)
|
boolean |
isNotClosable()
Determines whether the associated window is closable or not
|
boolean |
isPalette()
Determines whether the associated dockable window is
currently in palette status or docked.
|
boolean |
isResizable()
Determines whether the associated window is resizable or not
|
boolean |
isVisible()
Determines whether the associated window is visible
|
void |
loadFromState(PersistentState state)
Set the state of the object from the state passed as parameter.
|
boolean |
needPack() |
void |
removePropertyChangeListener(PropertyChangeListener listener)
Remove a PropertyChangeListener from the listener list.
|
void |
saveToState(PersistentState state)
Saves the internal state of the object on the provided
PersistentState object.
|
void |
setAdditionalInfo(String additionalInfo)
Asigna información adicional de la ventana.
|
void |
setBounds(Rectangle bounds)
Sets the bounds of the associated window.
|
void |
setClosed(boolean closed)
Specifies whether a view is open (showing) or closed
|
void |
setHeight(int height)
Sets the window height.
|
void |
setId(int id)
Sets the window's ID.
|
void |
setMaximizable(boolean maximizable) |
void |
setMaximized(boolean maximized)
Maximize the associated window
|
void |
setMinimumSize(Dimension minSize)
Sets the minimum allowed size for the associated window.
|
void |
setNeedPack(boolean needPack) |
void |
setNormalBounds(int x,
int y,
int width,
int height)
Sets the normal bounds of the associated window.
|
void |
setNormalBounds(Rectangle normalBounds)
Sets the normal bounds of the associated window.
|
void |
setNormalHeight(int normalHeight)
Sets the normalHeight property for this WindowInfo object.
|
void |
setNormalWidth(int normalWidth)
Sets the normalWidth property for this WindowInfo object.
|
void |
setNormalX(int normalX)
Sets the normalX property for this WindowInfo object.
|
void |
setNormalY(int normalY)
Sets the normalY property for this WindowInfo object.
|
void |
setNotClosable(boolean b)
Sets notclosable property
|
void |
setPersistence(boolean persist)
Set whether the geometry of this window should be persisted in the
project files.
|
void |
setSelectedTool(String selectedTool)
Deprecated.
|
void |
setSelectedTools(Map selectedTools)
Sets the list of selected tools for this window.
|
void |
setTitle(String title)
Sets the title property.
|
void |
setWidth(int w)
Sets the width property for the associated Window.
|
void |
setWindowInfo(WindowInfo vi)
Updates all the properties in this object so that
they match the properties of the provided
wi object. |
void |
setX(int x)
Sets the x coordinate of the window's origin
(left-upper corner of the window).
|
void |
setY(int y)
Sets the value of the y coordinate for the origin
(left-upper corner of the window) of the associated
window.
|
void |
toPalette(boolean b)
Sets whether the window is in palette mode or is in docked mode.
|
void |
updateBounds(int x,
int y,
int width,
int height)
Updates the bounds for this WindowInfo object.
|
void |
updateBounds(Rectangle bounds)
Updates the bounds for this WindowInfo object.
|
void |
updateClosed(boolean closed)
Updates the closed property for this WindowInfo
object.
|
void |
updateHeight(int height)
Updates the height property for this WindowInfo
object.
|
void |
updateMaximized(boolean maximized)
Updates the maximized property for this WindowInfo
object.
|
void |
updateMinimumSize(Dimension minSize)
Updates the minimum allowed size for the associated window.
|
void |
updateNormalBounds(int x,
int y,
int width,
int height)
Updates the normal bounds for this WindowInfo object.
|
void |
updateNormalBounds(Rectangle normalBounds)
Updates the normal bounds for this WindowInfo object.
|
void |
updateNormalHeight(int normalHeight)
Updates the normalHeight property for this WindowInfo
object.
|
void |
updateNormalWidth(int normalWidth)
Updates the normalWidth property for this WindowInfo
object.
|
void |
updateNormalX(int normalX)
Updates the normalX property for this WindowInfo
object.
|
void |
updateNormalY(int normalY)
Updates the normalY property for this WindowInfo
object.
|
void |
updateTitle(String title)
Updates the title property for for this WindowInfo
object.
|
void |
updateWidth(int width)
Updates the width property for for this WindowInfo
object.
|
void |
updateX(int x)
Updates the value of the x coordinate for this WindowInfo
object.
|
void |
updateY(int y)
Updates the value of the y coordinate for this WindowInfo
object.
|
public static final String PERSISTENCE_DEFINITION_NAME
public static final int RESIZABLE
public static final int MAXIMIZABLE
public static final int ICONIFIABLE
public static final int MODALDIALOG
public static final int MODELESSDIALOG
public static final int PALETTE
public static final int NOTCLOSABLE
public static final Integer EDITOR_PROFILE
public static final Integer TOOL_PROFILE
public static final Integer PROJECT_PROFILE
public static final Integer PROPERTIES_PROFILE
public static final Integer DIALOG_PROFILE
public WindowInfo(int code)
Properties can be set together by using the binary OR operator "|". For example:
WindowInfo wi = new WindowInfo(WindowInfo.MODELESSDIALOG
|WindowInfo.ICONIFIABLE|WindowInfo.RESIZABLE).
The WindowInfo.MODELESSDIALOG and WindowInfo.MODALDIALOG properties cannot be set at the same time
code
- Bit-or of the window properties.IllegalStateException
- If incompatible properties are set together,
for example, if MODALDIALOG and MODELESSDIALGO are set together.public WindowInfo()
public boolean needPack()
public void setNeedPack(boolean needPack)
public void addPropertyChangeListener(PropertyChangeListener listener)
listener
- public void removePropertyChangeListener(PropertyChangeListener listener)
listener
- public int getX()
public void setX(int x)
x
- The value (in pixels) of the x coordinate to set.public void updateX(int x)
x
- The value (in pixels) of the x coordinatepublic int getY()
public void setY(int y)
y
- The value (in pixels) of the y coordinatepublic void updateY(int y)
y
- The value (in pixels) of the y coordinatepublic boolean isIconifiable()
public boolean isMaximizable()
public boolean isResizable()
public boolean isModal()
public int getHeight()
public int getWidth()
public void setHeight(int height)
The
- window height (in pixels)public void updateHeight(int height)
setHeight
for that).height
- The height value for this WindowInfo objectpublic void setWidth(int w)
w
- The new width.public void updateWidth(int width)
setWidth
for that).height
- The height value for this WindowInfo objectpublic String getTitle()
public void setTitle(String title)
title
- The new title.public void updateTitle(String title)
setTitle
for that).title
- The title value for this WindowInfo objectpublic boolean isModeless()
public boolean isNotClosable()
public void setNotClosable(boolean b)
public boolean isVisible()
public boolean isPalette()
public void setId(int id)
id
- An integer to identify the window. Different
windows must have different IDs.public int getId()
public void setWindowInfo(WindowInfo vi)
wi
object. The changes are not reflected on the
window, just the WindowInfo object is updated.vi
- A WindowInfo object containing the new
properties of the window.public void toPalette(boolean b)
b
- public Map getSelectedTools()
public void setSelectedTool(String selectedTool)
setSelectedTools(HashMap selectedTool)
selectedTool
- public void setSelectedTools(Map selectedTools)
selectedTools
- A HashMap containing pairs
(group, actionCommand), which will be set as the selected tools
for this window.public boolean isClosed()
public void setClosed(boolean closed)
public void updateClosed(boolean closed)
setClosed
for that).closed
- The new closed property for this WindowInfo objectpublic void setNormalX(int normalX)
normalX
- The new normalX property for this WindowInfo objectpublic void updateNormalX(int normalX)
setNormalX
for that).normalX
- The new normalX property for this WindowInfo objectpublic void setNormalY(int normalY)
normalY
- The new normalY property for this WindowInfo objectpublic void updateNormalY(int normalY)
setNormalY
for that).normalY
- The new normalY property for this WindowInfo objectpublic void setNormalHeight(int normalHeight)
normalY
- The new normalHeight property for this WindowInfo objectpublic void updateNormalHeight(int normalHeight)
setNormalHeight
for that).normalHeight
- The new normalHeight property for this WindowInfo objectpublic void setNormalWidth(int normalWidth)
normalY
- The new normalWidth property for this WindowInfo objectpublic void setMinimumSize(Dimension minSize)
minSize
- The minimum allowed size for the associated window.public void updateMinimumSize(Dimension minSize)
setMinimumSize
for that).minSize
- The minimum allowed size for the associated window.public Dimension getMinimumSize()
public void updateNormalWidth(int normalWidth)
setNormalWidth
for that).normalWidth
- The new normalHeight property for this WindowInfo objectpublic void setMaximized(boolean maximized)
maximized
- public void updateMaximized(boolean maximized)
setMaximized
for that).maximized
- The new maximized property for this WindowInfo objectpublic void setMaximizable(boolean maximizable)
public void updateBounds(int x, int y, int width, int height)
setBounds
for that).x
- y
- width
- height
- public void setNormalBounds(int x, int y, int width, int height)
x
- y
- width
- height
- public void updateNormalBounds(int x, int y, int width, int height)
setNormalBounds
for that).x
- y
- width
- height
- public Rectangle getNormalBounds()
public void setNormalBounds(Rectangle normalBounds)
normalBounds
- public void updateNormalBounds(Rectangle normalBounds)
setNormalBounds
for that).normalBounds
- public void setBounds(Rectangle bounds)
bounds
- public void updateBounds(Rectangle bounds)
setBounds
for that).bounds
- public Rectangle getBounds()
public int getNormalX()
public int getNormalY()
public int getNormalHeight()
public int getNormalWidth()
public boolean isMaximized()
public boolean checkPersistence()
public void setPersistence(boolean persist)
persist
- public XMLEntity getXMLEntity()
SaveException
XMLException
public static WindowInfo createFromXMLEntity(XMLEntity xml)
xml
- An XMLEntity object containing the window propertiespublic void getPropertiesFromXMLEntity(XMLEntity xml)
xml
- An XMLEntity object containing the window propertiespublic String getAdditionalInfo()
public void setAdditionalInfo(String additionalInfo)
public void saveToState(PersistentState state) throws PersistenceException
Persistent
saveToState
in interface Persistent
PersistenceException
public void loadFromState(PersistentState state) throws PersistenceException
Persistent
loadFromState
in interface Persistent
PersistenceException