本文整理了Java中com.mxgraph.view.mxGraph.getModel()
方法的一些代码示例,展示了mxGraph.getModel()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。mxGraph.getModel()
方法的具体详情如下:
包路径:com.mxgraph.view.mxGraph
类名称:mxGraph
方法名:getModel
[英]Returns the graph model that contains the graph data.
[中]返回包含图形数据的图形模型。
代码示例来源:origin: Activiti/Activiti
/**
* Returns a boolean indicating if the given <em>mxCell</em> should be ignored as a vertex. This returns true if the cell has no connections.
*
* @param vertex
* Object that represents the vertex to be tested.
* @return Returns true if the vertex should be ignored.
*/
public boolean isVertexIgnored(Object vertex) {
return super.isVertexIgnored(vertex) || graph.isSwimlane(vertex) || graph.getModel().getGeometry(vertex).isRelative() || graph.getConnections(vertex).length == 0;
}
代码示例来源:origin: Activiti/Activiti
mxIGraphModel model = graph.getModel();
if (cell != null && !visited.contains(cell) && (!isVertexIgnored(cell) || isBoundaryEvent(cell))) {
visited.add(cell);
代码示例来源:origin: Activiti/Activiti
protected void layout(FlowElementsContainer flowElementsContainer) {
graph = new mxGraph();
cellParent = graph.getDefaultParent();
graph.getModel().beginUpdate();
layout.execute(graph.getDefaultParent());
graph.getModel().endUpdate();
代码示例来源:origin: Activiti/Activiti
/**
*
*/
protected mxRectangle apply(TreeNode node, mxRectangle bounds) {
mxRectangle g = graph.getModel().getGeometry(node.cell);
if (node.cell != null && g != null) {
if (isVertexMovable(node.cell)) {
g = setVertexLocation(node.cell, node.x, node.y);
}
if (bounds == null) {
bounds = new mxRectangle(g.getX(), g.getY(), g.getWidth(), g.getHeight());
} else {
bounds = new mxRectangle(Math.min(bounds.getX(), g.getX()), Math.min(bounds.getY(), g.getY()), Math.max(bounds.getX() + bounds.getWidth(), g.getX() + g.getWidth()), Math.max(bounds.getY()
+ bounds.getHeight(), g.getY() + g.getHeight()));
}
}
return bounds;
}
代码示例来源:origin: Activiti/Activiti
public void execute(Object parent) {
mxIGraphModel model = graph.getModel();
List<Object> roots = graph.findTreeRoots(parent, true, invert);
代码示例来源:origin: org.tinyjee.jgraphx/jgraphx
/**
*
* @param edge
* @param isSource
* @return
*/
public Object getTerminal(Object edge, boolean isSource)
{
return graph.getModel().getTerminal(edge, isSource);
};
代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx
/**
* Returns the terminal to be used for a given port. This implementation
* always returns the parent cell.
*
* @param cell Cell that represents the port.
* @param source If the cell is the source or target port.
* @return Returns the terminal to be used for the given port.
*/
public Object getTerminalForPort(Object cell, boolean source)
{
return getModel().getParent(cell);
}
代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx
/**
* Validates the graph by validating each descendant of the given cell or
* the root of the model. Context is an object that contains the validation
* state for the complete validation run. The validation errors are attached
* to their cells using <setWarning>. This function returns true if no
* validation errors exist in the graph.
*/
public String validateGraph()
{
return validateGraph(graph.getModel().getRoot(),
new Hashtable<Object, Object>());
}
代码示例来源:origin: org.tinyjee.jgraphx/jgraphx
/**
* Returns true if the parent of the given cell should be extended if the
* child has been resized so that it overlaps the parent. This
* implementation returns ExtendParents if cell is not an edge.
*
* @param cell Cell that has been resized.
*/
public boolean isExtendParent(Object cell)
{
return !getModel().isEdge(cell) && isExtendParents();
}
代码示例来源:origin: org.tinyjee.jgraphx/jgraphx
/**
* Returns true if the given vertex has no connected edges.
*
* @param vertex Object that represents the vertex to be tested.
* @return Returns true if the vertex should be ignored.
*/
public boolean isVertexIgnored(Object vertex)
{
return !graph.getModel().isVertex(vertex)
|| !graph.isCellVisible(vertex);
}
代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx
/**
* Returns true if the given vertex has no connected edges.
*
* @param vertex Object that represents the vertex to be tested.
* @return Returns true if the vertex should be ignored.
*/
public boolean isVertexIgnored(Object vertex)
{
return !graph.getModel().isVertex(vertex)
|| !graph.isCellVisible(vertex);
}
代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx
/**
* Checks the type of the given value.
*/
public boolean checkTerminal(mxGraph graph, Object terminal, Object edge)
{
Object userObject = graph.getModel().getValue(terminal);
return checkType(graph, userObject, type, attr, value);
}
代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx
/**
* Returns true if the parent of the given cell should be extended if the
* child has been resized so that it overlaps the parent. This
* implementation returns ExtendParents if cell is not an edge.
*
* @param cell Cell that has been resized.
*/
public boolean isExtendParent(Object cell)
{
return !getModel().isEdge(cell) && isExtendParents();
}
代码示例来源:origin: org.tinyjee.jgraphx/jgraphx
/**
* Draws the graph onto the given canvas.
*
* @param canvas Canvas onto which the graph should be drawn.
*/
public void drawGraph(mxICanvas canvas)
{
drawCell(canvas, getModel().getRoot());
}
代码示例来源:origin: org.tinyjee.jgraphx/jgraphx
/**
* Returns true if the given cell is not the current root or the root in
* the model. This can be overridden to not render certain cells in the
* graph display.
*/
protected boolean isCellDisplayable(Object cell)
{
return cell != graph.getView().getCurrentRoot()
&& cell != graph.getModel().getRoot();
}
代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx
/**
*
*/
public boolean isStateHandled(mxCellState state)
{
return graphComponent.getGraph().getModel().isVertex(state.getCell());
}
代码示例来源:origin: org.flowable/flowable-bpmn-layout
/**
* Returns a boolean indicating if the given <mxCell> should be ignored as a vertex. This returns true if the cell has no connections.
*
* @param vertex
* Object that represents the vertex to be tested.
* @return Returns true if the vertex should be ignored.
*/
@Override
public boolean isVertexIgnored(Object vertex) {
return super.isVertexIgnored(vertex) || graph.isSwimlane(vertex) || graph.getModel().getGeometry(vertex).isRelative() || graph.getConnections(vertex).length == 0;
}
代码示例来源:origin: org.tinyjee.jgraphx/jgraphx
/**
* First validates all bounds and then validates all points recursively on
* all visible cells.
*/
public void validate()
{
mxRectangle graphBounds = getBoundingBox(validateCellState(validateCell((currentRoot != null) ? currentRoot
: graph.getModel().getRoot())));
setGraphBounds((graphBounds != null) ? graphBounds : new mxRectangle());
}
代码示例来源:origin: org.tinyjee.jgraphx/jgraphx
/**
* Returns true if the label bounds of the state should be used for the
* editor.
*/
protected boolean useLabelBounds(mxCellState state)
{
mxIGraphModel model = state.getView().getGraph().getModel();
mxGeometry geometry = model.getGeometry(state.getCell());
return ((geometry != null && geometry.getOffset() != null
&& !geometry.isRelative() && (geometry.getOffset().getX() != 0 || geometry
.getOffset().getY() != 0)) || model.isEdge(state.getCell()));
}
代码示例来源:origin: com.github.vlsi.mxgraph/jgraphx
/**
* Returns true if the label bounds of the state should be used for the
* editor.
*/
protected boolean useLabelBounds(mxCellState state)
{
mxIGraphModel model = state.getView().getGraph().getModel();
mxGeometry geometry = model.getGeometry(state.getCell());
return ((geometry != null && geometry.getOffset() != null
&& !geometry.isRelative() && (geometry.getOffset().getX() != 0 || geometry
.getOffset().getY() != 0)) || model.isEdge(state.getCell()));
}
内容来源于网络,如有侵权,请联系作者删除!