Search in sources :

Example 1 with FontProperty

use of org.csstudio.opibuilder.properties.FontProperty in project yamcs-studio by yamcs.

the class AbstractWidgetModel method configureBaseProperties.

protected void configureBaseProperties() {
    addProperty(new IntegerProperty(PROP_WIDTH, "Width", WidgetPropertyCategory.Position, 100, 1, 10000));
    addProperty(new IntegerProperty(PROP_HEIGHT, "Height", WidgetPropertyCategory.Position, 100, 1, 10000));
    addProperty(new IntegerProperty(PROP_XPOS, "X", WidgetPropertyCategory.Position, 0));
    addProperty(new IntegerProperty(PROP_YPOS, "Y", WidgetPropertyCategory.Position, 0));
    addProperty(new ColorProperty(PROP_COLOR_BACKGROUND, "Background Color", WidgetPropertyCategory.Display, new RGB(240, 240, 240)));
    addProperty(new ColorProperty(PROP_COLOR_FOREGROUND, "Foreground Color", WidgetPropertyCategory.Display, new RGB(192, 192, 192)));
    addProperty(new FontProperty(PROP_FONT, "Font", WidgetPropertyCategory.Display, MediaService.DEFAULT_FONT));
    addProperty(new ColorProperty(PROP_BORDER_COLOR, "Border Color", WidgetPropertyCategory.Border, new RGB(0, 128, 255)));
    addProperty(new ComboProperty(PROP_BORDER_STYLE, "Border Style", WidgetPropertyCategory.Border, BorderStyle.stringValues(), 0));
    addProperty(new IntegerProperty(PROP_BORDER_WIDTH, "Border Width", WidgetPropertyCategory.Border, 1, 0, 1000));
    addProperty(new BooleanProperty(PROP_ENABLED, "Enabled", WidgetPropertyCategory.Behavior, true));
    addProperty(new BooleanProperty(PROP_VISIBLE, "Visible", WidgetPropertyCategory.Behavior, true));
    addProperty(new ScriptProperty(PROP_SCRIPTS, "Scripts", WidgetPropertyCategory.Behavior));
    addProperty(new ActionsProperty(PROP_ACTIONS, "Actions", WidgetPropertyCategory.Behavior));
    addProperty(new StringProperty(PROP_TOOLTIP, "Tooltip", WidgetPropertyCategory.Display, "", true));
    addProperty(new RulesProperty(PROP_RULES, "Rules", WidgetPropertyCategory.Behavior));
    addProperty(new ComplexDataProperty(PROP_SCALE_OPTIONS, "Scale Options", WidgetPropertyCategory.Position, new WidgetScaleData(this, true, true, false), "Set Scale Options"));
    addProperty(new StringProperty(PROP_WIDGET_UID, "Widget UID", WidgetPropertyCategory.Basic, new UID().toString()));
    // update the WUID saved in connections without triggering anything
    getProperty(PROP_WIDGET_UID).addPropertyChangeListener(new PropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            for (ConnectionModel connection : sourceConnections) {
                connection.setPropertyValue(ConnectionModel.PROP_SRC_WUID, evt.getNewValue(), false);
            }
            for (ConnectionModel connection : targetConnections) {
                connection.setPropertyValue(ConnectionModel.PROP_TGT_WUID, evt.getNewValue(), false);
            }
        }
    });
    setPropertyVisibleAndSavable(PROP_WIDGET_UID, false, true);
    WidgetDescriptor descriptor = WidgetsService.getInstance().getWidgetDescriptor(getTypeID());
    String name;
    name = descriptor == null ? getTypeID().substring(getTypeID().lastIndexOf(".") + 1) : descriptor.getName();
    addProperty(new StringProperty(PROP_NAME, "Name", WidgetPropertyCategory.Basic, name));
    addProperty(new UnchangableStringProperty(PROP_WIDGET_TYPE, "Widget Type", WidgetPropertyCategory.Basic, name));
    addProperty(new UnsavableListProperty(PROP_SRC_CONNECTIONS, "Source Connections", WidgetPropertyCategory.Display, sourceConnections));
    setPropertyVisible(PROP_SRC_CONNECTIONS, false);
    addProperty(new UnsavableListProperty(PROP_TGT_CONNECTIONS, "Target Connections", WidgetPropertyCategory.Display, targetConnections));
    setPropertyVisible(PROP_TGT_CONNECTIONS, false);
}
Also used : ComboProperty(org.csstudio.opibuilder.properties.ComboProperty) IntegerProperty(org.csstudio.opibuilder.properties.IntegerProperty) ComplexDataProperty(org.csstudio.opibuilder.properties.ComplexDataProperty) PropertyChangeEvent(java.beans.PropertyChangeEvent) PropertyChangeListener(java.beans.PropertyChangeListener) BooleanProperty(org.csstudio.opibuilder.properties.BooleanProperty) ActionsProperty(org.csstudio.opibuilder.properties.ActionsProperty) UnchangableStringProperty(org.csstudio.opibuilder.properties.UnchangableStringProperty) ScriptProperty(org.csstudio.opibuilder.properties.ScriptProperty) StringProperty(org.csstudio.opibuilder.properties.StringProperty) UnchangableStringProperty(org.csstudio.opibuilder.properties.UnchangableStringProperty) WidgetDescriptor(org.csstudio.opibuilder.util.WidgetDescriptor) RGB(org.eclipse.swt.graphics.RGB) RulesProperty(org.csstudio.opibuilder.properties.RulesProperty) FontProperty(org.csstudio.opibuilder.properties.FontProperty) UID(java.rmi.server.UID) UnsavableListProperty(org.csstudio.opibuilder.properties.UnsavableListProperty) ColorProperty(org.csstudio.opibuilder.properties.ColorProperty) WidgetScaleData(org.csstudio.opibuilder.datadefinition.WidgetScaleData)

