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


Java PickedState类代码示例

本文整理汇总了Java中edu.uci.ics.jung.visualization.picking.PickedState的典型用法代码示例。如果您正苦于以下问题:Java PickedState类的具体用法?Java PickedState怎么用?Java PickedState使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


PickedState类属于edu.uci.ics.jung.visualization.picking包,在下文中一共展示了PickedState类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: setPositions

import edu.uci.ics.jung.visualization.picking.PickedState; //导入依赖的package包/类
/**
 * Sets the positions of the GraphNodes as configured in the HashMap.
 * @param nodes2Move the nodes2 move
 */
private void setPositions(HashMap<String, Point2D> nodes2Move) {
	
	PickedState<GraphNode> ps = new MultiPickedState<GraphNode>();
	this.visViewer.setPickedVertexState(ps);
	
	for(String nodeID : nodes2Move.keySet()) {
		GraphNode node = (GraphNode) this.graphController.getNetworkModel().getGraphElement(nodeID);
		if (node!=null) {
			node.setPosition(nodes2Move.get(nodeID));
			this.visViewer.getGraphLayout().setLocation(node, node.getPosition());
			ps.pick(node, true);	
		}
	}
	
	this.sendNodesMovedNotification();
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:21,代码来源:MoveGraphNodes.java

示例2: pickContainedVertices

import edu.uci.ics.jung.visualization.picking.PickedState; //导入依赖的package包/类
/**
 * pick the vertices inside the rectangle created from points
 * 'down' and 'out'
 */
protected void pickContainedVertices( VisualizationViewer<Room, Exit> vv, Point2D down, Point2D out, boolean clear ) {

    Layout<Room, Exit> layout = vv.getGraphLayout();
    PickedState<Room> pickedVertexState = vv.getPickedVertexState();

    Rectangle2D pickRectangle = new Rectangle2D.Double();
    pickRectangle.setFrameFromDiagonal( down, out );

    if (pickedVertexState != null) {
        if (clear) {
            pickedVertexState.clear();
        }
        GraphElementAccessor<Room, Exit> pickSupport = vv.getPickSupport();

        Collection<Room> picked = pickSupport.getVertices( layout, pickRectangle );
        for (Room v : picked) {
            pickedVertexState.pick( v, true );
        }
    }
}
 
开发者ID:lauriholmas,项目名称:batmapper,代码行数:25,代码来源:MapperPickingGraphMousePlugin.java

示例3: highlightIsland

import edu.uci.ics.jung.visualization.picking.PickedState; //导入依赖的package包/类
/**
 * Sets the transformers based on valid edges and vertices for the playsheet.
 */
private void highlightIsland( Collection<SEMOSSVertex> islandVerts,
		Collection<SEMOSSEdge> islandEdges ) {

	if ( allIslands ) {
		gps.getView().highlight( islandVerts, islandEdges );
	}
	else {
		PickedState state = gps.getView().getPickedVertexState();

		for ( SEMOSSVertex v : islandVerts ) {
			state.pick( v, true );
		}

		// gps.getView().highlight( islandVerts, islandEdges );
	}
}
 
开发者ID:Ostrich-Emulators,项目名称:semtool,代码行数:20,代码来源:IslandIdentifierProcessor.java

示例4: FilterOverlayView

import edu.uci.ics.jung.visualization.picking.PickedState; //导入依赖的package包/类
/**
 * <p>
 *     Creates a new FilterOverlayViewController with a {@link ConfigData} object. This is needed to access the database
 *     in order to save/remove/update filters.
 * </p>
 *
 * @param data The data that should be bound to the table view.
 * @param filterEditingMenu The filter edit menu through which filters can be created and updated.
 */
public FilterOverlayView(final ObservableList<FilterInput> data,
                         final FilterEditingMenuView filterEditingMenu, final PickedState<INode> pickedState) {

    super("filter_menu_overlay.fxml", new EnumMap<>(FilterInteraction.class));

    this.pickedState = pickedState;
    this.filterEditingMenu = filterEditingMenu;
    this.data = data;

    //this.filterEditingMenu.setVisible(false);

    // Build the table view and the filter menu
    BorderPane borderPane = setUpMenu(setUpTableView());

    // Add menu to overlay
    this.getChildren().add(borderPane);
}
 
开发者ID:truffle-hog,项目名称:truffle-hog,代码行数:27,代码来源:FilterOverlayView.java

示例5: mousePressed

import edu.uci.ics.jung.visualization.picking.PickedState; //导入依赖的package包/类
/**
 * If the event occurs on a Vertex, pick that single Vertex
 * @param e the event
 */
   @SuppressWarnings("unchecked")
   public void mousePressed(MouseEvent e) {
	if (e.getModifiers() == modifiers) {
		VisualizationViewer<V,E> vv = (VisualizationViewer) e.getSource();
		GraphElementAccessor<V, E> pickSupport = vv.getPickSupport();
		PickedState<V> pickedVertexState = vv.getPickedVertexState();
           Layout<V,E> layout = vv.getGraphLayout();
		if (pickSupport != null && pickedVertexState != null) {
			// p is the screen point for the mouse event
			Point2D p = e.getPoint();
			vertex = pickSupport.getVertex(layout, p.getX(), p.getY());
			if (vertex != null) {
				if (pickedVertexState.isPicked(vertex) == false) {
					pickedVertexState.clear();
					pickedVertexState.pick(vertex, true);
				}
			}
		}
           e.consume();
	}
}
 
开发者ID:SiLeBAT,项目名称:BfROpenLab,代码行数:26,代码来源:AnimatedPickingGraphMousePlugin.java

示例6: pickContainedVertices

import edu.uci.ics.jung.visualization.picking.PickedState; //导入依赖的package包/类
/**
 * pick the vertices inside the rectangle created from points
 * 'down' and 'out'
 *
 */
protected void pickContainedVertices(VisualizationViewer<V,E> vv, Point2D down, Point2D out, boolean clear) {
    
    Layout<V,E> layout = vv.getGraphLayout();
    PickedState<V> pickedVertexState = vv.getPickedVertexState();
    
    Rectangle2D pickRectangle = new Rectangle2D.Double();
    pickRectangle.setFrameFromDiagonal(down,out);
     
    if(pickedVertexState != null) {
        if(clear) {
        	pickedVertexState.clear();
        }
        GraphElementAccessor<V,E> pickSupport = vv.getPickSupport();

        Collection<V> picked = pickSupport.getVertices(layout, pickRectangle);
        for(V v : picked) {
        	pickedVertexState.pick(v, true);
        }
    }
}
 
开发者ID:SiLeBAT,项目名称:BfROpenLab,代码行数:26,代码来源:PickingGraphMousePlugin.java

示例7: setPickedVertexState

import edu.uci.ics.jung.visualization.picking.PickedState; //导入依赖的package包/类
public void setPickedVertexState(PickedState<V> pickedVertexState) {
    if(pickEventListener != null && this.pickedVertexState != null) {
        this.pickedVertexState.removeItemListener(pickEventListener);
    }
    this.pickedVertexState = pickedVertexState;
    this.renderContext.setPickedVertexState(pickedVertexState);
    if(pickEventListener == null) {
        pickEventListener = new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                repaint();
            }
        };
    }
    pickedVertexState.addItemListener(pickEventListener);
}
 
