本文整理汇总了Java中org.jgraph.graph.GraphConstants.setSizeable方法的典型用法代码示例。如果您正苦于以下问题:Java GraphConstants.setSizeable方法的具体用法?Java GraphConstants.setSizeable怎么用?Java GraphConstants.setSizeable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jgraph.graph.GraphConstants
的用法示例。
在下文中一共展示了GraphConstants.setSizeable方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createVertex
import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
private void createVertex(DefaultGraphCell cell, double x, double y, double w, double h)
{
// Set bounds
GraphConstants.setBounds(cell.getAttributes(), new Rectangle2D.Double(x, y, w, h));
GraphConstants.setBorder(cell.getAttributes(), BorderFactory.createRaisedBevelBorder());
GraphConstants.setEditable(cell.getAttributes(), false);
GraphConstants.setSizeable(cell.getAttributes(), true);
GraphConstants.setAutoSize(cell.getAttributes(), false);
GraphConstants.setRouting(cell.getAttributes(), GraphConstants.ROUTING_SIMPLE);
GraphConstants.setBendable(cell.getAttributes(), true);
// Add a Floating Port
hmPorts.put(cell.getUserObject(), cell.addPort());
}
示例2: setLayout
import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
/**
* Define appearance of this component
*/
private void setLayout() {
GraphConstants.setSizeable(attributes, false);
GraphConstants.setGroupOpaque(attributes, true);
GraphConstants.setOpaque(attributes, true);
GraphConstants.setGradientColor(attributes, new Color(.1F, .1F, .9F, .3F));
titledBorder = BorderFactory.createTitledBorder(" " + name + " ");
GraphConstants.setBorder(attributes, titledBorder);
GraphConstants.setInset(attributes, (int) (GraphConstants.DEFAULTFONT.getSize() * 1.4));
GraphConstants.setEditable(attributes, false);
}
示例3: setLayout
import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
/**
* Define apparence of this component
*/
private void setLayout() {
GraphConstants.setSizeable(attributes, false);
GraphConstants.setGroupOpaque(attributes, true);
GraphConstants.setOpaque(attributes, true);
GraphConstants.setGradientColor(attributes, new Color(.1F, .1F, .9F, .3F));
titledBorder = BorderFactory.createTitledBorder(" " + name + " ");
GraphConstants.setBorder(attributes, titledBorder);
GraphConstants.setInset(attributes, 15);
GraphConstants.setEditable(attributes, false);
}
示例4: PetriNetGraphCell
import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
public PetriNetGraphCell(String text, int posX, int posY) {
super(text);
GraphConstants.setBounds(getAttributes(),
new Rectangle2D.Double(posX - CELL_HEIGHT / 2, posY - CELL_HEIGHT / 2, CELL_WIDTH, CELL_HEIGHT));
GraphConstants.setSizeable(getAttributes(), false);
GraphConstants.setOpaque(getAttributes(), true);
addPort();
}
示例5: getDefaultUnmovableMappingEdgeStyle
import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
private static final AttributeMap getDefaultUnmovableMappingEdgeStyle(Color lineColor)
{
AttributeMap lineStyle = new AttributeMap();
GraphConstants.setLineBegin(lineStyle, GraphConstants.ARROW_NONE);
GraphConstants.setLineColor(lineStyle,lineColor);
GraphConstants.setBeginSize(lineStyle, 10);
GraphConstants.setFont(lineStyle, GraphConstants.DEFAULTFONT.deriveFont(10));
GraphConstants.setBendable(lineStyle, false);
GraphConstants.setEditable(lineStyle, false);
GraphConstants.setMoveable(lineStyle, false);
GraphConstants.setResize(lineStyle, false);
GraphConstants.setSizeable(lineStyle, false);
return lineStyle;
}
示例6: getDefaultInvisibleVertexAttribute
import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
public static final AttributeMap getDefaultInvisibleVertexAttribute(Point position, boolean representSourceVertex)
{
AttributeMap map = getDefaultInvisibleVertexBounds(position, representSourceVertex);
GraphConstants.setEditable(map, false);
GraphConstants.setBendable(map, false);
GraphConstants.setSelectable(map, false);
GraphConstants.setResize(map, false);
GraphConstants.setSizeable(map, false);
return map;
}
示例7: addFunctionInstance
import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
private boolean addFunctionInstance(FunctionBoxGraphCell functionInstance) {
FunctionDef function = functionInstance.getFunctionDef();
ViewType viewInfo = functionInstance.getViewMeta();
Point2D startPoint = new Point(viewInfo.getX().intValue() < 0 ? 25
: viewInfo.getX().intValue(),
viewInfo.getY().intValue() < 0 ? 25 : viewInfo.getY()
.intValue());
// Construct Vertex with Label
Dimension functionBoxDimension = new Dimension(viewInfo.getWidth()
.intValue(), viewInfo.getHight().intValue());
// Create a Map that holds the attributes for the functionBoxVertex
// functionBoxVertex.getAttributes().applyMap(createCellAttributes(startPoint,
// functionBoxDimension));
// Color backGroundColor = viewInfo.getColor() == null ?
// UIHelper.DEFAULT_VERTEX_COLOR : viewInfo.getColor();
Color backGroundColor = UIHelper.DEFAULT_VERTEX_COLOR;
Map funcBoxAttrbutes = UIHelper.createBounds(new AttributeMap(),
startPoint, functionBoxDimension, backGroundColor, true);
GraphConstants.setSizeable(funcBoxAttrbutes, true);
// Insert the functionBoxVertex (including child port and attributes)
Map portAttributes = new Hashtable();
ParentMap parentMap = new ParentMap();
int numOfInputs = functionInstance.getInputElements().size();
int numOfOutputs = functionInstance.getOutputElements().size();
int maximumPorts = Math.max(numOfInputs, numOfOutputs);
addFunctionGraphPorts(function, portAttributes, parentMap,
functionInstance, funcBoxAttrbutes, numOfInputs, UIHelper
.getDefaultFunctionalBoxInputOrientation(),
maximumPorts);
addFunctionGraphPorts(function, portAttributes, parentMap,
functionInstance, funcBoxAttrbutes, numOfOutputs, UIHelper
.getDefaultFunctionalBoxOutputOrientation(),
maximumPorts);
// Create a Map that holds the attributes for the Vertex
functionInstance.getAttributes().applyMap(funcBoxAttrbutes);
getMiddlePanel().getGraph().getGraphLayoutCache().insert(
functionInstance);
getMiddlePanel().getGraph().getGraphLayoutCache().insert(
functionInstance.getChildren().toArray(), portAttributes, null,
parentMap, null);
setGraphChanged(true);
return true;
// EDIT does not work!
// graph.getGraphLayoutCache().edit(functionBoxVertex.getChildren().toArray(),
// portAttributes);
// graph.getGraphLayoutCache().edit(portAttributes);
// graph.getGraphLayoutCache().insert(new Object[]{functionBoxVertex},
// funcBoxAttrbutes, null, parentMap, null);
// Log.logInfo(this, "functionBoxVertex.getChildren().size(): " +
// functionBoxVertex.getChildren().size());
// this.getGraphLayoutCache().insert(functionBoxVertex.getChildren().toArray(),
// portAttributes, null, parentMap);
// following received java.lang.ClassCastException
// graph.getModel().insert(new Object[]{functionBoxVertex},
// funcBoxAttrbutes, null, null, null);
// graph.getModel().edit(portAttributes, null, null, null);
}
示例8: JmtCell
import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
/**
* Creates a graph cell and initializes it with the specified user object.
*
* @param userObject an Object provided by the user that constitutes
* the cell's data
*
* Conti Andrea 01-09-2003
* Bertoli Marco 04-giu-2005
*/
public JmtCell(String icon, Object userObject) {
super(userObject);
ImageIcon ico = JMTImageLoader.loadImage(icon);
GraphConstants.setIcon(attributes, ico);
imageDimension = new Dimension(ico.getIconWidth(), ico.getIconHeight());
GraphConstants.setSizeable(attributes, false);
GraphConstants.setSize(attributes, imageDimension);
}
示例9: JmtCell
import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
/**
* Creates a graph cell and initializes it with the specified user object.
*
* @param userObject an Object provided by the user that constitutes
* the cell's data
*
* Conti Andrea 01-09-2003
* Bertoli Marco 04-giu-2005
*/
public JmtCell(String icon, Object userObject) {
super(userObject);
ImageIcon ico = JMTImageLoader.loadImage(icon);
GraphConstants.setIcon(attributes, ico);
imageDimension = new Dimension(ico.getIconWidth(), ico.getIconHeight());
GraphConstants.setSizeable(attributes, false);
GraphConstants.setSize(attributes, imageDimension);
}