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


Java CellView.getCell方法代码示例

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


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

示例1: isDescendant

import org.jgraph.graph.CellView; //导入方法依赖的package包/类
protected boolean isDescendant(CellView parentView, CellView childView) {
	if (parentView == null || childView == null) {
		return false;
	}

	Object parent = parentView.getCell();
	Object child = childView.getCell();
	Object ancestor = child;

	do {
		if (ancestor == parent) {
			return true;
		}
	} while ((ancestor = mediator.getParent(ancestor)) != null);

	return false;
}
 
开发者ID:HOMlab,项目名称:QN-ACTR-Release,代码行数:18,代码来源:GraphMouseListner.java

示例2: getVertexAt

import org.jgraph.graph.CellView; //导入方法依赖的package包/类
/** Gets the first vertex at this position.
 *
 * @param x horizontal coordinate
 * @param y vertical coordinate
 * @return first vertex
 */
public JmtCell getVertexAt(int x, int y) {
	CellView[] cellViews = getGraphLayoutCache().getAllViews();
	for (CellView cellView : cellViews) {
		if (cellView.getCell() instanceof JmtCell) {
			if (cellView.getBounds().contains(x, y)) {
				return (JmtCell) cellView.getCell();
			}
		}
	}
	return null;
	//		Object cell = null;
	//		Object oldCell = null;
	//		do {
	//			cell = getNextCellForLocation(oldCell, x, y);
	//			if (oldCell == cell)
	//				return null;
	//			else
	//				oldCell = cell;
	//		} while (!((cell instanceof JmtCell) || cell == null));

}
 
开发者ID:HOMlab,项目名称:QN-ACTR-Release,代码行数:28,代码来源:JmtJGraph.java

示例3: getFirstCellForLocation

import org.jgraph.graph.CellView; //导入方法依赖的package包/类
/**
 * Helper method for {@link #getFirstCellForLocation(double, double)} and
 * {@link #getPortViewAt(double, double)}. Returns the topmost visible cell
 * at a given point. A flag controls if we want only vertices or only edges.
 * @param x x-coordinate of the location we want to find a cell at
 * @param y y-coordinate of the location we want to find a cell at
 * @param vertex <tt>true</tt> if we are not interested in edges
 * @param edge <tt>true</tt> if we are not interested in vertices
 * @return the topmost visible cell at a given point
 */
protected JCell<G> getFirstCellForLocation(double x, double y, boolean vertex, boolean edge) {
    x /= this.scale;
    y /= this.scale;
    JCell<G> result = null;
    Rectangle xyArea = new Rectangle((int) (x - 2), (int) (y - 2), 4, 4);
    // iterate over the roots and query the visible ones
    CellView[] viewRoots = this.graphLayoutCache.getRoots();
    for (int i = viewRoots.length - 1; result == null && i >= 0; i--) {
        CellView jCellView = viewRoots[i];
        if (!(jCellView.getCell() instanceof JCell)) {
            continue;
        }
        @SuppressWarnings("unchecked")
        JCell<G> jCell = (JCell<G>) jCellView.getCell();
        boolean typeCorrect =
            vertex ? jCell instanceof JVertex : edge ? jCell instanceof JEdge : true;
        if (typeCorrect && !jCell.isGrayedOut()) {
            // now see if this jCell is sufficiently close to the point
            if (jCellView.intersects(this, xyArea)) {
                result = jCell;
            }
        }
    }
    return result;
}
 
开发者ID:meteoorkip,项目名称:JavaGraph,代码行数:36,代码来源:JGraph.java

示例4: isDescendant

import org.jgraph.graph.CellView; //导入方法依赖的package包/类
protected boolean isDescendant(CellView parentView, CellView childView) {
	if (parentView == null || childView == null) {
		return false;
	}

	Object parent = parentView.getCell();
	Object child = childView.getCell();
	Object ancestor = child;

	do {
		if (ancestor == parent)
			return true;
	} while ((ancestor = graphModel.getParent(ancestor)) != null);

	return false;
}
 
开发者ID:tvaquero,项目名称:itsimple,代码行数:17,代码来源:ItGraphUI.java

示例5: getRendererComponent

import org.jgraph.graph.CellView; //导入方法依赖的package包/类
/**
 * Overrides the parent implementation to return the value component stored
 * in the user object instead of this renderer if a value component exists.
 * This applies some of the values installed to this renderer to the value
 * component (border, opaque) if the latter is a JComponent.
 * 
 * @return Returns a configured renderer for the specified view.
 */
@Override
public Component getRendererComponent(JGraph graph, CellView view,
		boolean sel, boolean focus, boolean preview) {
	isSelected = sel;
	graphForeground = graph.getForeground();
	isGroup = view.getCell() instanceof GroupVertex;
	isPhenodata = view.getCell() instanceof PhenodataVertex;
	if(view.getCell() instanceof AbstractGraphVertex){
		if(isGroup){
			vertex = (GroupVertex)view.getCell();
		} else if(isPhenodata){
			vertex = (PhenodataVertex)view.getCell();
		} else {
			vertex = (GraphVertex)view.getCell();
		}
	}
	this.graph = graph;
	
	return super.getRendererComponent(graph, view, sel, focus, preview);
}
 
开发者ID:chipster,项目名称:chipster,代码行数:29,代码来源:GraphRenderer.java

示例6: isDescendant

import org.jgraph.graph.CellView; //导入方法依赖的package包/类
protected boolean isDescendant(CellView parentView, CellView childView) {
	if (parentView == null || childView == null) {
		return false;
	}
	Object parent = parentView.getCell();
	Object child = childView.getCell();
	Object ancestor = child;
	do {
		if (ancestor == parent) {
			return true;
		}
	} while ((ancestor = mediator.getParent(ancestor)) != null);
	return false;
}
 
开发者ID:max6cn,项目名称:jmt,代码行数:15,代码来源:GraphMouseListener.java

示例7: getVertexAt

import org.jgraph.graph.CellView; //导入方法依赖的package包/类
/**
 * Gets the first vertex at this position.
 *
 * @param x horizontal coordinate
 * @param y vertical coordinate
 * @return first vertex
 */
public JmtCell getVertexAt(int x, int y) {
	CellView[] cellViews = getGraphLayoutCache().getAllViews();
	for (CellView cellView : cellViews) {
		if (cellView.getCell() instanceof JmtCell) {
			if (cellView.getBounds().contains(x, y)) {
				return (JmtCell) cellView.getCell();
			}
		}
	}
	return null;
}
 
开发者ID:max6cn,项目名称:jmt,代码行数:19,代码来源:JmtJGraph.java

示例8: getRendererComponent

import org.jgraph.graph.CellView; //导入方法依赖的package包/类
@Override
public Component getRendererComponent(JGraph aGraph, CellView aView, boolean aSelected, boolean aHasFocus,
                                      boolean aPreview) {

    SubjectAreaCellView theView = (SubjectAreaCellView) aView;
    SubjectAreaCell theCell = (SubjectAreaCell) aView.getCell();
    subjectArea = (SubjectArea) ((SubjectAreaCell) theView.getCell()).getUserObject();
    selected = aSelected;
    expanded = theCell.isExpanded();

    return this;
}
 
开发者ID:mirkosertic,项目名称:ERDesignerNG,代码行数:13,代码来源:SubjectAreaCellView.java

示例9: getRendererComponent

import org.jgraph.graph.CellView; //导入方法依赖的package包/类
public Component getRendererComponent(JGraph graph, CellView view,
		boolean sel, boolean focus, boolean preview) {
	gridColor = graph.getGridColor();
	highlightColor = graph.getHighlightColor();
	lockedHandleColor = graph.getLockedHandleColor();
	isDoubleBuffered = graph.isDoubleBuffered();
	if (view instanceof VertexView) {
		this.view = (VertexView) view;
		setComponentOrientation(graph.getComponentOrientation());
		if (graph.getEditingCell() != view.getCell()) {
			Object label = graph.convertValueToString(view);
			if (label != null)
				setText("<html><center><font size='1'><b>"+label.toString()+"</b></font></center></html>");
			else
				setText("");
		} else			
			setText("");
		this.hasFocus = focus;
		this.childrenSelected = graph.getSelectionModel()
				.isChildrenSelected(view.getCell());
		this.selected = sel;
		this.preview = preview;
		if (this.view.isLeaf()
				|| GraphConstants.isGroupOpaque(view.getAllAttributes()))
			installAttributes(view);
		else
			resetAttributes();
		return this;
	}
	return null;
}
 
开发者ID:tvaquero,项目名称:itsimple,代码行数:32,代码来源:PlaceRenderer.java

示例10: getRendererComponent

import org.jgraph.graph.CellView; //导入方法依赖的package包/类
public Component getRendererComponent(JGraph graph, CellView view,
		boolean sel, boolean focus, boolean preview) {
	gridColor = graph.getGridColor();
	highlightColor = graph.getHighlightColor();
	lockedHandleColor = graph.getLockedHandleColor();
	isDoubleBuffered = graph.isDoubleBuffered();
	if (view instanceof VertexView) {
		this.view = (VertexView) view;
		setComponentOrientation(graph.getComponentOrientation());
		if (graph.getEditingCell() != view.getCell()) {
			Object label = graph.convertValueToString(view);
			if (label != null)
				setText("<html><center><font size='1'><b>"+label.toString()+"</b></center></font></html>");
			else
				setText(null);
		} else
			setText(null);
		this.hasFocus = focus;
		this.childrenSelected = graph.getSelectionModel()
				.isChildrenSelected(view.getCell());
		this.selected = sel;
		this.preview = preview;
		if (this.view.isLeaf()
				|| GraphConstants.isGroupOpaque(view.getAllAttributes()))
			installAttributes(view);
		else
			resetAttributes();
		return this;
	}
	return null;
}
 
开发者ID:tvaquero,项目名称:itsimple,代码行数:32,代码来源:TransitionRenderer.java

示例11: getRendererComponent

import org.jgraph.graph.CellView; //导入方法依赖的package包/类
public Component getRendererComponent(JGraph graph, CellView view,
		boolean sel, boolean focus, boolean preview) {
	gridColor = graph.getGridColor();
	highlightColor = graph.getHighlightColor();
	lockedHandleColor = graph.getLockedHandleColor();
	isDoubleBuffered = graph.isDoubleBuffered();
	if (view instanceof VertexView) {
		this.view = (VertexView) view;
		setComponentOrientation(graph.getComponentOrientation());
		if (graph.getEditingCell() != view.getCell()) {
			Object label = graph.convertValueToString(view);
			if (label != null)
				setText("<html><center><font size='3'>"+label.toString()+"</font></center></html>");
			else
				setText(null);
		} else
			setText(null);
		this.hasFocus = focus;
		this.childrenSelected = graph.getSelectionModel()
				.isChildrenSelected(view.getCell());
		this.selected = sel;
		this.preview = preview;
		if (this.view.isLeaf()
				|| GraphConstants.isGroupOpaque(view.getAllAttributes()))
			installAttributes(view);
		else
			resetAttributes();
		return this;
	}
	return null;
}
 
开发者ID:tvaquero,项目名称:itsimple,代码行数:32,代码来源:UseCaseRenderer.java

示例12: installAttributes

import org.jgraph.graph.CellView; //导入方法依赖的package包/类
protected void installAttributes (CellView view){
	
	Map map = view.getAllAttributes();
       StateCell cell = (StateCell) view.getCell();

       // store the fill and the line color
       Color bordercolor = GraphConstants.getBorderColor(map);

       // apply the parameter to the bounding box only
       setOpaque(GraphConstants.isOpaque(map));

       bordercolor = GraphConstants.getBorderColor(map);
       
       if (getBorder() == null && bordercolor != null)
       {
           setBorder(BorderFactory.createLineBorder(bordercolor, 1));
       }

       // Set the foreground color
       Color foreground = GraphConstants.getForeground(map);
       
       // The FillColor takes precedence over the background color
       Color background = GraphConstants.getBackground(map);
       
       setBackground(background);

       Font font = GraphConstants.getFont(map);        

       header.setOpaque(false);
       header.setFont(font);
       header.setForeground(foreground);
       header.setBackground(background);
       Icon icon = GraphConstants.getIcon(map);
       header.setIcon(icon);

       internalStateArea.setFont(font);
       internalStateArea.setOpaque(false);        ;
       internalStateArea.setVisible(true);
       internalStateArea.setText(cell.getInternalState());
}
 
