Java Code Examples for org.netbeans.api.visual.model.ObjectState#isSelected()
The following examples show how to use
org.netbeans.api.visual.model.ObjectState#isSelected() .
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: BlockWidget.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
@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); } } }
Example 2
Source File: GraphColorScheme.java From Llunatic with GNU General Public License v3.0 | 6 votes |
@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 3
Source File: BlockWidget.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
@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); } } }
Example 4
Source File: DBColorScheme.java From jeddict with Apache License 2.0 | 6 votes |
@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 5
Source File: FigureWidget.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
@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(); }
Example 6
Source File: PFENotModifiableScheme.java From netbeans with Apache License 2.0 | 6 votes |
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 7
Source File: VMDNetBeans60ColorScheme.java From netbeans with Apache License 2.0 | 6 votes |
public void updateUI (VMDNodeWidget 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 ()) widget.setBorder (BORDER60_HOVER); else if (state.isFocused ()) widget.setBorder (BORDER60_HOVER); else widget.setBorder (BORDER60); }
Example 8
Source File: VMDOriginalColorScheme.java From netbeans with Apache License 2.0 | 6 votes |
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 9
Source File: BlockWidget.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
@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); } } }
Example 10
Source File: GraphColorScheme.java From Llunatic with GNU General Public License v3.0 | 6 votes |
@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); } }
Example 11
Source File: BlockWidget.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
@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); } } }
Example 12
Source File: VMDOriginalColorScheme.java From netbeans with Apache License 2.0 | 5 votes |
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 ()); header.setBorder (state.isFocused () || state.isHovered () ? BORDER_PIN_HOVERED : BORDER_PIN); }
Example 13
Source File: NodeWidget.java From netbeans with Apache License 2.0 | 5 votes |
@Override protected void notifyStateChanged(ObjectState previousState, ObjectState state) { super.notifyStateChanged(previousState, state); boolean repaintNeeded = false; boolean updateNeeded = false; if (paintState != EdgeWidget.DISABLED) { if (!previousState.isHovered() && state.isHovered()) { hoverTimer.restart(); repaintNeeded = true; } if (previousState.isHovered() && !state.isHovered()) { hoverTimer.stop(); repaintNeeded = true; updateNeeded = enlargedFromHover; enlargedFromHover = false; } } if (previousState.isSelected() != state.isSelected()) { updateNeeded = true; } if (updateNeeded) { updateContent(); } else if (repaintNeeded) { repaint(); } }
Example 14
Source File: DependencyGraphScene.java From netbeans with Apache License 2.0 | 5 votes |
@Override protected void notifyStateChanged(ObjectState previousState, ObjectState state) { super.notifyStateChanged(previousState, state); if (!previousState.isSelected() && state.isSelected()) { highlightDepthIntern(); } }
Example 15
Source File: VMDNetBeans60ColorScheme.java From netbeans with Apache License 2.0 | 5 votes |
public void updateUI (VMDPinWidget widget, ObjectState previousState, ObjectState state) { widget.setOpaque (state.isHovered () || state.isFocused ()); if (state.isSelected ()) widget.setBorder (BORDER60_PIN_SELECT); else widget.setBorder (VMDOriginalColorScheme.BORDER_PIN); }
Example 16
Source File: TableWidget.java From netbeans with Apache License 2.0 | 5 votes |
protected void notifyStateChanged(ObjectState previousState, ObjectState state) { if (previousState.isSelected() != state.isSelected() || previousState.isFocused() != state.isFocused()) { setBorder(state.isSelected() ? state.isFocused()? BorderFactory.createDashedBorder(SELECTED_BORDER_COLOR, 2, 2, true): BorderFactory.createLineBorder(1,SELECTED_BORDER_COLOR) : state.isFocused() ? BorderFactory.createDashedBorder (BORDER_COLOR, 2, 2, true):new LineBorder(1,0,0,0,BORDER_COLOR)); revalidate(true); } }
Example 17
Source File: FigureWidget.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
@Override protected void notifyStateChanged(ObjectState previousState, ObjectState state) { super.notifyStateChanged(previousState, state); Color borderColor = Color.BLACK; int thickness = 1; boolean repaint = false; Font f = font; if (state.isSelected()) { thickness = 1; f = boldFont; } if (state.isHovered()) { borderColor = Color.BLUE; } if (state.isHovered() != previousState.isHovered()) { repaint = true; } if (state.isSelected() != previousState.isSelected()) { repaint = true; } if (repaint) { middleWidget.setBorder(BorderFactory.createLineBorder(borderColor, thickness)); for (LabelWidget labelWidget : labelWidgets) { labelWidget.setFont(f); } repaint(); } }
Example 18
Source File: FigureWidget.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
@Override protected void notifyStateChanged(ObjectState previousState, ObjectState state) { super.notifyStateChanged(previousState, state); Color borderColor = Color.BLACK; int thickness = 1; boolean repaint = false; Font f = font; if (state.isSelected()) { thickness = 1; f = boldFont; } if (state.isHovered()) { borderColor = Color.BLUE; } if (state.isHovered() != previousState.isHovered()) { repaint = true; } if (state.isSelected() != previousState.isSelected()) { repaint = true; } if (repaint) { middleWidget.setBorder(BorderFactory.createLineBorder(borderColor, thickness)); for (LabelWidget labelWidget : labelWidgets) { labelWidget.setFont(f); } repaint(); } }
Example 19
Source File: FigureWidget.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
@Override protected void notifyStateChanged(ObjectState previousState, ObjectState state) { super.notifyStateChanged(previousState, state); Color borderColor = Color.BLACK; int thickness = 1; boolean repaint = false; Font f = font; if (state.isSelected()) { thickness = 1; f = boldFont; } if (state.isHovered()) { borderColor = Color.BLUE; } if (state.isHovered() != previousState.isHovered()) { repaint = true; } if (state.isSelected() != previousState.isSelected()) { repaint = true; } if (repaint) { middleWidget.setBorder(BorderFactory.createLineBorder(borderColor, thickness)); for (LabelWidget labelWidget : labelWidgets) { labelWidget.setFont(f); } repaint(); } }
Example 20
Source File: DefaultLookFeel.java From netbeans with Apache License 2.0 | 4 votes |
public boolean getOpaque (ObjectState state) { return state.isHovered () || state.isSelected (); }