ilog.cpl.equipment.renderer
Class IlpToolBarRenderer

java.lang.Object
  extended by ilog.cpl.graphic.css.renderer.IlpAbstractGraphicViewRenderer
      extended by ilog.cpl.graph.css.renderer.IlpAbstractRepresentationViewRenderer
          extended by ilog.cpl.graph.css.renderer.IlpToolBarRenderer
              extended by ilog.cpl.equipment.renderer.IlpToolBarRenderer

public class IlpToolBarRenderer
extends ilog.cpl.graph.css.renderer.IlpToolBarRenderer

This class gives control over the toolbar of an IlpEquipmentView.

This class is a CSS stylable Bean. It can be configured as follows in a CSS file:

 ToolBar {
   external  : boolean;
   enabled   : boolean;
   button[0] : @+Button0;
   button[1] : @+Button1;
   :
   button[n] : @+ButtonN;
 }
 

The enabled property denotes whether the toolbar is initially visible. Its value can be true or false. The default is true.

The button elements specify the buttons to appear in the toolbar (IlpEquipmentInteractorButton) or separators. When pressed, buttons execute actions; for example, they can install view interactors. A button can be specified as follows in a CSS file:

 Subobject#Button0 {
   actionType: String;
   permanent: boolean;
   name: String;
   usingObjectInteractor: boolean;
 }
 

Here the actionType property should be one of the following predefined action names:

or the name of a subclass of IlpEquipmentInteractorAction that has a public constructor taking one argument of type IlpViewsView, for instance:
 ToolBar {
   enabled: true;
   button[0]: @+SelectButton;
   button[1]: @+CustomButton;
 }
 
 Subobject#SelectButton {
   actionType: "Select";
   usingObjectInteractor: true;
   opaqueMove: true;
 }
 
 Subobject#CustomButton {
   actionType: "samples.equipment.styling.CustomButtonAction";
   toolTipText: "Custom Button";
 }
 

The predefined Separator action type is used to add separators at specific positions in the toolbar. When separators are added, it is possible to define a single optional property, dimension. This property allows you to customize the dimension of the separator in the toolbar, as illustrated by the example below:

 ToolBar {
   enabled: true;
   button[0]: @+SelectButton;
   button[1]: @+Separator;
   button[2]: @+CustomButton;
 }
 Subobject#Separator {
   actionType: "Separator";
   dimension: "20,10";
 }
 

The name property denotes the name of the button, so that it can be referred to by the Interactor ID; see IlpInteractorRenderer.

All the predefined actions already have a name.

The permanent property is useful for buttons that install a view interactor. The value can be true or false. The default is true.

The allowed properties and their values depend on the class of the chosen button.

Additional action IDs can be specified for buttons that install a view interactor. It can look like this in the CSS:

 Subobject#SelectButton {
   actionType: "Select";
   usingObjectInteractor: true;
   opaqueMove: true;
   action[0]: @+action0;
   popupMenuFactory: @+popupMenuFactory;
 }
 
 Subobject#action0 {
   key : "DELETE";
   class : "ilog.cpl.graph.action.IlpRemoveSelectedObjectsAction";
 }
 

A key or gesture property should be specified. The value of the key property can be any of the strings described in class KeyStroke. The value of the gesture property can be any gesture name defined in class IlpGesture or its subclasses.

The value of the class property should be the name of a class that implements javax.swing.Action and has a public no-argument constructor.

The allowed properties and their values depend on the class of the chosen action.

Also, a pop-up menu factory can be specified. It can look like this in the CSS:

 Subobject#popupMenuFactory {
   class : "MyPopupMenuFactory";
   /* Other Bean properties could be added here. */
 }
 

The value of the class property should be the name of a class that implements IlpPopupMenuFactory and has a public no-argument constructor.

The allowed properties and their values depend on the class of the chosen factory.

Since:
JTGO 4.0
See Also:
IlpEquipmentView, IlpEquipmentInteractorButton, IlpEquipmentInteractorAction, IlpViewInteractor, IlpGesture, IlpPopupMenuFactory

Constructor Summary
IlpToolBarRenderer()
           
 
Method Summary
 JToolBar getToolBar()
          Returns the toolbar of the view.
 boolean isToolBarExternal()
          Tests whether the toolbar is external to the representation view.
 boolean isToolBarVisible()
          Tests whether the toolbar is visible.
 void setToolBarExternal(boolean external)
          Sets the toolbar to external (managed by the application) or integrated (managed by this view).
 void setToolBarVisible(boolean visible)
          Shows or hides the toolbar.
 
Methods inherited from class ilog.cpl.graph.css.renderer.IlpToolBarRenderer
getCSSID, reset
 
Methods inherited from class ilog.cpl.graph.css.renderer.IlpAbstractRepresentationViewRenderer
attach, getView, noteContainerAdded, noteContainerUpdated
 
Methods inherited from class ilog.cpl.graphic.css.renderer.IlpAbstractGraphicViewRenderer
detach, getContext, getGraphicView, isRendererEnabled, setRendererEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IlpToolBarRenderer

public IlpToolBarRenderer()
Method Detail

getToolBar

public JToolBar getToolBar()
Returns the toolbar of the view.

Overrides:
getToolBar in class ilog.cpl.graph.css.renderer.IlpToolBarRenderer

isToolBarVisible

public boolean isToolBarVisible()
Tests whether the toolbar is visible.

Note that this function is only relevant if the toolbar is integrated in the view and is not managed externally.

Overrides:
isToolBarVisible in class ilog.cpl.graph.css.renderer.IlpToolBarRenderer
See Also:
setToolBarVisible(boolean), isToolBarExternal()

setToolBarVisible

public void setToolBarVisible(boolean visible)
Shows or hides the toolbar.

Note that this function has an effect only if the toolbar is integrated in the view and is not managed externally.

Overrides:
setToolBarVisible in class ilog.cpl.graph.css.renderer.IlpToolBarRenderer
Parameters:
visible - The required visibility setting.
See Also:
isToolBarVisible(), isToolBarExternal()

isToolBarExternal

public boolean isToolBarExternal()
Tests whether the toolbar is external to the representation view. By default, the toolbar is integrated in the representation view and its visibility and placement are controlled by ILOG JTGO. If the toolbar is set to external, it is up to the application to control the toolbar placement and visibility. For example, the application can place the toolbar into a modal or non-modal JDialog or elsewhere in the application frame.

Overrides:
isToolBarExternal in class ilog.cpl.graph.css.renderer.IlpToolBarRenderer
See Also:
setToolBarExternal(boolean)

setToolBarExternal

public void setToolBarExternal(boolean external)
Sets the toolbar to external (managed by the application) or integrated (managed by this view).

Overrides:
setToolBarExternal in class ilog.cpl.graph.css.renderer.IlpToolBarRenderer
See Also:
isToolBarExternal()


Copyright © 1996-2007 ILOG S.A. All rights reserved.   Documentation homepage.   . All Rights Reserved.