org.netbeans.api.visual.anchor.PointShape Java Examples

The following examples show how to use org.netbeans.api.visual.anchor.PointShape. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: VMDOriginalColorScheme.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void updateUI (VMDConnectionWidget widget, ObjectState previousState, ObjectState state) {
    if (state.isHovered ())
        widget.setForeground (COLOR_HOVERED);
    else if (state.isSelected ())
        widget.setForeground (COLOR_SELECTED);
    else if (state.isHighlighted ())
        widget.setForeground (COLOR_HIGHLIGHTED);
    else if (state.isFocused ())
        widget.setForeground (COLOR_HOVERED);
    else
        widget.setForeground (COLOR_NORMAL);

    if (state.isSelected ()) {
        widget.setControlPointShape (PointShape.SQUARE_FILLED_SMALL);
        widget.setEndPointShape (PointShape.SQUARE_FILLED_BIG);
    } else {
        widget.setControlPointShape (PointShape.NONE);
        widget.setEndPointShape (POINT_SHAPE_IMAGE);
    }
}
 
Example #2
Source File: VMDNetBeans60ColorScheme.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void updateUI (VMDConnectionWidget widget, ObjectState previousState, ObjectState state) {
    if (state.isSelected ())
        widget.setForeground (COLOR60_SELECT);
    else if (state.isHighlighted ())
        widget.setForeground (VMDOriginalColorScheme.COLOR_HIGHLIGHTED);
    else if (state.isHovered ()  ||  state.isFocused ())
        widget.setForeground (COLOR60_HOVER);
    else
        widget.setForeground (VMDOriginalColorScheme.COLOR_NORMAL);

    if (state.isSelected ()  ||  state.isHovered ()) {
        widget.setControlPointShape (PointShape.SQUARE_FILLED_SMALL);
        widget.setEndPointShape (PointShape.SQUARE_FILLED_BIG);
        widget.setControlPointCutDistance (0);
    } else {
        widget.setControlPointShape (PointShape.NONE);
        widget.setEndPointShape (POINT_SHAPE60_IMAGE);
        widget.setControlPointCutDistance (5);
    }
}
 
Example #3
Source File: ConnectionWidget.java    From netbeans with Apache License 2.0 6 votes vote down vote up
/**
 * Creates a connection widget.
 * @param scene the scene
 */
public ConnectionWidget (Scene scene) {
    super (scene);
    sourceAnchorShape = AnchorShape.NONE;
    targetAnchorShape = AnchorShape.NONE;
    controlPointShape = PointShape.NONE;
    endPointShape = PointShape.NONE;
    router = RouterFactory.createDirectRouter ();
    routingRequired = true;
    connectionWidgetLayout = new ConnectionWidgetLayout ();
    setLayout (connectionWidgetLayout);
    stroke = STROKE_DEFAULT;
    paintControlPoints = false;
    controlPointCutDistance = 0;
    sourceEntry = new ConnectionEntry (true);
    targetEntry = new ConnectionEntry (false);

    routingPolicy = RoutingPolicy.ALWAYS_ROUTE;
}
 
Example #4
Source File: PFENotModifiableScheme.java    From netbeans with Apache License 2.0 6 votes vote down vote up
public void updateUI (VMDConnectionWidget widget, ObjectState previousState, ObjectState state) {
    if (state.isSelected ()) {
        widget.setForeground (COLOR60_SELECT);
    } else if (state.isHighlighted ()) {
        widget.setForeground (COLOR_HIGHLIGHTED);
    } else if (state.isHovered ()  ||  state.isFocused ()) {
        widget.setForeground (COLOR60_HOVER);
    } else {
        widget.setForeground (COLOR_NORMAL);
    }

    if (state.isSelected ()  ||  state.isHovered ()) {
        widget.setControlPointShape (PointShape.SQUARE_FILLED_SMALL);
        widget.setEndPointShape (PointShape.SQUARE_FILLED_BIG);
        widget.setControlPointCutDistance (0);
    } else {
        widget.setControlPointShape (PointShape.NONE);
        widget.setEndPointShape (POINT_SHAPE_IMAGE);
        widget.setControlPointCutDistance (5);
    }
}
 
