Search in sources :

Example 31 with BooleanProperty

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

the class ConnectionModel method configureProperties.

@Override
protected void configureProperties() {
    addProperty(new IntegerProperty(PROP_LINE_WIDTH, "Line Width", WidgetPropertyCategory.Display, 1, 1, 100));
    addProperty(new ComboProperty(PROP_LINE_STYLE, "Line Style", WidgetPropertyCategory.Display, LineStyle.stringValues(), 0));
    addProperty(new ColorProperty(PROP_LINE_COLOR, "Line Color", WidgetPropertyCategory.Display, CustomMediaFactory.COLOR_BLACK));
    addProperty(new ComboProperty(PROP_ROUTER, "Router", WidgetPropertyCategory.Display, RouterType.stringValues(), 0));
    addProperty(new ComboProperty(PROP_ARROW_TYPE, "Arrows", WidgetPropertyCategory.Display, ArrowType.stringValues(), 0));
    addProperty(new BooleanProperty(PROP_FILL_ARROW, "Fill Arrow", WidgetPropertyCategory.Display, true));
    addProperty(new IntegerProperty(PROP_ARROW_LENGTH, "Arrow Length", WidgetPropertyCategory.Display, 15, 5, 1000));
    addProperty(new BooleanProperty(PROP_ANTIALIAS, "Anti Alias", WidgetPropertyCategory.Display, true));
    addProperty(new StringProperty(PROP_SRC_TERM, "Source Terminal", WidgetPropertyCategory.Display, ""));
    addProperty(new StringProperty(PROP_TGT_TERM, "Target Terminal", WidgetPropertyCategory.Display, ""));
    addProperty(new PointListProperty(PROP_POINTS, "Points", WidgetPropertyCategory.Display, new PointList()));
    addProperty(new ComboProperty(PROP_LINE_JUMP_ADD, "Add Line Jump To", WidgetPropertyCategory.Display, LineJumpAdd.stringValues(), 0));
    addProperty(new ComboProperty(PROP_LINE_JUMP_STYLE, "Line Jump Style", WidgetPropertyCategory.Display, LineJumpStyle.stringValues(), 0));
    addProperty(new IntegerProperty(PROP_LINE_JUMP_SIZE, "Line Jump Size", WidgetPropertyCategory.Display, 10, 1, 100));
    AbstractWidgetProperty loadedFromLinkingContainer = new StringProperty(PROP_IS_LOADED_FROM_LINKING_CONTAINER, "Is Loaded From Linking Container", WidgetPropertyCategory.Behavior, "false");
    addProperty(loadedFromLinkingContainer);
    setPropertyVisibleAndSavable(PROP_IS_LOADED_FROM_LINKING_CONTAINER, false, false);
    setPropertyVisibleAndSavable(PROP_POINTS, false, true);
    AbstractWidgetProperty srcWUIDProp = new StringProperty(PROP_SRC_WUID, "Source WUID", WidgetPropertyCategory.Display, "");
    addProperty(srcWUIDProp);
    srcWUIDProp.addPropertyChangeListener(evt -> {
        if (displayModel == null) {
            return;
        }
        var wuid = evt.getNewValue().toString();
        var path = getPropertyValue(PROP_SRC_PATH).toString();
        AbstractWidgetModel w = null;
        if (path == null || path.equals("")) {
            w = getTerminal(displayModel, null, wuid);
        } else {
            List<String> paths = Arrays.asList(path.split(PATH_DELIMITER));
            w = getTerminal(displayModel, paths, wuid);
        }
        if (w != null) {
            source = w;
            reconnect();
        } else {
            throw new IllegalArgumentException("Non exist widget PATH:[" + path + "],\nWUID:[" + wuid + "]");
        }
    });
    AbstractWidgetProperty tgtWUIDProp = new StringProperty(PROP_TGT_WUID, "Target WUID", WidgetPropertyCategory.Display, "");
    addProperty(tgtWUIDProp);
    tgtWUIDProp.addPropertyChangeListener(evt -> {
        if (displayModel == null) {
            return;
        }
        var wuid = evt.getNewValue().toString();
        var path = getPropertyValue(PROP_TGT_PATH).toString();
        AbstractWidgetModel w = null;
        if (path == null || path.equals("")) {
            w = getTerminal(displayModel, null, wuid);
        } else {
            List<String> paths = Arrays.asList(path.split(PATH_DELIMITER));
            w = getTerminal(displayModel, paths, wuid);
        }
        if (w != null) {
            target = w;
            reconnect();
        } else {
            throw new IllegalArgumentException("Non exist widget PATH:[" + path + "],\nWUID:[" + wuid + "]");
        }
    });
    AbstractWidgetProperty srcPathProp = new StringProperty(PROP_SRC_PATH, "Source Path", WidgetPropertyCategory.Display, "");
    addProperty(srcPathProp);
    AbstractWidgetProperty tgtPathProp = new StringProperty(PROP_TGT_PATH, "Target Path", WidgetPropertyCategory.Display, "");
    addProperty(tgtPathProp);
    setPropertyVisibleAndSavable(PROP_SRC_WUID, false, true);
    setPropertyVisibleAndSavable(PROP_TGT_WUID, false, true);
    setPropertyVisibleAndSavable(PROP_SRC_PATH, false, true);
    setPropertyVisibleAndSavable(PROP_TGT_PATH, false, true);
    setPropertyVisibleAndSavable(PROP_SRC_TERM, false, true);
    setPropertyVisibleAndSavable(PROP_TGT_TERM, false, true);
    removeProperty(PROP_BORDER_COLOR);
    removeProperty(PROP_BORDER_STYLE);
    removeProperty(PROP_BORDER_WIDTH);
    removeProperty(PROP_VISIBLE);
    removeProperty(PROP_ENABLED);
    removeProperty(PROP_TOOLTIP);
    removeProperty(PROP_ACTIONS);
    removeProperty(PROP_FONT);
    removeProperty(PROP_XPOS);
    removeProperty(PROP_YPOS);
    removeProperty(PROP_WIDTH);
    removeProperty(PROP_HEIGHT);
    removeProperty(PROP_RULES);
    removeProperty(PROP_ACTIONS);
    removeProperty(PROP_SCRIPTS);
    removeProperty(PROP_COLOR_BACKGROUND);
    removeProperty(PROP_COLOR_FOREGROUND);
    removeProperty(PROP_SCALE_OPTIONS);
}
Also used : ComboProperty(org.csstudio.opibuilder.properties.ComboProperty) IntegerProperty(org.csstudio.opibuilder.properties.IntegerProperty) PointList(org.eclipse.draw2d.geometry.PointList) BooleanProperty(org.csstudio.opibuilder.properties.BooleanProperty) AbstractWidgetProperty(org.csstudio.opibuilder.properties.AbstractWidgetProperty) StringProperty(org.csstudio.opibuilder.properties.StringProperty) PointListProperty(org.csstudio.opibuilder.properties.PointListProperty) ColorProperty(org.csstudio.opibuilder.properties.ColorProperty)

