Class TLcyFullScreenActiveSettable
- All Implemented Interfaces:
ILcyActiveSettable
,ILcdPropertyChangeSource
,Serializable
ILcyActiveSettable
implementation which allows to show a Swing component in a full-screen view.
When activating the active settable:
- The specified component will be removed from its current parent, and will be shown as a full screen component.
-
Pressing Escape will allow to leave full-screen mode.
You can specify an additional key by
setting it as value
for theAction.ACCELERATOR_KEY
key.
When de-activating the full screen mode:
- The specified component will be re-added to its previous parent.
If needed, you can add an explicit button to your UI to leave full screen mode and go back to regular mode.
Your button simply needs to call setActive(false)
.
For example:
final TLcyFullScreenActiveSettable as = new TLcyFullScreenActiveSettable( ... );
JButton exitButton = new JButton("Exit full screen");
exitButton.addActionListener(new ActionListener(){
@Override
public void actionPerformed(ActionEvent e){
as.setActive(false);
}
});
By monitoring the "active" state of the active settable, you can also auto show and hide the exit button. For example:
final TLcyFullScreenActiveSettable as = new TLcyFullScreenActiveSettable( ... );
final JButton exitButton = new JButton("Exit full screen");
exitButton.setVisible(as.isActive());
as.addPropertyChangeListener(new PropertyChangeListener(){
@Override
public void propertyChange(PropertyChangeEvent e){
if ("active".equals(e.getPropertyName())){
exitButton.setVisible((Boolean)e.getNewValue());
}
}
});
Note: it is not recommended to use this class on OS X.
To offer the least surprise to the end user of your application, it is better to use the OS X specific full screen
support.
See com.apple.eawt.FullScreenUtilities
for more information.
- Since:
- 2016.0
- See Also:
-
Field Summary
Fields inherited from interface com.luciad.lucy.gui.ILcyActiveSettable
DEFAULT, LONG_DESCRIPTION, NAME, SHORT_DESCRIPTION, SHOW_ACTION_NAME, SMALL_ICON, SMALL_SELECTED_ICON, VISIBLE
-
Constructor Summary
ConstructorDescriptionTLcyFullScreenActiveSettable
(Component aFullScreenComponent, Object aComponentLayoutConstraints, ILcyLucyEnv aLucyEnv) Creates a new active settable which can showaFullScreenComponent
in full-screen mode. -
Method Summary
Methods inherited from class com.luciad.lucy.gui.ALcyActiveSettable
addPropertyChangeListener, firePropertyChange, getDisplayName, getIcon, getLongDescription, getName, getShortDescription, getValue, isEnabled, putValue, removePropertyChangeListener, setDisplayName, setEnabled, setIcon, setLongDescription, setName, setShortDescription
-
Constructor Details
-
TLcyFullScreenActiveSettable
public TLcyFullScreenActiveSettable(Component aFullScreenComponent, Object aComponentLayoutConstraints, ILcyLucyEnv aLucyEnv) Creates a new active settable which can showaFullScreenComponent
in full-screen mode.- Parameters:
aFullScreenComponent
- The component which will be displayed in full-screen mode when activating this active settable.aComponentLayoutConstraints
- The layout constraints which should be used whenaFullScreenComponent
is re-added to its parent container when leaving full screen view. This can for example beBorderLayout.CENTER
;aLucyEnv
- The Lucy back-end
-
-
Method Details
-
isActive
public boolean isActive()Description copied from interface:ILcyActiveSettable
Returns true if the state of this object is active, false if the state is inactive. As for every property: whenever the return value of this method changes, a property change event must be fired (seeILcyActiveSettable.setActive(boolean)
).- Returns:
- true if the state of this object is active, false if the state is inactive.
- See Also:
-
setActive
public void setActive(boolean aActive) Description copied from interface:ILcyActiveSettable
Sets the active state of this object. When the new state is different from the previous state, a certain action will need to be performed. Also a property change event will be fired in such a case. If no property change event is fired, synchronization between this ILcyActiveSettable and the GUI widget representing it will probably fail (e.g. the checkbox will not change state). Note: refer to Implementing Bound Property Support Within a Bean for an example about firing a property change.- Parameters:
aActive
- True if the new state is active, false if the new state is inactive.- See Also:
-