Search in sources :

Example 16 with ComboProperty

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

the class NativeTextModel method configureProperties.

@Override
protected void configureProperties() {
    super.configureProperties();
    addProperty(new BooleanProperty(PROP_SHOW_NATIVE_BORDER, "Show Native Border", WidgetPropertyCategory.Display, false));
    addProperty(new BooleanProperty(PROP_PASSWORD_INPUT, "Password Input", WidgetPropertyCategory.Behavior, false));
    addProperty(new BooleanProperty(PROP_READ_ONLY, "Read Only", WidgetPropertyCategory.Behavior, true));
    addProperty(new BooleanProperty(PROP_SHOW_H_SCROLL, "Show Horizontal Scrollbar", WidgetPropertyCategory.Display, false));
    addProperty(new BooleanProperty(PROP_SHOW_V_SCROLL, "Show Vertical Scrollbar", WidgetPropertyCategory.Display, false));
    addProperty(new ComboProperty(PROP_NEXT_FOCUS, "Next Focus", WidgetPropertyCategory.Behavior, FOCUS_TRAVERSE.stringValues(), 0));
    removeProperty(PROP_TRANSPARENT);
    removeProperty(PROP_ROTATION);
    removeProperty(PROP_ALIGN_V);
    removeProperty(PROP_DATETIME_FORMAT);
    removeProperty(PROP_SELECTOR_TYPE);
    removeProperty(PROP_FILE_RETURN_PART);
    removeProperty(PROP_FILE_SOURCE);
    removeProperty(PROP_SHOW_SCROLLBAR);
// If border is alarm sensitive, redraw the border will also redraw the whole canvas in WebOPI
// so make it invisible to make sure user can get best performance.
// Maybe border is not frequently changed?
// setPropertyVisible(PROP_BORDER_ALARMSENSITIVE, false);
}
Also used : ComboProperty(org.csstudio.opibuilder.properties.ComboProperty) BooleanProperty(org.csstudio.opibuilder.properties.BooleanProperty)

Example 17 with ComboProperty

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

the class SpinnerModel method configureProperties.

@Override
protected void configureProperties() {
    pvModel = true;
    super.configureProperties();
    removeProperty(LabelModel.PROP_AUTOSIZE);
    removeProperty(LabelModel.PROP_SHOW_SCROLLBAR);
    removeProperty(LabelModel.PROP_WRAP_WORDS);
    setPropertyVisible(LabelModel.PROP_TEXT, false);
    addProperty(new DoubleProperty(PROP_MIN, "Minimum", WidgetPropertyCategory.Behavior, DEFAULT_MIN));
    addProperty(new DoubleProperty(PROP_MAX, "Maximum", WidgetPropertyCategory.Behavior, DEFAULT_MAX));
    addProperty(new DoubleProperty(PROP_STEP_INCREMENT, "Step Increment", WidgetPropertyCategory.Behavior, DEFAULT_STEP_INCREMENT), true);
    addProperty(new DoubleProperty(PROP_PAGE_INCREMENT, "Page Increment", WidgetPropertyCategory.Behavior, DEFAULT_PAGE_INCREMENT), true);
    addProperty(new BooleanProperty(PROP_LIMITS_FROM_PV, "Limits from PV", WidgetPropertyCategory.Behavior, true));
    addProperty(new ComboProperty(PROP_FORMAT, "Format", WidgetPropertyCategory.Display, NumericFormatType.stringValues(), 0));
    addProperty(new IntegerProperty(PROP_PRECISION, "Precision", WidgetPropertyCategory.Display, 3, 0, 100));
    addProperty(new BooleanProperty(PROP_PRECISION_FROM_PV, "Precision from PV", WidgetPropertyCategory.Display, false));
    addProperty(new BooleanProperty(PROP_BUTTONS_ON_LEFT, "Buttons on Left", WidgetPropertyCategory.Display, false));
    addProperty(new BooleanProperty(PROP_HORIZONTAL_BUTTONS_LAYOUT, "Horizontal Buttons Layout", WidgetPropertyCategory.Display, false));
    addProperty(new BooleanProperty(PROP_SHOW_TEXT, "Show text", WidgetPropertyCategory.Display, true));
}
Also used : ComboProperty(org.csstudio.opibuilder.properties.ComboProperty) IntegerProperty(org.csstudio.opibuilder.properties.IntegerProperty) BooleanProperty(org.csstudio.opibuilder.properties.BooleanProperty) DoubleProperty(org.csstudio.opibuilder.properties.DoubleProperty)

Example 18 with ComboProperty

use of org.csstudio.opibuilder.properties.ComboProperty 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 19 with ComboProperty

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

the class XYGraphModel method addTraceProperty.

private void addTraceProperty(TraceProperty traceProperty, int traceIndex) {
    String 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, // $NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
            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)

Example 20 with ComboProperty

use of org.csstudio.opibuilder.properties.ComboProperty 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(new PropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            if (displayModel == null)
                return;
            String wuid = evt.getNewValue().toString();
            String 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(new PropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            if (displayModel == null)
                return;
            String wuid = evt.getNewValue().toString();
            String 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) PropertyChangeEvent(java.beans.PropertyChangeEvent) PropertyChangeListener(java.beans.PropertyChangeListener) BooleanProperty(org.csstudio.opibuilder.properties.BooleanProperty) AbstractWidgetProperty(org.csstudio.opibuilder.properties.AbstractWidgetProperty) StringProperty(org.csstudio.opibuilder.properties.StringProperty) PointListProperty(org.csstudio.opibuilder.properties.PointListProperty) PointList(org.eclipse.draw2d.geometry.PointList) List(java.util.List) ColorProperty(org.csstudio.opibuilder.properties.ColorProperty)

Aggregations

ComboProperty (org.csstudio.opibuilder.properties.ComboProperty)20 BooleanProperty (org.csstudio.opibuilder.properties.BooleanProperty)19 IntegerProperty (org.csstudio.opibuilder.properties.IntegerProperty)14 StringProperty (org.csstudio.opibuilder.properties.StringProperty)8 ColorProperty (org.csstudio.opibuilder.properties.ColorProperty)7 DoubleProperty (org.csstudio.opibuilder.properties.DoubleProperty)6 PropertyChangeEvent (java.beans.PropertyChangeEvent)3 PropertyChangeListener (java.beans.PropertyChangeListener)3 FilePathProperty (org.csstudio.opibuilder.properties.FilePathProperty)3 WidgetPropertyCategory (org.csstudio.opibuilder.properties.WidgetPropertyCategory)3 IPath (org.eclipse.core.runtime.IPath)3 Path (org.eclipse.core.runtime.Path)3 ActionsProperty (org.csstudio.opibuilder.properties.ActionsProperty)2 PVNameProperty (org.csstudio.opibuilder.properties.PVNameProperty)2 PVValueProperty (org.csstudio.opibuilder.properties.PVValueProperty)2 RGB (org.eclipse.swt.graphics.RGB)2 UID (java.rmi.server.UID)1 List (java.util.List)1 WidgetScaleData (org.csstudio.opibuilder.datadefinition.WidgetScaleData)1 AbstractWidgetModel (org.csstudio.opibuilder.model.AbstractWidgetModel)1