Example 32 with BooleanProperty

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

the class TabModel method configureProperties.

@Override
protected void configureProperties() {
    addProperty(new IntegerProperty(PROP_TAB_COUNT, "Tab Count", WidgetPropertyCategory.Behavior, 1, 1, MAX_TABS_AMOUNT));
    addProperty(new BooleanProperty(PROP_HORIZONTAL_TABS, "Horizontal Tabs", WidgetPropertyCategory.Display, true));
    addProperty(new IntegerProperty(PROP_ACTIVE_TAB, "Active Tab", WidgetPropertyCategory.Display, 0, 0, MAX_TABS_AMOUNT - 1));
    addProperty(new IntegerProperty(PROP_MINIMUM_TAB_HEIGHT, "Minimum Tab Height", WidgetPropertyCategory.Display, 10, 10, 1000));
    setPropertyVisible(PROP_FONT, false);
    addTabsProperties();
}
Also used : IntegerProperty(org.csstudio.opibuilder.properties.IntegerProperty) BooleanProperty(org.csstudio.opibuilder.properties.BooleanProperty)

Example 33 with BooleanProperty

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

the class TextUpdateModel method configureProperties.

@Override
protected void configureProperties() {
    pvModel = true;
    super.configureProperties();
    WidgetPropertyCategory category = new WidgetPropertyCategory() {

        @Override
        public String toString() {
            return "Format";
        }
    };
    addProperty(new ComboProperty(PROP_FORMAT_TYPE, "Format Type", category, FormatEnum.stringValues(), 0));
    addProperty(new IntegerProperty(PROP_PRECISION, "Precision", category, 0, 0, 100));
    addProperty(new BooleanProperty(PROP_PRECISION_FROM_DB, "Precision from PV", category, true));
    addProperty(new BooleanProperty(PROP_SHOW_UNITS, "Show Units", category, true));
    addProperty(new DoubleProperty(PROP_ROTATION, "Rotation Angle", WidgetPropertyCategory.Display, 0, 0, 360));
    setPropertyValue(PROP_TEXT, "######");
    setPropertyValue(PROP_ALIGN_H, 0);
    setPropertyValue(PROP_ALIGN_V, 1);
    setPropertyVisible(PROP_SHOW_SCROLLBAR, false);
}
Also used : ComboProperty(org.csstudio.opibuilder.properties.ComboProperty) IntegerProperty(org.csstudio.opibuilder.properties.IntegerProperty) BooleanProperty(org.csstudio.opibuilder.properties.BooleanProperty) WidgetPropertyCategory(org.csstudio.opibuilder.properties.WidgetPropertyCategory) DoubleProperty(org.csstudio.opibuilder.properties.DoubleProperty)

