public class IlpToolBarRenderer
extends ilog.cpl.graph.css.renderer.IlpToolBarRenderer
IlpNetworkView
.
This class is a CSS stylable JavaBean. 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 value is true
.
The button
elements specify the buttons that appear in the
toolbar (IlpNetworkInteractorButton
)
or separators. When pressed, the buttons execute actions; for example, they
can install view interactors. A button can be specified in the following way
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:
EditEquipmentObject
EditGroup
EditLabel
EditLinkPort
FitToContents
LabelLayout
MakeLinearGroup
MakeLink
MakePolyGroup
MakeRectGroup
Pan
ScrollToContents
Select
Separator
UnZoomView
ZoomBack
ZoomIn
ZoomOut
ZoomReset
ZoomView
IlpNetworkInteractorAction
that
has a public constructor taking one argument of type
IlpViewsView
,
for example:
ToolBar { enabled: true; button[0]: @+SelectButton; button[1]: @+CustomButton; } Subobject#SelectButton { actionType: "Select"; usingObjectInteractor: true; opaqueMove: true; } Subobject#CustomButton { actionType: "samples.network.styling.CustomButtonAction"; toolTipText: "Custom Button"; }
The actionType
Separator
adds a separator in the
toolbar. A separator has a single optional property: dimension
.
This property allows you to customize the dimension of the separator in the
toolbar, as illustrated in the following example:
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 or
defaultViewInteractorName
element; 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 or action
elements can be
specified for buttons that install a view interactor, as illustrated in the
following example:
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 a 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.
IlpNetworkView
,
IlpNetworkInteractorButton
,
IlpPopupMenuFactory
,
IlpGesture
Constructor and Description |
---|
IlpToolBarRenderer() |
Modifier and Type | Method and Description |
---|---|
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.
|
attach, getView, noteContainerAdded, noteContainerUpdated
public JToolBar getToolBar()
getToolBar
in class ilog.cpl.graph.css.renderer.IlpToolBarRenderer
public boolean isToolBarVisible()
Note that this function is only relevant if the toolbar is integrated in the view and is not managed externally.
isToolBarVisible
in class ilog.cpl.graph.css.renderer.IlpToolBarRenderer
setToolBarVisible(boolean)
,
isToolBarExternal()
public void setToolBarVisible(boolean visible)
Note that this function has an effect only if the toolbar is integrated in the view and is not managed externally.
setToolBarVisible
in class ilog.cpl.graph.css.renderer.IlpToolBarRenderer
visible
- The required visibility setting.isToolBarVisible()
,
isToolBarExternal()
public boolean isToolBarExternal()
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.isToolBarExternal
in class ilog.cpl.graph.css.renderer.IlpToolBarRenderer
setToolBarExternal(boolean)
public void setToolBarExternal(boolean external)
external
(managed by the application)
or integrated
(managed by this view).setToolBarExternal
in class ilog.cpl.graph.css.renderer.IlpToolBarRenderer
isToolBarExternal()
© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.