当前位置: 首页>>代码示例>>Java>>正文


Java ObjectState.isHovered方法代码示例

本文整理汇总了Java中org.netbeans.api.visual.model.ObjectState.isHovered方法的典型用法代码示例。如果您正苦于以下问题:Java ObjectState.isHovered方法的具体用法?Java ObjectState.isHovered怎么用?Java ObjectState.isHovered使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.netbeans.api.visual.model.ObjectState的用法示例。


在下文中一共展示了ObjectState.isHovered方法的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);
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:21,代码来源:VMDOriginalColorScheme.java

示例2: updateUI

import org.netbeans.api.visual.model.ObjectState; //导入方法依赖的package包/类
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);
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:17,代码来源:VMDNetBeans60ColorScheme.java

示例3: 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);
        }
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:21,代码来源:BlockWidget.java

示例4: paintWidget

import org.netbeans.api.visual.model.ObjectState; //导入方法依赖的package包/类
@Override
protected void paintWidget() {
    Graphics2D g = getScene().getGraphics();
    //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
    g.setColor(this.color);
    ObjectState state = this.getState();
    float width = 1.0f;
    if (state.isHovered() || this.popupVisible) {
        width = HOVER_STROKE_WIDTH;
    }

    Stroke oldStroke = g.getStroke();
    g.setStroke(new BasicStroke(width));
    for (Route r : routeList) {
        g.drawLine(r.from.x, r.from.y, r.to.x, r.to.y);
    }
    g.setStroke(oldStroke);
}
 
开发者ID:ojdkbuild,项目名称:lookaside_java-1.8.0-openjdk,代码行数:19,代码来源:MultiConnectionWidget.java

示例5: notifyStateChanged

import org.netbeans.api.visual.model.ObjectState; //导入方法依赖的package包/类
@Override
public void notifyStateChanged(ObjectState previousState, ObjectState state) {

    if (previousState.isHovered() != state.isHovered()) {
        color = connection.getColor();
        if (state.isHovered()) {
            this.setStroke(BOLD_STROKE);
        } else {
            this.setStroke(NORMAL_STROKE);
        }

        if (state.isHovered()) {
            this.setStroke(BOLD_STROKE);
        } else {
            this.setStroke(NORMAL_STROKE);
        }

        repaint();
    }
    super.notifyStateChanged(previousState, state);
}
 
开发者ID:ojdkbuild,项目名称:lookaside_java-1.8.0-openjdk,代码行数:22,代码来源:DiagramConnectionWidget.java

示例6: 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);
    } 
}
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:21,代码来源:PMacColorScheme.java

示例7: 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);
    }
}
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:18,代码来源:PNBColorScheme.java

示例8: 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);
    }
}
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:26,代码来源:PDarkColorScheme.java

示例9: 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);
    }
}
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:23,代码来源:POriginalColorScheme.java

示例10: 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();
        }
    }

}
 
开发者ID:jeddict,项目名称:NBModeler,代码行数:20,代码来源:NodeWidget.java

示例11: 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);
    }
    
}
 
开发者ID:donatellosantoro,项目名称:Llunatic,代码行数:17,代码来源:GraphColorScheme.java

示例12: notifyStateChanged

import org.netbeans.api.visual.model.ObjectState; //导入方法依赖的package包/类
@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();
    }

}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:33,代码来源:NodeWidget.java

示例13: getBorder

import org.netbeans.api.visual.model.ObjectState; //导入方法依赖的package包/类
public Border getBorder (ObjectState state) {
    if (state.isHovered ())
        return BORDER_HOVERED;
    if (state.isSelected ())
        return BORDER_SELECTED;
    if (state.isFocused ())
        return BORDER_HOVERED;
    return BORDER_NORMAL;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:DefaultLookFeel.java

示例14: getMiniBorder

import org.netbeans.api.visual.model.ObjectState; //导入方法依赖的package包/类
public Border getMiniBorder (ObjectState state) {
    if (state.isHovered ())
        return MINI_BORDER_HOVERED;
    if (state.isSelected ())
        return MINI_BORDER_SELECTED;
    if (state.isFocused ())
        return MINI_BORDER_HOVERED;
    return MINI_BORDER_NORMAL;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:DefaultLookFeel.java

示例15: getLineColor

import org.netbeans.api.visual.model.ObjectState; //导入方法依赖的package包/类
public Color getLineColor (ObjectState state) {
    if (state.isHovered ())
        return COLOR_HOVERED;
    if (state.isSelected ())
        return COLOR_SELECTED;
    if (state.isHighlighted ()  || state.isFocused ())
        return COLOR_HIGHLIGHTED;
    return getForeground ();//Color.BLACK;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:10,代码来源:DefaultLookFeel.java


注:本文中的org.netbeans.api.visual.model.ObjectState.isHovered方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。