Example #5
Source File: DBColorScheme.java    From jeddict with Apache License 2.0 6 votes vote down vote up
@Override
public void updateUI(IPEdgeWidget widget, ObjectState previousState, ObjectState state) {
    if (state.isSelected()) {
        widget.setForeground(EDGE_WIDGET_SELECT_COLOR);
    } else if (state.isHovered() || state.isFocused()) {
        widget.setForeground(EDGE_WIDGET_HOVER_COLOR);
    } else {
        widget.setForeground(EDGE_WIDGET_COLOR);
    }

    if (state.isSelected()) {
        widget.setControlPointShape(PointShape.SQUARE_FILLED_SMALL);
        widget.setEndPointShape(PointShape.SQUARE_FILLED_BIG);
        widget.setControlPointCutDistance(0);
    } else if (state.isHovered()) {
        widget.setControlPointShape(PointShape.SQUARE_FILLED_SMALL);
        widget.setEndPointShape(PointShape.SQUARE_FILLED_BIG);
        widget.setControlPointCutDistance(0);
    } else {

        widget.setControlPointShape(PointShape.NONE);
        widget.setEndPointShape(PointShape.NONE);
        widget.setControlPointCutDistance(5);
    }
}
 
Example #6
Source File: GraphColorScheme.java    From Llunatic with GNU General Public License v3.0 6 votes vote down vote up
@Override
    public void updateUI(VMDConnectionWidget widget, ObjectState previousState, ObjectState state) {
//        if (state.isHovered()) {
//            widget.setForeground(COLOR_HOVERED);
//        } else if (state.isSelected()) {
//            widget.setForeground(COLOR_SELECTED);
//        } else if (state.isHighlighted()) {
//            widget.setForeground(COLOR_HIGHLIGHTED);
//        } else if (state.isFocused()) {
//            widget.setForeground(COLOR_HOVERED);
//        } else {
//            widget.setForeground(COLOR_NORMAL);
//        }

        if (state.isSelected()) {
            widget.setControlPointShape(PointShape.SQUARE_FILLED_SMALL);
            widget.setEndPointShape(PointShape.SQUARE_FILLED_BIG);
        } else {
            widget.setControlPointShape(PointShape.NONE);
            widget.setEndPointShape(POINT_SHAPE_IMAGE);
        }
    }
 
Example #7
Source File: ConnectionWidget.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 * Sets a point shape of control points of the connection widget.
 * @param controlPointShape the control points shape
 */
public void setControlPointShape (PointShape controlPointShape) {
    assert controlPointShape != null;
    boolean repaintOnly = this.controlPointShape.getRadius () == controlPointShape.getRadius ();
    this.controlPointShape = controlPointShape;
    revalidate (repaintOnly);
}
 
Example #8
Source File: ConnectionWidget.java    From netbeans with Apache License 2.0 5 votes vote down vote up
/**
 * Sets a point shape of end points of the connection widget.
 * @param endPointShape the end points shape
 */
public void setEndPointShape (PointShape endPointShape) {
    assert endPointShape != null;
    boolean repaintOnly = this.endPointShape.getRadius () == endPointShape.getRadius ();
    this.endPointShape = endPointShape;
    revalidate (repaintOnly);
}
 
Example #9
Source File: Utils.java    From netbeans with Apache License 2.0 5 votes vote down vote up
protected Widget attachEdgeWidget(String edge) {
    ConnectionWidget connection = new ConnectionWidget(this);
    connection.setTargetAnchorShape(AnchorShape.TRIANGLE_FILLED);
    connection.setEndPointShape(PointShape.SQUARE_FILLED_BIG);
    connection.getActions().addAction(createObjectHoverAction());
    connection.getActions().addAction(createSelectAction());
    connection.getActions().addAction(reconnectAction);
    connectionLayer.addChild(connection);
    return connection;
}
 
Example #10
Source File: ConnectionWidget.java    From netbeans with Apache License 2.0 2 votes vote down vote up
/**
 * Returns a point shape of control points of the connection widget.
 * @return the control points shape
 */
public PointShape getControlPointShape () {
    return controlPointShape;
}
 
Example #11
Source File: ConnectionWidget.java    From netbeans with Apache License 2.0 2 votes vote down vote up
/**
 * Returns a point shape of end points of the connection widget.
 * @return the end points shape
 */
public PointShape getEndPointShape () {
    return endPointShape;
}