开发者ID:SiLeBAT,项目名称:BfROpenLab,代码行数:17,代码来源:BasicVisualizationServer.java

示例8: setPickedEdgeState

import edu.uci.ics.jung.visualization.picking.PickedState; //导入依赖的package包/类
public void setPickedEdgeState(PickedState<E> pickedEdgeState) {
    if(pickEventListener != null && this.pickedEdgeState != null) {
        this.pickedEdgeState.removeItemListener(pickEventListener);
    }
    this.pickedEdgeState = pickedEdgeState;
    this.renderContext.setPickedEdgeState(pickedEdgeState);
    if(pickEventListener == null) {
        pickEventListener = new ItemListener() {

            public void itemStateChanged(ItemEvent e) {
                repaint();
            }
        };
    }
    pickedEdgeState.addItemListener(pickEventListener);
}
 
开发者ID:SiLeBAT,项目名称:BfROpenLab,代码行数:17,代码来源:BasicVisualizationServer.java

示例9: valueChanged

import edu.uci.ics.jung.visualization.picking.PickedState; //导入依赖的package包/类
public void valueChanged(TreeSelectionEvent event)
{
	viewer.setTextToInformationArea("");
	DefaultMutableTreeNode node = getTreeNode(event.getPath());
	FileNode fnode = getFileNode(node);
	PickedState<VisualNode> pickedVertexState = vv.getPickedVertexState();
	pickedVertexState.clear();
	//TODO: FIX THIS
	PickedState<VisualNode> pickedVertexStateZOOM = vvZOOM.getPickedVertexState();
	pickedVertexStateZOOM.clear();
	if(pickedVertexState != null)
	{
		for(VisualNode v : g.getVertices())
		{
			if(fnode!=null && v.getFileName().equals(fnode.getFile().getAbsolutePath()))
			{
				pickedVertexState.pick(v, true);
				pickedVertexStateZOOM.pick(v, true);
			}
		}
	}
}
 
