Class DisplayModel
- java.lang.Object
-
- org.csstudio.display.builder.model.Widget
-
- org.csstudio.display.builder.model.DisplayModel
-
public class DisplayModel extends Widget
Display Model.Describes overall size of display, global settings, and holds widgets.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
FILE_EXTENSION
File extension used for display filesstatic java.util.List<java.lang.String>
FILE_EXTENSIONS
All supported file extensionsstatic java.lang.String
LEGACY_FILE_EXTENSION
File extension used for legacy display filesstatic org.csstudio.display.builder.model.WidgetPropertyDescriptor<org.csstudio.display.builder.model.properties.WidgetColor>
propGridColor
'grid_color' propertystatic org.csstudio.display.builder.model.WidgetPropertyDescriptor<java.lang.Integer>
propGridStepX
'grid_step_x' propertystatic org.csstudio.display.builder.model.WidgetPropertyDescriptor<java.lang.Integer>
propGridStepY
'grid_step_y' propertystatic org.csstudio.display.builder.model.WidgetPropertyDescriptor<java.lang.Boolean>
propGridVisible
'grid_visible' propertystatic java.lang.String
USER_DATA_EMBEDDING_WIDGET
Widget user data key for storing the embedding widget.static java.lang.String
USER_DATA_INPUT_FILE
Reserved DisplayModel user data key for name of input filestatic java.lang.String
USER_DATA_INPUT_VERSION
Reserved DisplayModel user data key for version of input filestatic java.lang.String
USER_DATA_READONLY
Reserved DisplayModel user data key for 'read only' flag, "true" to set, anything else means falsestatic java.lang.String
USER_DATA_TOOLKIT
Reserved DisplayModel user data key for storing toolkit used as representation.static org.csstudio.display.builder.model.Version
VERSION
Version 1.0.0 - Legacy BOY format, and initial display builder files where widgets started to use their new XML, but no support for classes.static java.lang.String
WIDGET_TYPE
Widget type used by the display model-
Fields inherited from class org.csstudio.display.builder.model.Widget
BASE_WIDGET_VERSION, USER_DATA_REPRESENTATION, USER_DATA_RUNTIME, USER_DATA_SCRIPT_SUPPORT, USER_DATA_TOOLKIT_PARENT
-
-
Constructor Summary
Constructors Constructor Description DisplayModel()
Create display model
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
Dispose the modeljava.util.List<Widget>
getChildren()
Get read-only list of childrenorg.csstudio.display.builder.model.WidgetConfigurator
getConfigurator(org.csstudio.display.builder.model.Version persisted_version)
Obtain configurator.java.lang.String
getDisplayName()
Get display nameMacros
getEffectiveMacros()
Display model provides macros for all its widgets.org.csstudio.display.builder.model.Version
getVersion()
boolean
isClassModel()
Is this display model for a class file?boolean
isClean()
boolean
isTopDisplayModel()
WidgetProperty<org.csstudio.display.builder.model.properties.WidgetColor>
propBackgroundColor()
WidgetProperty<org.csstudio.display.builder.model.properties.WidgetColor>
propGridColor()
WidgetProperty<java.lang.Integer>
propGridStepX()
WidgetProperty<java.lang.Integer>
propGridStepY()
WidgetProperty<java.lang.Boolean>
propGridVisible()
WidgetProperty<Macros>
propMacros()
org.csstudio.display.builder.model.ChildrenProperty
runtimeChildren()
void
setReaderResult(org.csstudio.display.builder.model.persist.ModelReader modelReader)
java.lang.String
toString()
-
Methods inherited from class org.csstudio.display.builder.model.Widget
checkDisplayModel, checkProperty, checkProperty, clearUserData, expandPropertyNames, getDisplayModel, getID, getMacrosOrProperties, getName, getParent, getProperties, getProperty, getProperty, getPropertyByPath, getPropertyValue, getPropertyValue, getTopDisplayModel, getType, getUserData, getWidgetClass, propActions, propClass, propHeight, propName, propRules, propScripts, propWidth, propX, propY, setConfiguratorResult, setPropertyValue, setPropertyValue, setUserData
-
-
-
-
Field Detail
-
VERSION
public static final org.csstudio.display.builder.model.Version VERSION
Version- 1.0.0 - Legacy BOY format, and initial display builder files where widgets started to use their new XML, but no support for classes.
- 2.0.0 - Supports widget classes and honors the 'use_class' attribute of properties.
-
FILE_EXTENSION
public static final java.lang.String FILE_EXTENSION
File extension used for display files- See Also:
- Constant Field Values
-
LEGACY_FILE_EXTENSION
public static final java.lang.String LEGACY_FILE_EXTENSION
File extension used for legacy display files- See Also:
- Constant Field Values
-
FILE_EXTENSIONS
public static final java.util.List<java.lang.String> FILE_EXTENSIONS
All supported file extensions
-
WIDGET_TYPE
public static final java.lang.String WIDGET_TYPE
Widget type used by the display model- See Also:
- Constant Field Values
-
USER_DATA_INPUT_FILE
public static final java.lang.String USER_DATA_INPUT_FILE
Reserved DisplayModel user data key for name of input file- See Also:
- Constant Field Values
-
USER_DATA_READONLY
public static final java.lang.String USER_DATA_READONLY
Reserved DisplayModel user data key for 'read only' flag, "true" to set, anything else means false- See Also:
- Constant Field Values
-
USER_DATA_INPUT_VERSION
public static final java.lang.String USER_DATA_INPUT_VERSION
Reserved DisplayModel user data key for version of input fileHolds Version.
- See Also:
- Constant Field Values
-
USER_DATA_TOOLKIT
public static final java.lang.String USER_DATA_TOOLKIT
Reserved DisplayModel user data key for storing toolkit used as representation.Holds ToolkitRepresentation.
- See Also:
- Constant Field Values
-
USER_DATA_EMBEDDING_WIDGET
public static final java.lang.String USER_DATA_EMBEDDING_WIDGET
Widget user data key for storing the embedding widget.For a
DisplayModel
that is held by anEmbeddedDisplayWidget
orNavigationTabsWidget
, this user data element of the model points to the embedding widget.- See Also:
- Constant Field Values
-
propGridVisible
public static final org.csstudio.display.builder.model.WidgetPropertyDescriptor<java.lang.Boolean> propGridVisible
'grid_visible' property
-
propGridColor
public static final org.csstudio.display.builder.model.WidgetPropertyDescriptor<org.csstudio.display.builder.model.properties.WidgetColor> propGridColor
'grid_color' property
-
propGridStepX
public static final org.csstudio.display.builder.model.WidgetPropertyDescriptor<java.lang.Integer> propGridStepX
'grid_step_x' property
-
propGridStepY
public static final org.csstudio.display.builder.model.WidgetPropertyDescriptor<java.lang.Integer> propGridStepY
'grid_step_y' property
-
-
Method Detail
-
getVersion
public org.csstudio.display.builder.model.Version getVersion()
- Overrides:
getVersion
in classWidget
- Returns:
- Widget version number
-
getDisplayName
public java.lang.String getDisplayName()
Get display nameProvides the configured 'name', falling back to the input file if name is empty.
- Returns:
- Display name
-
isClassModel
public final boolean isClassModel()
Is this display model for a class file?- Returns:
true
if this is the display model for a class file.
-
isTopDisplayModel
public final boolean isTopDisplayModel()
- Returns:
true
if this display is a top-level display,false
if it's held by an embedded widget
-
setReaderResult
public final void setReaderResult(org.csstudio.display.builder.model.persist.ModelReader modelReader)
-
isClean
public final boolean isClean()
-
getConfigurator
public org.csstudio.display.builder.model.WidgetConfigurator getConfigurator(org.csstudio.display.builder.model.Version persisted_version) throws java.lang.Exception
Description copied from class:Widget
Obtain configurator.While typically using the default
WidgetConfigurator
, widget may provide a different configurator for reading older persisted date.- Overrides:
getConfigurator
in classWidget
- Parameters:
persisted_version
- Version of the persisted data.- Returns:
- Widget configurator for that version
- Throws:
java.lang.Exception
- if persisted version cannot be handled
-
propMacros
public WidgetProperty<Macros> propMacros()
- Returns:
- 'macros' property
-
runtimeChildren
public org.csstudio.display.builder.model.ChildrenProperty runtimeChildren()
- Returns:
- Runtime 'children'
-
getChildren
public java.util.List<Widget> getChildren()
Get read-only list of childrenConvenience method. Use
runtimeChildren()
for full access.- Returns:
- Child widgets
-
getEffectiveMacros
public Macros getEffectiveMacros()
Display model provides macros for all its widgets.- Overrides:
getEffectiveMacros
in classWidget
- Returns:
Macros
-
propBackgroundColor
public WidgetProperty<org.csstudio.display.builder.model.properties.WidgetColor> propBackgroundColor()
- Returns:
- 'background_color' property
-
propGridColor
public WidgetProperty<org.csstudio.display.builder.model.properties.WidgetColor> propGridColor()
- Returns:
- 'grid_color' property
-
propGridStepX
public WidgetProperty<java.lang.Integer> propGridStepX()
- Returns:
- 'grid_step_x' property
-
propGridStepY
public WidgetProperty<java.lang.Integer> propGridStepY()
- Returns:
- 'grid_step_y' property
-
propGridVisible
public WidgetProperty<java.lang.Boolean> propGridVisible()
- Returns:
- 'grid_visible' property
-
dispose
public void dispose()
Dispose the modelRemoves all widgets and prevents adding new widgets
-
-