• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java FigureWidget类的典型用法和代码示例

java 4次浏览

本文整理汇总了Java中com.sun.hotspot.igv.view.widgets.FigureWidget的典型用法代码示例。如果您正苦于以下问题:Java FigureWidget类的具体用法?Java FigureWidget怎么用?Java FigureWidget使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

FigureWidget类属于com.sun.hotspot.igv.view.widgets包,在下文中一共展示了FigureWidget类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: gotoFigures

点赞 3

import com.sun.hotspot.igv.view.widgets.FigureWidget; //导入依赖的package包/类
public void gotoFigures(final List<Figure> figures) {
    Rectangle overall = null;
    showFigures(figures);
    for (Figure f : figures) {

        FigureWidget fw = getFigureWidget(f);
        if (fw != null) {
            Rectangle r = fw.getBounds();
            Point p = fw.getLocation();
            Rectangle r2 = new Rectangle(p.x, p.y, r.width, r.height);

            if (overall == null) {
                overall = r2;
            } else {
                overall = overall.union(r2);
            }
        }
    }
    if (overall != null) {
        centerRectangle(overall);
    }
}
 

开发者ID:ojdkbuild,
项目名称:lookaside_java-1.8.0-openjdk,
代码行数:23,
代码来源:DiagramScene.java

示例2: gotoFigure

点赞 3

import com.sun.hotspot.igv.view.widgets.FigureWidget; //导入依赖的package包/类
public void gotoFigure(final Figure f) {

        if (!isVisible(f)) {
            showFigure(f);
        }

        FigureWidget fw = getFigureWidget(f);
        if (fw != null) {
            Rectangle r = fw.getBounds();
            Point p = fw.getLocation();
            centerRectangle(new Rectangle(p.x, p.y, r.width, r.height));

            // Select figure
            clearSelection();
            addToSelection(fw);
            selectionUpdated();
        }
    }
 

开发者ID:ojdkbuild,
项目名称:lookaside_java-1.8.0-openjdk,
代码行数:19,
代码来源:DiagramScene.java

示例3: isVisible

点赞 2

import com.sun.hotspot.igv.view.widgets.FigureWidget; //导入依赖的package包/类
private boolean isVisible(Connection c) {
    FigureWidget w1 = figureWidgets.get(c.getInputSlot().getFigure());
    FigureWidget w2 = figureWidgets.get(c.getOutputSlot().getFigure());

    if (w1.isVisible() && w2.isVisible()) {
        return true;
    }

    return false;
}
 

开发者ID:ojdkbuild,
项目名称:lookaside_java-1.8.0-openjdk,
代码行数:11,
代码来源:DiagramScene.java

示例4: getSelectedFigures

点赞 2

import com.sun.hotspot.igv.view.widgets.FigureWidget; //导入依赖的package包/类
public Set<Figure> getSelectedFigures() {
    Set<Figure> result = new HashSet<Figure>();
    for (Widget w : selectedWidgets) {
        if (w instanceof FigureWidget) {
            FigureWidget fw = (FigureWidget) w;
            if (fw.getState().isSelected()) {
                result.add(fw.getFigure());
            }
        }
    }
    return result;
}
 

开发者ID:ojdkbuild,
项目名称:lookaside_java-1.8.0-openjdk,
代码行数:13,
代码来源:DiagramScene.java

示例5: getSelectedNodes

点赞 2

import com.sun.hotspot.igv.view.widgets.FigureWidget; //导入依赖的package包/类
public Set<Integer> getSelectedNodes() {
    Set<Integer> result = new HashSet<Integer>();
    for (Widget w : selectedWidgets) {
        if (w instanceof FigureWidget) {
            FigureWidget fw = (FigureWidget) w;
            if (fw.getState().isSelected()) {
                result.addAll(fw.getFigure().getSource().getSourceNodesAsSet());
            }
        }
    }
    return result;
}
 

开发者ID:ojdkbuild,
项目名称:lookaside_java-1.8.0-openjdk,
代码行数:13,
代码来源:DiagramScene.java

示例6: getFigureWidget

点赞 2

import com.sun.hotspot.igv.view.widgets.FigureWidget; //导入依赖的package包/类
private FigureWidget getFigureWidget(Figure f) {
    return figureWidgets.get(f);
}
 

开发者ID:ojdkbuild,
项目名称:lookaside_java-1.8.0-openjdk,
代码行数:4,
代码来源:DiagramScene.java

示例7: DiagramScene

点赞 2

import com.sun.hotspot.igv.view.widgets.FigureWidget; //导入依赖的package包/类
public DiagramScene(Action[] actions, DiagramViewModel model) {
    this.actions = actions;
    selectedWidgets = new ArrayList<FigureWidget>();
    content = new InstanceContent();
    lookup = new AbstractLookup(content);
    this.setCheckClipping(true);
    this.getInputBindings().setZoomActionModifiers(0);

    JComponent comp = this.createView();
    comp.setDoubleBuffered(true);
    comp.setBackground(Color.WHITE);
    comp.setOpaque(true);

    this.setBackground(Color.WHITE);
    this.setOpaque(true);
    scrollPane = new JScrollPane(comp);
    scrollPane.setBackground(Color.WHITE);
    scrollPane.getVerticalScrollBar().setUnitIncrement(SCROLL_UNIT_INCREMENT);
    scrollPane.getVerticalScrollBar().setBlockIncrement(SCROLL_BLOCK_INCREMENT);
    scrollPane.getHorizontalScrollBar().setUnitIncrement(SCROLL_UNIT_INCREMENT);
    scrollPane.getHorizontalScrollBar().setBlockIncrement(SCROLL_BLOCK_INCREMENT);
    scrollPane.getViewport().addChangeListener(scrollChangeListener);
    hoverAction = this.createWidgetHoverAction();

    blockLayer = new LayerWidget(this);
    this.addChild(blockLayer);

    startLayer = new LayerWidget(this);
    this.addChild(startLayer);
    // TODO: String startLabelString = "Loading graph with " + originalDiagram.getFigures().size() + " figures and " + originalDiagram.getConnections().size() + " connections...";
    String startLabelString = "";
    LabelWidget w = new LabelWidget(this, startLabelString);
    scrollChangeListener.register(w, new Point(10, 10));
    w.setAlignment(LabelWidget.Alignment.CENTER);
    startLabel = w;
    startLayer.addChild(w);

    mainLayer = new LayerWidget(this);
    this.addChild(mainLayer);

    topLeft = new Widget(this);
    topLeft.setPreferredLocation(new Point(-BORDER_SIZE, -BORDER_SIZE));
    this.addChild(topLeft);


    bottomRight = new Widget(this);
    bottomRight.setPreferredLocation(new Point(-BORDER_SIZE, -BORDER_SIZE));
    this.addChild(bottomRight);

    slotLayer = new LayerWidget(this);
    this.addChild(slotLayer);

    connectionLayer = new LayerWidget(this);
    this.addChild(connectionLayer);

    LayerWidget selectionLayer = new LayerWidget(this);
    this.addChild(selectionLayer);

    this.setLayout(LayoutFactory.createAbsoluteLayout());

    this.getActions().addAction(hoverAction);
    zoomAction = new BoundedZoomAction(1.1, false);
    zoomAction.setMaxFactor(ZOOM_MAX_FACTOR);
    zoomAction.setMinFactor(ZOOM_MIN_FACTOR);
    this.getActions().addAction(ActionFactory.createMouseCenteredZoomAction(1.1));
    panAction = new ExtendedPanAction();
    this.getActions().addAction(panAction);
    this.getActions().addAction(ActionFactory.createPopupMenuAction(popupMenuProvider));

    LayerWidget selectLayer = new LayerWidget(this);
    this.addChild(selectLayer);
    this.getActions().addAction(ActionFactory.createRectangularSelectAction(rectangularSelectDecorator, selectLayer, rectangularSelectProvider));

    blockWidgets = new HashMap<InputBlock, BlockWidget>();

    boolean b = this.getUndoRedoEnabled();
    this.setUndoRedoEnabled(false);
    this.setNewModel(model);
    this.setUndoRedoEnabled(b);
}
 

开发者ID:ojdkbuild,
项目名称:lookaside_java-1.8.0-openjdk,
代码行数:81,
代码来源:DiagramScene.java

示例8: addToSelection

点赞 2

import com.sun.hotspot.igv.view.widgets.FigureWidget; //导入依赖的package包/类
private void addToSelection(Figure f) {
    FigureWidget w = getFigureWidget(f);
    addToSelection(w);
}
 

开发者ID:ojdkbuild,
项目名称:lookaside_java-1.8.0-openjdk,
代码行数:5,
代码来源:DiagramScene.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)