Example 2 with FontProperty

use of org.csstudio.opibuilder.properties.FontProperty in project yamcs-studio by yamcs.

the class AbstractScaledWidgetModel method configureProperties.

@Override
protected void configureProperties() {
    addProperty(new BooleanProperty(PROP_TRANSPARENT, "Transparent Background", WidgetPropertyCategory.Display, true));
    addProperty(new DoubleProperty(PROP_MIN, "Minimum", WidgetPropertyCategory.Behavior, DEFAULT_MIN));
    addProperty(new DoubleProperty(PROP_MAX, "Maximum", WidgetPropertyCategory.Behavior, DEFAULT_MAX));
    addProperty(new IntegerProperty(PROP_MAJOR_TICK_STEP_HINT, "Major Tick Step Hint", WidgetPropertyCategory.Display, DEFAULT_MAJOR_TICK_STEP_HINT, 1, 1000));
    addProperty(new BooleanProperty(PROP_SHOW_MINOR_TICKS, "Show Minor Ticks", WidgetPropertyCategory.Display, true));
    addProperty(new BooleanProperty(PROP_SHOW_SCALE, "Show Scale", WidgetPropertyCategory.Display, true));
    addProperty(new BooleanProperty(PROP_LOG_SCALE, "Log Scale", WidgetPropertyCategory.Display, false));
    addProperty(new FontProperty(PROP_SCALE_FONT, "Scale Font", WidgetPropertyCategory.Display, MediaService.DEFAULT_FONT));
    addProperty(new StringProperty(PROP_SCALE_FORMAT, "Scale Format", WidgetPropertyCategory.Display, // $NON-NLS-1$
    ""));
    addProperty(new StringProperty(PROP_VALUE_LABEL_FORMAT, "Value Label Format", WidgetPropertyCategory.Display, // $NON-NLS-1$
    ""));
}
Also used : IntegerProperty(org.csstudio.opibuilder.properties.IntegerProperty) FontProperty(org.csstudio.opibuilder.properties.FontProperty) BooleanProperty(org.csstudio.opibuilder.properties.BooleanProperty) StringProperty(org.csstudio.opibuilder.properties.StringProperty) DoubleProperty(org.csstudio.opibuilder.properties.DoubleProperty)

Example 3 with FontProperty

use of org.csstudio.opibuilder.properties.FontProperty in project yamcs-studio by yamcs.

the class TabModel method addTabProperty.

private void addTabProperty(TabProperty tabProperty, final int tabIndex) {
    String propID = makeTabPropID(tabProperty.propIDPre, tabIndex);
    WidgetPropertyCategory category;
    category = new WidgetPropertyCategory() {

        @Override
        public String toString() {
            return NLS.bind("Tab {0}", tabIndex);
        }
    };
    switch(tabProperty) {
        case TITLE:
            addProperty(new StringProperty(propID, tabProperty.toString(), category, category.toString()));
            break;
        case FONT:
            addProperty(new FontProperty(propID, tabProperty.toString(), category, DEFAULT_TAB_FONT));
            break;
        case FORECOLOR:
            addProperty(new ColorProperty(propID, tabProperty.toString(), category, DEFAULT_TAB_FORECOLOR));
            break;
        case BACKCOLOR:
            addProperty(new ColorProperty(propID, tabProperty.toString(), category, DEFAULT_TAB_BACKCOLOR));
            break;
        case ICON_PATH:
            addProperty(new FilePathProperty(propID, tabProperty.toString(), category, null, FILE_EXTENSIONS));
            break;
        case ENABLED:
            addProperty(new BooleanProperty(propID, tabProperty.toString(), category, true));
            break;
        default:
            break;
    }
}
Also used : FontProperty(org.csstudio.opibuilder.properties.FontProperty) BooleanProperty(org.csstudio.opibuilder.properties.BooleanProperty) StringProperty(org.csstudio.opibuilder.properties.StringProperty) WidgetPropertyCategory(org.csstudio.opibuilder.properties.WidgetPropertyCategory) FilePathProperty(org.csstudio.opibuilder.properties.FilePathProperty) ColorProperty(org.csstudio.opibuilder.properties.ColorProperty)