开发者ID:pmanousis,项目名称:Hecataeus,代码行数:23,代码来源:HecataeusFileStructureGUI.java

示例10: pickContainedVertices

import edu.uci.ics.jung.visualization.picking.PickedState; //导入依赖的package包/类
protected void pickContainedVertices(VisualizationViewer<VisualNode, VisualEdge> vv,Point2D down, Point2D out, boolean clear) {
	Layout<VisualNode, VisualEdge> layout = vv.getGraphLayout();
	PickedState<VisualNode> pickedVertexState = vv.getPickedVertexState();

	Rectangle2D pickRectangle = new Rectangle2D.Double();
	pickRectangle.setFrameFromDiagonal(down,out);

	if(pickedVertexState != null) {
		if(clear) {
			pickedVertexState.clear();
		}
		GraphElementAccessor<VisualNode,VisualEdge> pickSupport = vv.getPickSupport();

		Collection<VisualNode> picked = pickSupport.getVertices(layout, pickRectangle);
		for(VisualNode v : picked) {
			if (v.getVisible())
			{
				pickedVertexState.pick(v, true);
			}
		}
	}
}
 
开发者ID:pmanousis,项目名称:Hecataeus,代码行数:23,代码来源:HecataeusPickingGraphMousePlugin.java

示例11: mouseDragged

import edu.uci.ics.jung.visualization.picking.PickedState; //导入依赖的package包/类
/**
 * If the mouse is over a picked vertex, drag the picked vertex with the mouse
 * plus all vertexes in its group, if the vertex implements the interface VertexGroup.
 */
@SuppressWarnings("unchecked")
public void mouseDragged(MouseEvent e) {
    VisualizationViewer<V, E> vv = (VisualizationViewer) e.getSource();
    if (vertex != null) {
        e.consume();
        Point p = e.getPoint();
        Point2D graphPoint = vv.getRenderContext()
                        .getMultiLayerTransformer().inverseTransform(p);
        Point2D graphDown = vv.getRenderContext()
                        .getMultiLayerTransformer().inverseTransform(down);
        Layout<V, E> layout = vv.getGraphLayout();
        double dx = graphPoint.getX() - graphDown.getX();
        double dy = graphPoint.getY() - graphDown.getY();
        PickedState<V> ps = vv.getPickedVertexState();

        for (V v : ps.getPicked()) {
            Point2D vp = layout.transform(v);
            vp.setLocation(vp.getX() + dx, vp.getY() + dy);
            layout.setLocation(v, vp);
        }
        down = p;
    }
    vv.repaint();
}
 
开发者ID:joe42,项目名称:nubisave,代码行数:29,代码来源:VertexPicker.java

示例12: mouseReleased

import edu.uci.ics.jung.visualization.picking.PickedState; //导入依赖的package包/类
/**
 * clean up settings from mousePressed
 */
@Override
public void mouseReleased(MouseEvent e) {
    if(vertex != null) {
        VisualizationViewer<V, E> vv = (VisualizationViewer) e.getSource();
        PickedState<V> ps = vv.getPickedVertexState();
        Point2D p = vv.getRenderContext().getMultiLayerTransformer().inverseTransform(e.getPoint());
        int x = (int) p.getX();
        int y = (int) p.getY();
        for (V v : ps.getPicked()) {
            if(v instanceof AbstractNubisaveComponent){
                ((AbstractNubisaveComponent)v).setGraphLocation(new Point(x,y));
                System.out.println("setting graph location");
            }
        }
    }
    super.mouseReleased(e);
}
 
开发者ID:joe42,项目名称:nubisave,代码行数:21,代码来源:StorageServicePicker.java

示例13: mouseDraggedSuperAction

import edu.uci.ics.jung.visualization.picking.PickedState; //导入依赖的package包/类
/**
 * This is the MouseDragged super action of the super class (because of several exceptions).
 * @param me the MouseEvent
 */
private void mouseDraggedSuperAction(MouseEvent me) {

	if(locked == false) {
           VisualizationViewer<GraphNode,GraphEdge> vv = this.basicGraphGUI.getVisualizationViewer();
           if(vertex != null) {
               Point p = me.getPoint();
               Point2D graphPoint = vv.getRenderContext().getMultiLayerTransformer().inverseTransform(p);
               Point2D graphDown = vv.getRenderContext().getMultiLayerTransformer().inverseTransform(down);
               Layout<GraphNode,GraphEdge> layout = vv.getGraphLayout();
               double dx = graphPoint.getX()-graphDown.getX();
               double dy = graphPoint.getY()-graphDown.getY();
               PickedState<GraphNode> ps = vv.getPickedVertexState();
               
               for(GraphNode v : ps.getPicked()) {
                   Point2D vp = layout.transform(v);
                   vp.setLocation(vp.getX()+dx, vp.getY()+dy);
                   layout.setLocation(v, vp);
               }
               down = p;
               me.consume();
               vv.repaint();
               
           } else {
               Point2D out = me.getPoint();
               if(me.getModifiers() == this.addToSelectionModifiers || me.getModifiers() == modifiers) {
                   if (down!=null) {
                   	rect.setFrameFromDiagonal(down,out);
                   	vv.repaint();
                   }
               }
           }
       }
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:38,代码来源:GraphEnvironmentMousePlugin.java

示例14: getPickedNodes

import edu.uci.ics.jung.visualization.picking.PickedState; //导入依赖的package包/类
/**
 * Gets the Set<GraphNode> of picked nodes.
 * @return the picked nodes
 */
public Set<GraphNode> getPickedNodes() {
	PickedState<GraphNode> nodesPicked = this.getVisualizationViewer().getPickedVertexState();
	if (nodesPicked!=null) {
		return nodesPicked.getPicked();
	}
	return null;
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:12,代码来源:BasicGraphGui.java

示例15: getPickedEdges

import edu.uci.ics.jung.visualization.picking.PickedState; //导入依赖的package包/类
/**
 * Gets the Set<GraphEdge> of picked edges.
 * @return the picked edges
 */
public Set<GraphEdge> getPickedEdges() {
	PickedState<GraphEdge> edgesPicked = this.getVisualizationViewer().getPickedEdgeState();
	if (edgesPicked!=null) {
		return edgesPicked.getPicked();
	}
	return null;
}
 
开发者ID:EnFlexIT,项目名称:AgentWorkbench,代码行数:12,代码来源:BasicGraphGui.java


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