Package org.gvsig.andami.ui.mdiManager
Class WindowInfo
java.lang.Object
org.gvsig.andami.ui.mdiManager.WindowInfo
- All Implemented Interfaces:
org.gvsig.tools.persistence.Persistent
This class represents the state of the associated window.
The
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.- Author:
- Fernando González Cortés
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final IntegerSpecifies that this window has an editor profilestatic final IntegerSpecifies that this window has an editor profilestatic final intSpecifies that the window is iconifiablestatic final intSpecifies that the window is maximizablestatic final intSpecifies that the window is modalstatic final intSpecifies that the window is modeless (it's on the top but doesn't block any other window)static final intSpecifies that the window may be closedstatic final intSpecifies that the window may be docked inside another windowstatic final Stringstatic final IntegerSpecifies that this window has an editor profilestatic final IntegerSpecifies that this window has an editor profilestatic final intSpecifies that the window is resizablestatic final IntegerSpecifies that this window has an editor profile -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new WindowInfo object with the default properties: not resizable not maximizable not iconifiable not modal not modeless not paletteWindowInfo(int code) Creates a new WindowInfo object with the provided properties. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a PropertyChangeListener to the listener list.booleanChecks if the geometry of this window should be persisted in the project file.static WindowInfocreateFromXMLEntity(org.gvsig.utils.XMLEntity xml) Creates a WindowInfo object from an XMLEntity containing the window properties.Obtiene información adicional de la ventana.Gets the bounds of the associated window.intGets the window height.intgetId()Gets the window ID.Gets the minimum allowed size for the associated window.Gets the normal bounds of the associated window.intGets the height of the window's origin when the window is not maximized.intGets the width of the window's origin when the window is not maximized.intintGets the x coordinate of the window's origin when the window is not maximized.voidgetPropertiesFromXMLEntity(org.gvsig.utils.XMLEntity xml) Updates this WindowInfo object according to the properties provided by the XMLEntity parameter.Gets the list of selected tools for this window.getTitle()Gets the title propertyintgetWidth()Gets the window width.intgetX()Returns the current x coordinate of the window's origin (left-upper corner of the window).org.gvsig.utils.XMLEntityGets the window properties in an XMLEntity object, suitable for persistence.intgetY()Gets the value of the y coordinate for the origin (left-upper corner of the window) of the associated window.booleanisClosed()Finds out whether a view is open (showing) or closedbooleanDetermines whether the associated window is iconifiable or notbooleanDetermines whether the associated window is maximizable or notbooleanDetermines whether the window is maximized or notbooleanisModal()Determines whether the associated window is modal or notbooleanDetermines whether the associated window is modeless (it is on the top but does not block any other window)booleanDetermines whether the associated window is closable or notbooleanDetermines whether the associated dockable window is currently in palette status or docked.booleanDetermines whether the associated window is resizable or notbooleanDetermines whether the associated window is visiblevoidloadFromState(org.gvsig.tools.persistence.PersistentState state) booleanneedPack()voidRemove a PropertyChangeListener from the listener list.voidsaveToState(org.gvsig.tools.persistence.PersistentState state) voidsetAdditionalInfo(String additionalInfo) Asigna información adicional de la ventana.voidSets the bounds of the associated window.voidsetClosed(boolean closed) Specifies whether a view is open (showing) or closedvoidsetHeight(int height) Sets the window height.voidsetId(int id) Sets the window's ID.voidsetMaximizable(boolean maximizable) voidsetMaximized(boolean maximized) Maximize the associated windowvoidsetMinimumSize(Dimension minSize) Sets the minimum allowed size for the associated window.voidsetNeedPack(boolean needPack) voidsetNormalBounds(int x, int y, int width, int height) Sets the normal bounds of the associated window.voidsetNormalBounds(Rectangle normalBounds) Sets the normal bounds of the associated window.voidsetNormalHeight(int normalHeight) Sets the normalHeight property for this WindowInfo object.voidsetNormalWidth(int normalWidth) Sets the normalWidth property for this WindowInfo object.voidsetNormalX(int normalX) Sets the normalX property for this WindowInfo object.voidsetNormalY(int normalY) Sets the normalY property for this WindowInfo object.voidsetNotClosable(boolean b) Sets notclosable propertyvoidsetPersistence(boolean persist) Set whether the geometry of this window should be persisted in the project files.voidsetSelectedTool(String selectedTool) voidsetSelectedTools(Map selectedTools) Sets the list of selected tools for this window.voidSets the title property.voidsetWidth(int w) Sets the width property for the associated Window.voidUpdates all the properties in this object so that they match the properties of the providedwiobject.voidsetX(int x) Sets the x coordinate of the window's origin (left-upper corner of the window).voidsetY(int y) Sets the value of the y coordinate for the origin (left-upper corner of the window) of the associated window.voidtoPalette(boolean b) Sets whether the window is in palette mode or is in docked mode.voidupdateBounds(int x, int y, int width, int height) Updates the bounds for this WindowInfo object.voidupdateBounds(Rectangle bounds) Updates the bounds for this WindowInfo object.voidupdateClosed(boolean closed) Updates the closed property for this WindowInfo object.voidupdateHeight(int height) Updates the height property for this WindowInfo object.voidupdateMaximized(boolean maximized) Updates the maximized property for this WindowInfo object.voidupdateMinimumSize(Dimension minSize) Updates the minimum allowed size for the associated window.voidupdateNormalBounds(int x, int y, int width, int height) Updates the normal bounds for this WindowInfo object.voidupdateNormalBounds(Rectangle normalBounds) Updates the normal bounds for this WindowInfo object.voidupdateNormalHeight(int normalHeight) Updates the normalHeight property for this WindowInfo object.voidupdateNormalWidth(int normalWidth) Updates the normalWidth property for this WindowInfo object.voidupdateNormalX(int normalX) Updates the normalX property for this WindowInfo object.voidupdateNormalY(int normalY) Updates the normalY property for this WindowInfo object.voidupdateTitle(String title) Updates the title property for for this WindowInfo object.voidupdateWidth(int width) Updates the width property for for this WindowInfo object.voidupdateX(int x) Updates the value of the x coordinate for this WindowInfo object.voidupdateY(int y) Updates the value of the y coordinate for this WindowInfo object.
-
Field Details
-
PERSISTENCE_DEFINITION_NAME
- See Also:
-
RESIZABLE
public static final int RESIZABLESpecifies that the window is resizable- See Also:
-
MAXIMIZABLE
public static final int MAXIMIZABLESpecifies that the window is maximizable- See Also:
-
ICONIFIABLE
public static final int ICONIFIABLESpecifies that the window is iconifiable- See Also:
-
MODALDIALOG
public static final int MODALDIALOGSpecifies that the window is modal- See Also:
-
MODELESSDIALOG
public static final int MODELESSDIALOGSpecifies that the window is modeless (it's on the top but doesn't block any other window)- See Also:
-
PALETTE
public static final int PALETTESpecifies that the window may be docked inside another window- See Also:
-
NOTCLOSABLE
public static final int NOTCLOSABLESpecifies that the window may be closed- See Also:
-
EDITOR_PROFILE
Specifies that this window has an editor profile -
TOOL_PROFILE
Specifies that this window has an editor profile -
PROJECT_PROFILE
Specifies that this window has an editor profile -
PROPERTIES_PROFILE
Specifies that this window has an editor profile -
DIALOG_PROFILE
Specifies that this window has an editor profile
-
-
Constructor Details
-
WindowInfo
public WindowInfo(int code) Creates a new WindowInfo object with the provided properties. Valid properties include:- WindowInfo.MODALDIALOG
- WindowInfo.MODELESSDIALOG
- WindowInfo.PALETTE
- WindowInfo.ICONIFIABLE
- WindowInfo.RESIZABLE
- WindowInfo.MAXIMIZABLE
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
- Parameters:
code- Bit-or of the window properties.- Throws:
IllegalStateException- If incompatible properties are set together, for example, if MODALDIALOG and MODELESSDIALGO are set together.
-
WindowInfo
public WindowInfo()Creates a new WindowInfo object with the default properties:- not resizable
- not maximizable
- not iconifiable
- not modal
- not modeless
- not palette
-
-
Method Details
-
needPack
public boolean needPack() -
setNeedPack
public void setNeedPack(boolean needPack) -
addPropertyChangeListener
Adds a PropertyChangeListener to the listener list. The listener will be notified about changes in this object.- Parameters:
listener-
-
removePropertyChangeListener
Remove a PropertyChangeListener from the listener list. The listener will not be notified anymore about changes in this object.- Parameters:
listener-
-
getX
public int getX()Returns the current x coordinate of the window's origin (left-upper corner of the window).- Returns:
- Returns the value (in pixels) of the x coordinate of the window's origin.
-
setX
public void setX(int x) Sets the x coordinate of the window's origin (left-upper corner of the window).- Parameters:
x- The value (in pixels) of the x coordinate to set.
-
updateX
public void updateX(int x) Updates the value of the x coordinate for this WindowInfo object. It doesn't get reflected on the window (use setX for that).- Parameters:
x- The value (in pixels) of the x coordinate
-
getY
public int getY()Gets the value of the y coordinate for the origin (left-upper corner of the window) of the associated window.- Returns:
- Returns the y coordinate (in pixels).
-
setY
public void setY(int y) Sets the value of the y coordinate for the origin (left-upper corner of the window) of the associated window.- Parameters:
y- The value (in pixels) of the y coordinate
-
updateY
public void updateY(int y) Updates the value of the y coordinate for this WindowInfo object. It doesn't get reflected on the window (use setY for that).- Parameters:
y- The value (in pixels) of the y coordinate
-
isIconifiable
public boolean isIconifiable()Determines whether the associated window is iconifiable or not- Returns:
-
isMaximizable
public boolean isMaximizable()Determines whether the associated window is maximizable or not- Returns:
-
isResizable
public boolean isResizable()Determines whether the associated window is resizable or not- Returns:
-
isModal
public boolean isModal()Determines whether the associated window is modal or not- Returns:
-
getHeight
public int getHeight()Gets the window height.- Returns:
- The window height (in pixels).
-
getWidth
public int getWidth()Gets the window width.- Returns:
- The window width (in pixels).
-
setHeight
public void setHeight(int height) Sets the window height.- Parameters:
The- window height (in pixels)
-
updateHeight
public void updateHeight(int height) Updates the height property for this WindowInfo object. It doesn't get reflected on the window (usesetHeightfor that).- Parameters:
height- The height value for this WindowInfo object
-
setWidth
public void setWidth(int w) Sets the width property for the associated Window.- Parameters:
w- The new width.
-
updateWidth
public void updateWidth(int width) Updates the width property for for this WindowInfo object. It doesn't get reflected on the window (usesetWidthfor that).- Parameters:
height- The height value for this WindowInfo object
-
getTitle
Gets the title property- Returns:
-
setTitle
Sets the title property.- Parameters:
title- The new title.
-
updateTitle
Updates the title property for for this WindowInfo object. It doesn't get reflected on the window (usesetTitlefor that).- Parameters:
title- The title value for this WindowInfo object
-
isModeless
public boolean isModeless()Determines whether the associated window is modeless (it is on the top but does not block any other window)- Returns:
-
isNotClosable
public boolean isNotClosable()Determines whether the associated window is closable or not- Returns:
-
setNotClosable
public void setNotClosable(boolean b) Sets notclosable property -
isVisible
public boolean isVisible()Determines whether the associated window is visible- Returns:
- true if the associated window is visible, false if it is hidden
-
isPalette
public boolean isPalette()Determines whether the associated dockable window is currently in palette status or docked.- Returns:
- true if the window is currently in palette status, false if it is docked in another window
-
setId
public void setId(int id) Sets the window's ID.- Parameters:
id- An integer to identify the window. Different windows must have different IDs.
-
getId
public int getId()Gets the window ID.- Returns:
- id An integer to identify the window. Different windows must have different IDs.
-
setWindowInfo
Updates all the properties in this object so that they match the properties of the providedwiobject. The changes are not reflected on the window, just the WindowInfo object is updated.- Parameters:
vi- A WindowInfo object containing the new properties of the window.
-
toPalette
public void toPalette(boolean b) Sets whether the window is in palette mode or is in docked mode. This method does not update the window status, it just updates the WindowInfo object. Use the IWindowTransform interface to actually change the window status.- Parameters:
b-
-
getSelectedTools
Gets the list of selected tools for this window.- Returns:
- A HashMap containing pairs (group, actionCommand), which are the selected tools for this window.
-
setSelectedTool
- Parameters:
selectedTool-
-
setSelectedTools
Sets the list of selected tools for this window.- Parameters:
selectedTools- A HashMap containing pairs (group, actionCommand), which will be set as the selected tools for this window.
-
isClosed
public boolean isClosed()Finds out whether a view is open (showing) or closed -
setClosed
public void setClosed(boolean closed) Specifies whether a view is open (showing) or closed -
updateClosed
public void updateClosed(boolean closed) Updates the closed property for this WindowInfo object. It doesn't get reflected on the window (usesetClosedfor that).- Parameters:
closed- The new closed property for this WindowInfo object
-
setNormalX
public void setNormalX(int normalX) Sets the normalX property for this WindowInfo object. This sets the X position that the window would have when it gets restored from the maximized state.- Parameters:
normalX- The new normalX property for this WindowInfo object
-
updateNormalX
public void updateNormalX(int normalX) Updates the normalX property for this WindowInfo object. It doesn't get reflected on the window (usesetNormalXfor that).- Parameters:
normalX- The new normalX property for this WindowInfo object
-
setNormalY
public void setNormalY(int normalY) Sets the normalY property for this WindowInfo object. This sets the Y position that the window would have when it gets restored from the maximized state.- Parameters:
normalY- The new normalY property for this WindowInfo object
-
updateNormalY
public void updateNormalY(int normalY) Updates the normalY property for this WindowInfo object. It doesn't get reflected on the window (usesetNormalYfor that).- Parameters:
normalY- The new normalY property for this WindowInfo object
-
setNormalHeight
public void setNormalHeight(int normalHeight) Sets the normalHeight property for this WindowInfo object. This sets the height position that the window would have when it gets restored from the maximized state.- Parameters:
normalY- The new normalHeight property for this WindowInfo object
-
updateNormalHeight
public void updateNormalHeight(int normalHeight) Updates the normalHeight property for this WindowInfo object. It doesn't get reflected on the window (usesetNormalHeightfor that).- Parameters:
normalHeight- The new normalHeight property for this WindowInfo object
-
setNormalWidth
public void setNormalWidth(int normalWidth) Sets the normalWidth property for this WindowInfo object. This sets the width position that the window would have when it gets restored from the maximized state.- Parameters:
normalY- The new normalWidth property for this WindowInfo object
-
setMinimumSize
Sets the minimum allowed size for the associated window. If null is provided, the minimum size is disabled (and thus the window can be resized to any size).- Parameters:
minSize- The minimum allowed size for the associated window.
-
updateMinimumSize
Updates the minimum allowed size for the associated window. It doesn't get reflected on the window (usesetMinimumSizefor that).- Parameters:
minSize- The minimum allowed size for the associated window.
-
getMinimumSize
Gets the minimum allowed size for the associated window.- Returns:
- minSize The minimum allowed size for the associated window.
-
updateNormalWidth
public void updateNormalWidth(int normalWidth) Updates the normalWidth property for this WindowInfo object. It doesn't get reflected on the window (usesetNormalWidthfor that).- Parameters:
normalWidth- The new normalHeight property for this WindowInfo object
-
setMaximized
public void setMaximized(boolean maximized) Maximize the associated window- Parameters:
maximized-
-
updateMaximized
public void updateMaximized(boolean maximized) Updates the maximized property for this WindowInfo object. It doesn't get reflected on the window (usesetMaximizedfor that).- Parameters:
maximized- The new maximized property for this WindowInfo object
-
setMaximizable
public void setMaximizable(boolean maximizable) -
updateBounds
public void updateBounds(int x, int y, int width, int height) Updates the bounds for this WindowInfo object. It doesn't get reflected on the window (usesetBoundsfor that).- Parameters:
x-y-width-height-
-
setNormalBounds
public void setNormalBounds(int x, int y, int width, int height) Sets the normal bounds of the associated window. This sets the bounds that the window would have when it gets restored from the maximized state.- Parameters:
x-y-width-height-
-
updateNormalBounds
public void updateNormalBounds(int x, int y, int width, int height) Updates the normal bounds for this WindowInfo object. It doesn't get reflected on the window (usesetNormalBoundsfor that).- Parameters:
x-y-width-height-
-
getNormalBounds
Gets the normal bounds of the associated window. This gets the bounds that the window would have when it gets restored from the maximized state.- Returns:
- The normal bounds of the associated window.
-
setNormalBounds
Sets the normal bounds of the associated window. This sets the bounds that the window would have when it gets restored from the maximized state.- Parameters:
normalBounds-
-
updateNormalBounds
Updates the normal bounds for this WindowInfo object. It doesn't get reflected on the window (usesetNormalBoundsfor that).- Parameters:
normalBounds-
-
setBounds
Sets the bounds of the associated window.- Parameters:
bounds-
-
updateBounds
Updates the bounds for this WindowInfo object. It doesn't get reflected on the window (usesetBoundsfor that).- Parameters:
bounds-
-
getBounds
Gets the bounds of the associated window.- Returns:
- The bounds of the associated window.
-
getNormalX
public int getNormalX() -
getNormalY
public int getNormalY()Gets the x coordinate of the window's origin when the window is not maximized. When the window is maximized, gets the y coordinate that it will have when it gets restored- Returns:
- the normal y coordinate of the window's origin
-
getNormalHeight
public int getNormalHeight()Gets the height of the window's origin when the window is not maximized. When the window is maximized, gets the height that it will have when it gets restored- Returns:
- the normal height of the window
-
getNormalWidth
public int getNormalWidth()Gets the width of the window's origin when the window is not maximized. When the window is maximized, gets the width that it will have when it gets restored- Returns:
- the normal width of the window
-
isMaximized
public boolean isMaximized()Determines whether the window is maximized or not- Returns:
- true if the window is maximized, false otherwise
-
checkPersistence
public boolean checkPersistence()Checks if the geometry of this window should be persisted in the project file. This is set by the persistWindow(boolean) method, and the default value is true.- Returns:
- True if the geometry of this window should be persisted in the project files, false otherwise.
-
setPersistence
public void setPersistence(boolean persist) Set whether the geometry of this window should be persisted in the project files.- Parameters:
persist-
-
getXMLEntity
public org.gvsig.utils.XMLEntity getXMLEntity()Gets the window properties in an XMLEntity object, suitable for persistence.- Returns:
- An XMLEntity object containing the window properties, or null if the window was set as not persistent
-
createFromXMLEntity
Creates a WindowInfo object from an XMLEntity containing the window properties.- Parameters:
xml- An XMLEntity object containing the window properties- Returns:
- A new WindowInfo object, containing the properties specified in the XMLEntity parameters
-
getPropertiesFromXMLEntity
public void getPropertiesFromXMLEntity(org.gvsig.utils.XMLEntity xml) Updates this WindowInfo object according to the properties provided by the XMLEntity parameter.- Parameters:
xml- An XMLEntity object containing the window properties
-
getAdditionalInfo
Obtiene información adicional de la ventana. Esta etiqueta podrá llevar cualquier tipo de información que queramos almacenar.- Returns:
- Información adicional
-
setAdditionalInfo
Asigna información adicional de la ventana. Esta etiqueta podrá llevar cualquier tipo de información que queramos almacenar. -
saveToState
public void saveToState(org.gvsig.tools.persistence.PersistentState state) throws org.gvsig.tools.persistence.exception.PersistenceException - Specified by:
saveToStatein interfaceorg.gvsig.tools.persistence.Persistent- Throws:
org.gvsig.tools.persistence.exception.PersistenceException
-
loadFromState
public void loadFromState(org.gvsig.tools.persistence.PersistentState state) throws org.gvsig.tools.persistence.exception.PersistenceException - Specified by:
loadFromStatein interfaceorg.gvsig.tools.persistence.Persistent- Throws:
org.gvsig.tools.persistence.exception.PersistenceException
-