Example 4 with FontProperty

use of org.csstudio.opibuilder.properties.FontProperty in project yamcs-studio by yamcs.

the class XYGraphModel method configureProperties.

@Override
protected void configureProperties() {
    addPVProperty(new PVNameProperty(PROP_TRIGGER_PV, "Trigger PV", WidgetPropertyCategory.Behavior, ""), new PVValueProperty(PROP_TRIGGER_PV_VALUE, null));
    addProperty(new StringProperty(PROP_TITLE, "Title", WidgetPropertyCategory.Display, ""));
    addProperty(new FontProperty(PROP_TITLE_FONT, "Title Font", WidgetPropertyCategory.Display, // $NON-NLS-1$
    MediaService.DEFAULT_BOLD_FONT));
    addProperty(new BooleanProperty(PROP_SHOW_LEGEND, "Show Legend", WidgetPropertyCategory.Display, true));
    addProperty(new BooleanProperty(PROP_SHOW_PLOTAREA_BORDER, "Show Plot Area Border", WidgetPropertyCategory.Display, false));
    addProperty(new BooleanProperty(PROP_SHOW_TOOLBAR, "Show Toolbar", WidgetPropertyCategory.Display, true));
    addProperty(new ColorProperty(PROP_PLOTAREA_BACKCOLOR, "Plot Area Background Color", WidgetPropertyCategory.Display, DEFAULT_PLOTAREA_BACKCOLOR));
    addProperty(new BooleanProperty(PROP_TRANSPARENT, "Transparent", WidgetPropertyCategory.Display, false));
    addProperty(new IntegerProperty(PROP_AXIS_COUNT, "Axis Count", WidgetPropertyCategory.Behavior, 2, 2, MAX_AXES_AMOUNT));
    addProperty(new IntegerProperty(PROP_TRACE_COUNT, "Trace Count", WidgetPropertyCategory.Behavior, 1, 0, MAX_TRACES_AMOUNT));
    addAxisProperties();
    addTraceProperties();
    setPropertyVisible(PROP_FONT, false);
}
Also used : FontProperty(org.csstudio.opibuilder.properties.FontProperty) IntegerProperty(org.csstudio.opibuilder.properties.IntegerProperty) BooleanProperty(org.csstudio.opibuilder.properties.BooleanProperty) StringProperty(org.csstudio.opibuilder.properties.StringProperty) PVValueProperty(org.csstudio.opibuilder.properties.PVValueProperty) PVNameProperty(org.csstudio.opibuilder.properties.PVNameProperty) ColorProperty(org.csstudio.opibuilder.properties.ColorProperty)

Aggregations

BooleanProperty (org.csstudio.opibuilder.properties.BooleanProperty)4 FontProperty (org.csstudio.opibuilder.properties.FontProperty)4 StringProperty (org.csstudio.opibuilder.properties.StringProperty)4 ColorProperty (org.csstudio.opibuilder.properties.ColorProperty)3 IntegerProperty (org.csstudio.opibuilder.properties.IntegerProperty)3 PropertyChangeEvent (java.beans.PropertyChangeEvent)1 PropertyChangeListener (java.beans.PropertyChangeListener)1 UID (java.rmi.server.UID)1 WidgetScaleData (org.csstudio.opibuilder.datadefinition.WidgetScaleData)1 ActionsProperty (org.csstudio.opibuilder.properties.ActionsProperty)1 ComboProperty (org.csstudio.opibuilder.properties.ComboProperty)1 ComplexDataProperty (org.csstudio.opibuilder.properties.ComplexDataProperty)1 DoubleProperty (org.csstudio.opibuilder.properties.DoubleProperty)1 FilePathProperty (org.csstudio.opibuilder.properties.FilePathProperty)1 PVNameProperty (org.csstudio.opibuilder.properties.PVNameProperty)1 PVValueProperty (org.csstudio.opibuilder.properties.PVValueProperty)1 RulesProperty (org.csstudio.opibuilder.properties.RulesProperty)1 ScriptProperty (org.csstudio.opibuilder.properties.ScriptProperty)1 UnchangableStringProperty (org.csstudio.opibuilder.properties.UnchangableStringProperty)1 UnsavableListProperty (org.csstudio.opibuilder.properties.UnsavableListProperty)1