Class TLcyFullScreenActiveSettable

java.lang.Object
com.luciad.lucy.gui.ALcyActiveSettable
com.luciad.lucy.gui.TLcyFullScreenActiveSettable
All Implemented Interfaces:
ILcyActiveSettable, ILcdPropertyChangeSource, Serializable

public final class TLcyFullScreenActiveSettable extends ALcyActiveSettable

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 the Action.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:
  • Constructor Details

    • TLcyFullScreenActiveSettable

      public TLcyFullScreenActiveSettable(Component aFullScreenComponent, Object aComponentLayoutConstraints, ILcyLucyEnv aLucyEnv)
      Creates a new active settable which can show aFullScreenComponent 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 when aFullScreenComponent is re-added to its parent container when leaving full screen view. This can for example be BorderLayout.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 (see ILcyActiveSettable.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: