本文整理汇总了Java中org.jgraph.graph.Port类的典型用法代码示例。如果您正苦于以下问题:Java Port类的具体用法?Java Port怎么用?Java Port使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Port类属于org.jgraph.graph包,在下文中一共展示了Port类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setAttributes
import org.jgraph.graph.Port; //导入依赖的package包/类
/**
* Sets all the attributes like background colour, dimensions, port number
* & position
*
* @param pt
* @return created map
*/
public Hashtable<Object, Map> setAttributes(Point2D pt, JGraph graph) {
//contains attributes of the cell & ports
Hashtable<Object, Map> nest = new Hashtable<Object, Map>();
Dimension cellDimension = getSize(graph);
//contains attributes of the cell
Map attr = getAttributes();
GraphConstants.setBounds(attr, new Rectangle2D.Double(pt.getX(), pt.getY(), cellDimension.getWidth(), cellDimension.getHeight()));
GraphConstants.setEditable(attr, false);
GraphConstants.setBackground(attr, graph.getBackground());
nest.put(this, attr);
//create ports
ports = createPorts();
Icon icon = GraphConstants.getIcon(attr);
updatePortPositions(nest, icon, cellDimension);
for (Port port : ports) {
add((DefaultPort) port);
}
return nest;
}
开发者ID:max6cn,项目名称:jmt,代码行数:29,代码来源:JmtCell.java示例2: setAttributes
import org.jgraph.graph.Port; //导入依赖的package包/类
/**
* Sets all the attribults like background colour, dimensions, port number
* & position
* @param pt
* @return created map
*/
public Hashtable<Object, Map> setAttributes(Point2D pt, JGraph graph) {
//contains attribute of the cell & ports
Hashtable<Object, Map> nest = new Hashtable<Object, Map>();
Dimension cellDimension = getSize(graph);
//contains attrib of cell
Map attr = getAttributes();
GraphConstants.setBounds(attr, new Rectangle2D.Double(pt.getX(), pt.getY(), cellDimension.getWidth(), cellDimension.getHeight()));
GraphConstants.setEditable(attr, false);
GraphConstants.setBackground(attr, graph.getBackground());
nest.put(this, attr);
//create ports
ports = createPorts();
Icon icon = GraphConstants.getIcon(attr);
updatePortPositions(nest, icon, cellDimension);
for (Port port : ports) {
add((DefaultPort) port);
}
return nest;
}
开发者ID:HOMlab,项目名称:QN-ACTR-Release,代码行数:28,代码来源:JmtCell.java示例3: mouseReleased
import org.jgraph.graph.Port; //导入依赖的package包/类
@Override
public void mouseReleased(MouseEvent e) {
if (e != null && port != null && firstPort != null) {
connect((Port) firstPort.getCell(), (Port) port.getCell());
e.consume();
} else {
if (firstPort != null) {
DefaultPort thePort = (DefaultPort) firstPort.getCell();
GraphCell theCell = (GraphCell) thePort.getParent();
if (theCell instanceof TableCell) {
DefaultPopupMenu menu = createPopupMenu(graph.fromScreen(new Point2D.Double(e.getX(), e.getY())),
(TableCell) theCell);
menu.show(graph, e.getX(), e.getY());
}
}
}
firstPort = null;
port = null;
start = null;
current = null;
super.mouseReleased(e);
graph.repaint();
}
开发者ID:mirkosertic,项目名称:ERDesignerNG,代码行数:25,代码来源:RelationTool.java示例4: connect
import org.jgraph.graph.Port; //导入依赖的package包/类
public void connect(Port aSource, Port aTarget) {
// Construct Edge with no label
GraphCell theSourceCell = (GraphCell) ((DefaultPort) aSource).getParent();
GraphCell theTargetCell = (GraphCell) ((DefaultPort) aTarget).getParent();
if ((theSourceCell instanceof TableCell) && (theTargetCell instanceof TableCell)) {
Table theTargetTable = (Table) ((TableCell) theTargetCell).getUserObject();
if (theTargetTable.hasPrimaryKey()) {
graph.commandNewRelation((TableCell) theSourceCell, (TableCell) theTargetCell);
graph.repaint();
} else {
MessagesHelper.displayErrorMessage(graph, getResourceHelper().getText(
ERDesignerBundle.EXPORTINGTABLENEEDSPRIMARYKEY));
}
}
}
开发者ID:mirkosertic,项目名称:ERDesignerNG,代码行数:17,代码来源:RelationTool.java示例5: removeFromGraph
import org.jgraph.graph.Port; //导入依赖的package包/类
public void removeFromGraph(Object[] cells) {
for (Object cell : cells) {
DefaultGraphCell graphCell = CustomCellViewFactory.tryCastToCell(cell);
if (graphCell != null) {
for (Object child : graphCell.getChildren()) {
Port port = CustomCellViewFactory.tryCastToPort(child);
if (port != null) {
ArrayList edges = Lists.newArrayList(port.edges());
edges.forEach(this::removeFromGraph);
}
}
}
model.getPetriNetGraph().getGraphLayoutCache().remove(new Object[]{cell});
synhronizeRemoveFromGraph(cell);
}
refreshMatrix();
invalidateReachabilityGraph();
}
开发者ID:tomaszi1,项目名称:petri-nets-simulator,代码行数:19,代码来源:GraphServiceImpl.java示例6: createPorts
import org.jgraph.graph.Port; //导入依赖的package包/类
/**
* Creates the ports for this vertex
*
* @return array of ports
*/
@Override
public Port[] createPorts() {
Port[] ports = new Port[2];
ports[0] = new InputPort(this);
ports[1] = new OutputPort(this);
return ports;
}
开发者ID:max6cn,项目名称:jmt,代码行数:13,代码来源:PlaceCell.java示例7: createPorts
import org.jgraph.graph.Port; //导入依赖的package包/类
/**
* Creates the ports for this vertex
* @return array of ports
*/
@Override
public Port[] createPorts() {
Port[] ports = new Port[2];
ports[0] = new InputPort(this);
ports[1] = new OutputPort(this);
return ports;
}
开发者ID:max6cn,项目名称:jmt,代码行数:12,代码来源:ClassSwitchCell.java示例8: createPorts
import org.jgraph.graph.Port; //导入依赖的package包/类
/**
* creates the ports for this vertex
* @return array of ports
*/
@Override
public Port[] createPorts() {
Port[] ports = new Port[2];
ports[0] = new InputPort(this);
ports[1] = new OutputPort(this);
return ports;
}
开发者ID:max6cn,项目名称:jmt,代码行数:12,代码来源:LoggerCell.java示例9: createPorts
import org.jgraph.graph.Port; //导入依赖的package包/类
/**
* Creates the ports for this vertex
*
* @return array of ports
*/
@Override
public Port[] createPorts() {
Port[] ports = new Port[1];
ports[0] = new OutputPort(this);
return ports;
}
开发者ID:max6cn,项目名称:jmt,代码行数:12,代码来源:SourceCell.java示例10: updatePortPositions
import org.jgraph.graph.Port; //导入依赖的package包/类
public void updatePortPositions(Map<Object, Map> nest, Icon icon, Dimension cellDimension) {
for (Port port : ports) {
Map attr = new Hashtable();
if (port instanceof InputPort && isLeftInputCell() || port instanceof OutputPort && !isLeftInputCell()) {
GraphConstants.setOffset(attr, getInPortOffset(icon, cellDimension));
} else {
GraphConstants.setOffset(attr, getOutPortoffset(icon, cellDimension));
}
nest.put(port, attr);
}
}
开发者ID:max6cn,项目名称:jmt,代码行数:12,代码来源:JmtCell.java示例11: createPorts
import org.jgraph.graph.Port; //导入依赖的package包/类
/**
* Creates the ports for this vertex
*
* @return array of ports
*/
@Override
public Port[] createPorts() {
Port[] ports = new Port[1];
ports[0] = new InputPort(this);
return ports;
}
开发者ID:max6cn,项目名称:jmt,代码行数:12,代码来源:SinkCell.java示例12: createPorts
import org.jgraph.graph.Port; //导入依赖的package包/类
/**creats the ports for this vertex
*
* @return array of ports
*/
@Override
public Port[] createPorts() {
Port[] ports = new Port[2];
ports[0] = new InputPort(this);
ports[1] = new OutputPort(this);
return ports;
}
开发者ID:HOMlab,项目名称:QN-ACTR-Release,代码行数:12,代码来源:ServerCell.java示例13: createPorts
import org.jgraph.graph.Port; //导入依赖的package包/类
/**
* creats the ports for this vertex
* @return array of ports
*/
@Override
public Port[] createPorts() {
Port[] ports = new Port[2];
ports[0] = new InputPort(this);
ports[1] = new OutputPort(this);
return ports;
}
开发者ID:HOMlab,项目名称:QN-ACTR-Release,代码行数:12,代码来源:RoutingStationCell.java示例14: createPorts
import org.jgraph.graph.Port; //导入依赖的package包/类
/**creats the ports for this vertex
*
* @return array of ports
*/
@Override
public Port[] createPorts() {
Port[] ports = new Port[1];
ports[0] = new OutputPort(this);
return ports;
}
开发者ID:HOMlab,项目名称:QN-ACTR-Release,代码行数:11,代码来源:SourceCell.java示例15: createPorts
import org.jgraph.graph.Port; //导入依赖的package包/类
/**creats the ports for this vertex
*
* @return array of ports
*/
@Override
public Port[] createPorts() {
Port[] ports = new Port[1];
ports[0] = new InputPort(this);
return ports;
}
开发者ID:HOMlab,项目名称:QN-ACTR-Release,代码行数:11,代码来源:SinkCell.java本文标签属性:
示例:示例英语
代码:代码转换器
java:javascript18岁