Interface ILcyApplicationPane
- All Superinterfaces:
ILcdPropertyChangeSource
java.awt.Component
s of the
application in. So every gui element ( map, layercontrol, panels of addons, ... ) that needs to
be displayed to the user will be in an ILcyApplicationPane
.
To work with this pane - it is add your own components, set the layout, ... - use
getAppContentPane to retrieve a regular java.awt.Container. Make sure that every operation on
the content pane is performed in the event dispatch thread. See ILcyApplicationPaneFactory
for more information.
The idea of this interface is to make abstraction of the swing component used to represent the
gui elements. Implementations can range from a dialog over a frame to a regular panel or anything
else you can come up with. So one cannot make any assumptions on the looks or the size of an
ILcyApplicationPane
.
Note that there is no operation to add an application pane to Lucy's environment. The creation of
a pane will add it to the (visible) Lucy's environment right away. This means all swing
operations (like add, remove, ...) on the content pane of an application pane need to be
performed on the event dispatch thread (swing is designed to be single threaded).
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The key representing the hint 'auto-hide' of an application pane.static final String
The key representing the hint 'floating' of an application pane.static final String
The key representing the location of the application pane when the application pane is floating.static final String
The key representing the long description of an application pane.static final String
The key representing the short description of an application pane.static final String
The key representing the icon value of an application pane. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Brings the applicationpane to the front.boolean
Returns true if thisILcyApplicationPane
can be packed, false otherwise.void
Disposes thisILcyApplicationPane
and removes it from the user interface.Gets the AppContentPane.Returns the current size of this application pane.Returns the title of this ILcyApplicationPane.Gets one of this object's properties using the associated key.boolean
Returns true if thisILcyApplicationPane
is visible, false otherwise.boolean
Returns true if this pane allows to be disposed, false otherwise.void
packApp()
Packs theILcyApplicationPane
.void
Sets one of this object's properties using the associated key.void
setAppEnabled
(boolean aEnabled) Sets the enabled attribute of the ILcyApplicationPane.void
setAppSize
(Dimension aDimension) Sets the size of theILcyApplicationPane
.void
setAppTitle
(String aTitle) Sets the title of this ILcyApplicationPane.void
setAppVisible
(boolean aVisible) Sets the visible property of thisILcyApplicationPane
.void
setDisposable
(boolean aDisposable) Sets if this pane can be disposed or not.void
setResizable
(boolean aResizable) Sets the Resizable attribute of the ILcyApplicationPane object.Methods inherited from interface com.luciad.util.ILcdPropertyChangeSource
addPropertyChangeListener, removePropertyChangeListener
-
Field Details
-
SMALL_ICON
The key representing the icon value of an application pane. The value corresponding to this key must be anILcdIcon
.- See Also:
-
SHORT_DESCRIPTION
The key representing the short description of an application pane. The value corresponding to this key must be aString
.- See Also:
-
LONG_DESCRIPTION
The key representing the long description of an application pane. The value corresponding to this key must be aString
.- See Also:
-
HINT_AUTO_HIDE
The key representing the hint 'auto-hide' of an application pane. The value corresponding to this key must be aBoolean
. The value should be used to indicate if a docked application pane should automatically hide itself or not. It is optional in the sense thatILcyApplicationPane
implementations are allowed to ignore this property.- See Also:
-
HINT_FLOATING
The key representing the hint 'floating' of an application pane. The value corresponding to this key must be aBoolean
. The value should be used to indicate if the application pane is represented as a floating dialog (true) or a docked frame (false). It is optional in the sense thatILcyApplicationPane
implementations are allowed to ignore this property.- See Also:
-
HINT_FLOATING_LOCATION
The key representing the location of the application pane when the application pane is floating. The value corresponding to this key must be aPoint
. It is optional in the sense thatILcyApplicationPane
implementations are allowed to ignore this property.- See Also:
-
-
Method Details
-
packApp
void packApp()Packs theILcyApplicationPane
. It is, giving it its preferred size and laying out its subcomponents. Note that this is only possible if canPackApp returns true.- See Also:
-
canPackApp
boolean canPackApp()Returns true if thisILcyApplicationPane
can be packed, false otherwise.- Returns:
- true if this
ILcyApplicationPane
can be packed, false otherwise. - See Also:
-
disposeApp
void disposeApp()Disposes this
ILcyApplicationPane
and removes it from the user interface. This application pane should no longer be used after calling this method.The associated
ILcyApplicationPaneOwner
is notified.This method does not take
isDisposable()
into account, it is up the user of this class to verify if the application pane is disposable. This allows the application pane to be disposed regardless of the disposable property, which can for example be useful to programmatically clean application panes. -
isDisposable
boolean isDisposable()Returns true if this pane allows to be disposed, false otherwise.- Returns:
- true if this pane allows to be disposed, false otherwise.
- See Also:
-
setDisposable
void setDisposable(boolean aDisposable) Sets if this pane can be disposed or not.
Note that
disposeApp()
does not respect this property, the properties primary use is to enable/disable a close action in the user interface.- Parameters:
aDisposable
- True if this pane can be disposed, false otherwise.- See Also:
-
setAppEnabled
void setAppEnabled(boolean aEnabled) Sets the enabled attribute of the ILcyApplicationPane.- Parameters:
aEnabled
- The new AppEnabled value
-
isAppVisible
boolean isAppVisible()Returns true if thisILcyApplicationPane
is visible, false otherwise.- Returns:
- true if this
ILcyApplicationPane
is visible, false otherwise. - See Also:
-
setAppVisible
void setAppVisible(boolean aVisible) Sets the visible property of this
ILcyApplicationPane
. Make sure to set an application pane visible after it is created and initialized. If not, it might not be available in the user interface (depending on the implementation).Setting it invisible is mostly useful to temporarily 'hide' it, as it won't disposed and all resources are still in use when invisible.
- Parameters:
aVisible
- The new AppVisible value- See Also:
-
setAppSize
Sets the size of theILcyApplicationPane
. There is normally no need to use this method. Instead let Swing calculate proper sizes, based on the minimum, preferred and maximum sizes of the smallest components (such as text fields, check boxes etc.). This assures proper functioning, even on systems that have custom font or display settings.- Parameters:
aDimension
- The new size- See Also:
-
getAppSize
Dimension getAppSize()Returns the current size of this application pane.- Returns:
- the current size of this application pane.
- See Also:
-
setAppTitle
Sets the title of this ILcyApplicationPane.- Parameters:
aTitle
- The new title- See Also:
-
getAppTitle
String getAppTitle()Returns the title of this ILcyApplicationPane.- Returns:
- the title of this ILcyApplicationPane.
- See Also:
-
getAppContentPane
Container getAppContentPane()Gets the AppContentPane. The content pane is the visual part of this ILcyApplicationPane. It is used to add, remove, ... your own components. Make sure that every operation on the content pane is performed in the event dispatch thread. See
ILcyApplicationPaneFactory
for more information.Note that the implementation of this interface is free to choose the
LayoutManager
set on the returnedContainer
. For example if you want to add a singleComponent
to the application pane which takes all available space, you cannot assume that you can simply add the component. In this case, you could for example set aBorderLayout
and add the component to the center:ILcyApplicationPane appPane = ... ; Component content = ... ; Container contentPane = appPane.getAppContentPane(); //explicitly set a layout manager contentPane.setLayoutManager( new BorderLayout() ); //ensure that the content takes all available space by adding it to the center contentPane.add( content, BorderLayout.CENTER );
- Returns:
- The AppContentPane
- See Also:
-
bringAppToFront
void bringAppToFront()Brings the applicationpane to the front. Note that this method only makes sense if the pane is visible.- See Also:
-
setResizable
void setResizable(boolean aResizable) Sets the Resizable attribute of the ILcyApplicationPane object.- Parameters:
aResizable
- The new Resizable value
-
putValue
Sets one of this object's properties using the associated key. There are three predefined keys:
SMALL_ICON
,SHORT_DESCRIPTION
andLONG_DESCRIPTION
. Implementations of this interface can use these properties to show them in their user interface. For instance the icon set with the SMALL_ICON key could be shown in the tab of a tabbed pane.The type of the value is specified by the key. For instance, the key
SMALL_ICON
demands that the value is anILcdIcon
.If the value has changed, a
PropertyChangeEvent
is sent to listeners withaKey
as the property name.- Parameters:
aKey
- aString
representing the key. This must not benull
, but can otherwise be anyString
, ie. it is not restricted to being one ofSMALL_ICON
,SHORT_DESCRIPTION
orLONG_DESCRIPTION
.aValue
- anObject
value. This may benull
.- See Also:
-
getValue
Gets one of this object's properties using the associated key.- Parameters:
aKey
- theString
of the key for which you want to retrieve the value. This can be anyString
, ie. it is not restricted to being one of SMALL_ICON, SHORT_DESCRIPTION or LONG_DESCRIPTION.- Returns:
- The
Object
value corresponding toaKey
, ornull
if no value corresponding toaKey
could be found. The type of this value is determined by the key. For instance, theSMALL_ICON
key specifies that the returned value is anILcdIcon
. - See Also:
-