Example 34 with BooleanProperty

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

the class ThumbWheelModel method configureProperties.

@Override
protected void configureProperties() {
    // addProperty(new DoubleProperty(PROP_VALUE, "Value",
    // WidgetPropertyCategory.Behavior, 0));
    addProperty(new DoubleProperty(PROP_MIN, "Minimum", WidgetPropertyCategory.Behavior, DEFAULT_MIN));
    addProperty(new DoubleProperty(PROP_MAX, "Maximum", WidgetPropertyCategory.Behavior, DEFAULT_MAX));
    addProperty(new IntegerProperty(PROP_INTEGER_DIGITS_PART, "Integer Digits", WidgetPropertyCategory.Behavior, DEFAULT_INTEGER_DIGITS));
    addProperty(new IntegerProperty(PROP_DECIMAL_DIGITS_PART, "Decimal Digits", WidgetPropertyCategory.Behavior, DEFAULT_DECIMAL_DIGITS));
    addProperty(new ColorProperty(PROP_INTERNAL_FRAME_COLOR, "Internal Frame Color", WidgetPropertyCategory.Display, ColorConstants.black.getRGB()));
    addProperty(new ColorProperty(PROP_INTERNAL_FOCUSED_FRAME_COLOR, "Focused Frame Color", WidgetPropertyCategory.Display, ColorConstants.blue.getRGB()));
    addProperty(new IntegerProperty(PROP_INTERNAL_FRAME_THICKNESS, "Internal Frame Thickness", WidgetPropertyCategory.Display, 1));
    addProperty(new BooleanProperty(PROP_LIMITS_FROM_PV, "Limits From PV", WidgetPropertyCategory.Behavior, false));
    addProperty(new BooleanProperty(PROP_SHOW_BUTTONS, "Show Buttons", WidgetPropertyCategory.Display, true));
}
Also used : IntegerProperty(org.csstudio.opibuilder.properties.IntegerProperty) BooleanProperty(org.csstudio.opibuilder.properties.BooleanProperty) DoubleProperty(org.csstudio.opibuilder.properties.DoubleProperty) ColorProperty(org.csstudio.opibuilder.properties.ColorProperty)

Example 35 with BooleanProperty

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

the class XYGraphModel method addTraceProperty.

private void addTraceProperty(TraceProperty traceProperty, int traceIndex) {
    var propID = makeTracePropID(traceProperty.propIDPre, traceIndex);
    WidgetPropertyCategory category = new NameDefinedCategory("Trace " + traceIndex);
    switch(traceProperty) {
        case NAME:
            addProperty(new StringProperty(propID, traceProperty.toString(), category, "$(" + makeTracePropID(TraceProperty.YPV.propIDPre, traceIndex) + ")"));
            break;
        case ANTI_ALIAS:
            // case CHRONOLOGICAL:
            addProperty(new BooleanProperty(propID, traceProperty.toString(), category, true));
            break;
        case BUFFER_SIZE:
            addProperty(new IntegerProperty(propID, traceProperty.toString(), category, DEFAULT_BUFFER_SIZE, 1, MAX_BUFFER_SIZE));
            break;
        case CONCATENATE_DATA:
            addProperty(new BooleanProperty(propID, traceProperty.toString(), category, true));
            break;
        // break;
        case LINE_WIDTH:
            addProperty(new IntegerProperty(propID, traceProperty.toString(), category, 1, 1, 100));
            break;
        case PLOTMODE:
            addProperty(new ComboProperty(propID, traceProperty.toString(), category, PlotMode.stringValues(), 0));
            break;
        case POINT_SIZE:
            addProperty(new IntegerProperty(propID, traceProperty.toString(), category, 4, 1, 200));
            break;
        case POINT_STYLE:
            addProperty(new ComboProperty(propID, traceProperty.toString(), category, PointStyle.stringValues(), 0));
            break;
        case TRACE_COLOR:
            addProperty(new ColorProperty(propID, traceProperty.toString(), category, XYGraph.DEFAULT_TRACES_COLOR[traceIndex % XYGraph.DEFAULT_TRACES_COLOR.length]));
            break;
        case TRACE_TYPE:
            addProperty(new ComboProperty(propID, traceProperty.toString(), category, TraceType.stringValues(), 0));
            break;
        // break;
        case UPDATE_DELAY:
            addProperty(new IntegerProperty(propID, traceProperty.toString(), category, 100, 0, 655350));
            break;
        case UPDATE_MODE:
            addProperty(new ComboProperty(propID, traceProperty.toString(), category, UpdateMode.stringValues(), 0));
            break;
        case XAXIS_INDEX:
            addProperty(new ComboProperty(propID, traceProperty.toString(), category, AXES_ARRAY, 0));
            break;
        case XPV:
            addPVProperty(new PVNameProperty(propID, traceProperty.toString(), category, ""), new PVValueProperty(makeTracePropID(TraceProperty.XPV_VALUE.propIDPre, traceIndex), null));
            break;
        case YPV:
            addPVProperty(new PVNameProperty(propID, traceProperty.toString(), category, traceIndex == 0 ? "$(" + PROP_PVNAME + ")" : ""), new PVValueProperty(makeTracePropID(TraceProperty.YPV_VALUE.propIDPre, traceIndex), null));
            break;
        case YAXIS_INDEX:
            addProperty(new ComboProperty(propID, traceProperty.toString(), category, AXES_ARRAY, 1));
            break;
        case VISIBLE:
            addProperty(new BooleanProperty(propID, traceProperty.toString(), category, true));
            break;
        default:
            break;
    }
}
Also used : ComboProperty(org.csstudio.opibuilder.properties.ComboProperty) IntegerProperty(org.csstudio.opibuilder.properties.IntegerProperty) BooleanProperty(org.csstudio.opibuilder.properties.BooleanProperty) StringProperty(org.csstudio.opibuilder.properties.StringProperty) WidgetPropertyCategory(org.csstudio.opibuilder.properties.WidgetPropertyCategory) PVValueProperty(org.csstudio.opibuilder.properties.PVValueProperty) NameDefinedCategory(org.csstudio.opibuilder.properties.NameDefinedCategory) ColorProperty(org.csstudio.opibuilder.properties.ColorProperty) PVNameProperty(org.csstudio.opibuilder.properties.PVNameProperty)

Aggregations

BooleanProperty (org.csstudio.opibuilder.properties.BooleanProperty)56 IntegerProperty (org.csstudio.opibuilder.properties.IntegerProperty)27 ColorProperty (org.csstudio.opibuilder.properties.ColorProperty)24 ComboProperty (org.csstudio.opibuilder.properties.ComboProperty)19 StringProperty (org.csstudio.opibuilder.properties.StringProperty)17 DoubleProperty (org.csstudio.opibuilder.properties.DoubleProperty)15 ActionsProperty (org.csstudio.opibuilder.properties.ActionsProperty)7 FilePathProperty (org.csstudio.opibuilder.properties.FilePathProperty)7 WidgetPropertyCategory (org.csstudio.opibuilder.properties.WidgetPropertyCategory)5 FontProperty (org.csstudio.opibuilder.properties.FontProperty)4 PVNameProperty (org.csstudio.opibuilder.properties.PVNameProperty)4 PVValueProperty (org.csstudio.opibuilder.properties.PVValueProperty)4 RGB (org.eclipse.swt.graphics.RGB)4 StringListProperty (org.csstudio.opibuilder.properties.StringListProperty)3 ArrayList (java.util.ArrayList)2 ComplexDataProperty (org.csstudio.opibuilder.properties.ComplexDataProperty)2 NameDefinedCategory (org.csstudio.opibuilder.properties.NameDefinedCategory)2 OPIColor (org.csstudio.opibuilder.util.OPIColor)2 UID (java.rmi.server.UID)1 DisplayScaleData (org.csstudio.opibuilder.datadefinition.DisplayScaleData)1