本文整理汇总了Java中org.netbeans.api.visual.model.ObjectState.isSelected方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectState.isSelected方法的具体用法?Java ObjectState.isSelected怎么用?Java ObjectState.isSelected使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.netbeans.api.visual.model.ObjectState
的用法示例。
在下文中一共展示了ObjectState.isSelected方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateUI
import org.netbeans.api.visual.model.ObjectState; //导入方法依赖的package包/类
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);
}
}
示例2: notifyStateChanged
import org.netbeans.api.visual.model.ObjectState; //导入方法依赖的package包/类
@Override
public void notifyStateChanged(ObjectState oldState, ObjectState newState) {
setForeground (getLineColor());
if(newState.isHighlighted() && !oldState.isHighlighted()){
this.setStroke(previewStroke);
this.setVisible(true);
} else {
if(newState.isSelected()){
this.setStroke(selectedStroke);
} else {
this.setStroke(defaultStroke);
}
if(this.isEdgeVisible()){
this.setVisible(true);
} else {
this.setVisible(false);
}
}
}
示例3: updateUI
import org.netbeans.api.visual.model.ObjectState; //导入方法依赖的package包/类
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);
}
}
示例4: notifyStateChanged
import org.netbeans.api.visual.model.ObjectState; //导入方法依赖的package包/类
@Override
protected void notifyStateChanged(ObjectState previousState, ObjectState state) {
super.notifyStateChanged(previousState, state);
Font font = this.figure.getDiagram().getFont();
if (state.isSelected()) {
font = this.figure.getDiagram().getBoldFont();
}
Color borderColor = Color.BLACK;
Color innerBorderColor = getFigure().getColor();
if (state.isHighlighted()) {
innerBorderColor = borderColor = Color.BLUE;
}
middleWidget.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(borderColor, 1), BorderFactory.createLineBorder(innerBorderColor, 1)));
for (LabelWidget labelWidget : labelWidgets) {
labelWidget.setFont(font);
}
repaint();
}
示例5: updateStatus
import org.netbeans.api.visual.model.ObjectState; //导入方法依赖的package包/类
/**
* Update the status of the switch to the current state of the edges
* usually needed when the opposit switch changes the state
*/
private void updateStatus(){
Collection<CfgEdge> edges = this.getEdges();
boolean hiddenFound=false;
for(CfgEdge e: edges) {
EdgeWidget ew = (EdgeWidget) scene.findWidget(e);
if(!ew.isVisible()) {
hiddenFound=true;
break;
}
}
ObjectState os = this.getState();
if(os.isSelected() && !hiddenFound) {
this.setState(os.deriveSelected(false));
setToolTipText(TT_HIDE_EDGES);
} else if (!os.isSelected() && hiddenFound) {
this.setState(os.deriveSelected(true));
setToolTipText(TT_SHOW_EDGES);
}
this.revalidate();
}
示例6: notifyStateChanged
import org.netbeans.api.visual.model.ObjectState; //导入方法依赖的package包/类
@Override
protected void notifyStateChanged(ObjectState previousState, ObjectState state) {
super.notifyStateChanged(previousState, state);
if (previousState.isHovered() != state.isHovered()) {
if (state.isHovered()) {
this.setBorder(BorderFactory.createLineBorder(1, HOVER_FOREGROUND_COLOR));
} else {
this.setBorder(BorderFactory.createLineBorder(1, NORMAL_FOREGROUND_COLOR));
}
}
if (previousState.isSelected() != state.isSelected()) {
if (state.isSelected()) {
this.setFont(boldFont);
} else {
this.setFont(font);
}
}
}
示例7: notifyStateChanged
import org.netbeans.api.visual.model.ObjectState; //导入方法依赖的package包/类
@Override
protected void notifyStateChanged(ObjectState previousState, ObjectState state) {
// System.out.println("is" + state.isSelected());
// System.out.println("ih" + state.isHovered());
if ((previousState.isSelected() == false) && (state.isSelected() == true)) {
// Going from not selected to selected.
// Need to remove the background and changed the font back to the
// standard color.
selectAction();
} else {
// Going from selected to not selected
setOpaque(false);
// setForeground(previousColor);
setBorder(NodeWidget.DEFAULT_BORDER);
if (connector instanceof INodeWidget && !connector.getState().isSelected()) {
((INodeWidget) connector).hideResizeBorder();
}
}
}
示例8: updateUI
import org.netbeans.api.visual.model.ObjectState; //导入方法依赖的package包/类
@Override
public void updateUI(IPNodeWidget widget, ObjectState previousState, ObjectState state) {
if (!previousState.isSelected() && state.isSelected()) {
widget.bringToFront();
}
if (state.isSelected() || state.isFocused()) {
widget.getHeader().setBackground(WIDGET_SELECT_BACKGROUND);
widget.setBorder(WIDGET_SELECT_BORDER);
widget.getMinimizeButton().setImage(this.getMinimizeWidgetImage(widget));
} else if (state.isHovered()) {
widget.getHeader().setBackground(WIDGET_HOVER_BACKGROUND);
widget.setBorder(WIDGET_HOVER_BORDER);
widget.getMinimizeButton().setImage(this.getMinimizeWidgetImage(widget));
} else {
widget.getHeader().setBackground(WIDGET_BACKGROUND);
widget.setBorder(WIDGET_BORDER);
widget.getMinimizeButton().setImage(BUTTON_W);
}
}
示例9: updateUI
import org.netbeans.api.visual.model.ObjectState; //导入方法依赖的package包/类
@Override
public void updateUI(IPNodeWidget widget, ObjectState previousState, ObjectState state) {
if (!previousState.isSelected() && state.isSelected()) {
widget.bringToFront();
}
boolean hover = state.isHovered() || state.isFocused();
widget.getHeader().setOpaque(hover);
if (state.isSelected()) {
widget.setBorder(BORDER60_SELECT);
} else if (state.isHovered() || state.isFocused()) {
widget.setBorder(BORDER60_HOVER);
} else {
widget.setBorder(BORDER60);
}
}
示例10: updateUI
import org.netbeans.api.visual.model.ObjectState; //导入方法依赖的package包/类
@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);
}
}
示例11: updateUI
import org.netbeans.api.visual.model.ObjectState; //导入方法依赖的package包/类
@Override
public void updateUI(IPEdgeWidget 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);
}
}
示例12: notifyStateChanged
import org.netbeans.api.visual.model.ObjectState; //导入方法依赖的package包/类
@Override
public void notifyStateChanged(ObjectState previousState, ObjectState newState) {
super.notifyStateChanged(previousState, newState);
if (this.getNodeWidgetInfo() != null) {
if (this instanceof IModelerSubScene) {
this.bringToBack();
}
if (newState.isSelected()) {
getModelerScene().manageLayerWidget();
showResizeBorder();
} else if (newState.isHovered()) {
hoverWidget();
} else {
unhoverWidget();
hideResizeBorder();
}
}
}
示例13: updateUI
import org.netbeans.api.visual.model.ObjectState; //导入方法依赖的package包/类
@Override
public void updateUI(VMDNodeWidget widget, ObjectState previousState, ObjectState state) {
if (!previousState.isSelected() && state.isSelected()) {
widget.bringToFront();
} else if (!previousState.isHovered() && state.isHovered()) {
widget.bringToFront();
}
Widget header = widget.getHeader();
header.setOpaque(state.isSelected());
if (state.isFocused() || state.isHovered()) {
header.setBorder(BORDER_PIN_HOVERED);
} else {
header.setBorder(HEADER_BORDER_PIN);
}
}
示例14: onNodeHover
import org.netbeans.api.visual.model.ObjectState; //导入方法依赖的package包/类
/**
* Called when a node starts being hovered
* @param n The node
* @param w The widget
*/
protected void onNodeHover(N n, Widget w) {
ObjectState state = getObjectState(n);
boolean hasSelection = !getSelectedObjects().isEmpty();
boolean connected = getSelection().isConnectedToSelection(n);
boolean indirect = !connected && !state.isSelected() && getSelection().isIndirectlyConnectedToSelection(n);
States[] states = state.isSelected()
? new States[]{SELECTED, HOVERED}
: hasSelection
? new States[]{HOVERED, connected ? CONNECTED_TO_SELECTION : indirect ? INDIRECTLY_CONNECTED_TO_SELECTION : UNRELATED_TO_SELECTION}
: new States[]{HOVERED};
Color c = colors.getEdgeColor(states);
for (E edge : findNodeEdges(n, true, false)) {
Widget w1 = findWidget(edge);
getSceneAnimator().animateForegroundColor(w1, c);
}
getSceneAnimator().animateBackgroundColor(w, colors.getBackground(states));
}
示例15: notifyStateChanged
import org.netbeans.api.visual.model.ObjectState; //导入方法依赖的package包/类
@Override
protected void notifyStateChanged(ObjectState previousState, ObjectState state) {
super.notifyStateChanged(previousState, state);
if (!previousState.isSelected() && state.isSelected()) {
highlightDepthIntern();
}
}