开发者ID:tvaquero,项目名称:itsimple,代码行数:41,代码来源:StateRenderer.java

示例13: getRendererComponent

import org.jgraph.graph.CellView; //导入方法依赖的package包/类
public Component getRendererComponent(JGraph graph, CellView view,
		boolean sel, boolean focus, boolean preview) {
	gridColor = graph.getGridColor();
	highlightColor = graph.getHighlightColor();
	lockedHandleColor = graph.getLockedHandleColor();
	isDoubleBuffered = graph.isDoubleBuffered();
	if (view instanceof VertexView) {
		this.view = (VertexView) view;
		setComponentOrientation(graph.getComponentOrientation());
		if (graph.getEditingCell() != view.getCell()) {
			Object label = graph.convertValueToString(view);
			if (label != null)
				setText("<html><font size='4'><b>"+label.toString()+"</b></font></html>");
			else
				setText("");
		} else
			setText("");
		this.hasFocus = focus;
		this.childrenSelected = graph.getSelectionModel()
				.isChildrenSelected(view.getCell());
		this.selected = sel;
		this.preview = preview;
		if (this.view.isLeaf()
				|| GraphConstants.isGroupOpaque(view.getAllAttributes()))
			installAttributes(view);
		else
			resetAttributes();
		return this;
	}
	return null;
}
 
开发者ID:tvaquero,项目名称:itsimple,代码行数:32,代码来源:ActorRenderer.java

示例14: getRendererComponent

import org.jgraph.graph.CellView; //导入方法依赖的package包/类
public Component getRendererComponent(JGraph graph, CellView view,
		boolean sel, boolean focus, boolean preview) {
	gridColor = graph.getGridColor();
	highlightColor = graph.getHighlightColor();
	lockedHandleColor = graph.getLockedHandleColor();
	isDoubleBuffered = graph.isDoubleBuffered();
	if (view instanceof VertexView) {
		this.view = (VertexView) view;
		setComponentOrientation(graph.getComponentOrientation());
		if (graph.getEditingCell() != view.getCell()) {
			Object label = graph.convertValueToString(view);
			if (label != null)
				setText("<html><font size='3'><b>"+label.toString()+"</b></font></html>");
			else
				setText("");
		} else
			setText("");
		this.hasFocus = focus;
		this.childrenSelected = graph.getSelectionModel()
				.isChildrenSelected(view.getCell());
		this.selected = sel;
		this.preview = preview;
		if (this.view.isLeaf()
				|| GraphConstants.isGroupOpaque(view.getAllAttributes()))
			installAttributes(view);
		else
			resetAttributes();
		return this;
	}
	return null;
}
 
开发者ID:tvaquero,项目名称:itsimple,代码行数:32,代码来源:GraphLabelRenderer.java

示例15: getVisibleVertexes

import org.jgraph.graph.CellView; //导入方法依赖的package包/类
/**
 * Gets all visible vertexes on the graph.
 */
public List<AbstractGraphVertex> getVisibleVertexes() {
	CellView[] views = this.getGraphLayoutCache().getCellViews();
	List<AbstractGraphVertex> vertexes = new ArrayList<AbstractGraphVertex>();
	for (CellView view : views) {
		if (view != null && view.getCell() instanceof AbstractGraphVertex) {
			AbstractGraphVertex vertex = (AbstractGraphVertex) view.getCell();
			vertexes.add(vertex);
		}
	}
	return vertexes;
}
 
开发者ID:chipster,项目名称:chipster,代码行数:15,代码来源:MicroarrayGraph.java


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