Search in sources :

Example 1 with PointListProperty

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

the class AbstractPolyModel method configureProperties.

/**
 * {@inheritDoc}
 */
@Override
protected void configureProperties() {
    super.configureProperties();
    addProperty(new DoubleProperty(PROP_ROTATION, "Rotation Angle", WidgetPropertyCategory.Display, 0, 0, 360));
    addProperty(new PointListProperty(PROP_POINTS, "Points", WidgetPropertyCategory.Display, new PointList()));
}
Also used : PointList(org.eclipse.draw2d.geometry.PointList) PointListProperty(org.csstudio.opibuilder.properties.PointListProperty) DoubleProperty(org.csstudio.opibuilder.properties.DoubleProperty)

Example 2 with PointListProperty

use of org.csstudio.opibuilder.properties.PointListProperty 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

PointListProperty (org.csstudio.opibuilder.properties.PointListProperty)2 PointList (org.eclipse.draw2d.geometry.PointList)2 PropertyChangeEvent (java.beans.PropertyChangeEvent)1 PropertyChangeListener (java.beans.PropertyChangeListener)1 List (java.util.List)1 AbstractWidgetProperty (org.csstudio.opibuilder.properties.AbstractWidgetProperty)1 BooleanProperty (org.csstudio.opibuilder.properties.BooleanProperty)1 ColorProperty (org.csstudio.opibuilder.properties.ColorProperty)1 ComboProperty (org.csstudio.opibuilder.properties.ComboProperty)1 DoubleProperty (org.csstudio.opibuilder.properties.DoubleProperty)1 IntegerProperty (org.csstudio.opibuilder.properties.IntegerProperty)1 StringProperty (org.csstudio.opibuilder.properties.StringProperty)1