本文整理汇总了Java中org.jgraph.graph.GraphConstants.setOpaque方法的典型用法代码示例。如果您正苦于以下问题:Java GraphConstants.setOpaque方法的具体用法?Java GraphConstants.setOpaque怎么用?Java GraphConstants.setOpaque使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.jgraph.graph.GraphConstants
的用法示例。
在下文中一共展示了GraphConstants.setOpaque方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createCell
import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
/**
* Creates a new JGraph cell with the specified rendering information.
*
* @param name String that is the cell name.
* @param x Double that is the X coordinate.
* @param y Double that is the Y coordinate.
* @param scale Double that is the scale information.
* @param color Color of the future graph cell.
* @return DMGraph cell generated with the specified rendering information.
* @throws Exception
*/
public static DefaultGraphCell createCell(String name, double x, double y,
double scale, Color color) throws Exception {
DefaultGraphCell cell = new DefaultGraphCell(name);
GraphConstants.setBounds(cell.getAttributes(),
new Rectangle2D.Double(x, y, scale, scale));
GraphConstants.setBorder(cell.getAttributes(),
BorderFactory.createRaisedBevelBorder());
GraphConstants.setOpaque(cell.getAttributes(), true);
cell.addPort(new Point2D.Double(0, 0));
if (color != null) {
GraphConstants.setGradientColor(cell.getAttributes(), color);
} else {
GraphConstants.setGradientColor(cell.getAttributes(), Color.BLUE);
}
return cell;
}
示例2: createVertex
import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
public DefaultGraphCell createVertex(String name, double x, double y, Color bg, boolean raised) {
// Create vertex with the given name
DefaultGraphCell cell = new DefaultGraphCell(name);
GraphConstants.setBorder(cell.getAttributes(), BorderFactory.createEtchedBorder());
GraphConstants.setBounds(cell.getAttributes(), new Rectangle2D.Double(x, y, 10, 10));
GraphConstants.setResize(cell.getAttributes(), true);
GraphConstants.setAutoSize(cell.getAttributes(), true);
// Set fill color
if (bg != null) {
GraphConstants.setOpaque(cell.getAttributes(), true);
GraphConstants.setGradientColor(cell.getAttributes(), bg);
}
// Set raised border
if (raised)
GraphConstants.setBorder(cell.getAttributes(), BorderFactory.createRaisedBevelBorder());
else
// Set black border
GraphConstants.setBorderColor(cell.getAttributes(), Color.black);
return cell;
}
示例3: createBounds
import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
public static Map createBounds(AttributeMap map, double x, double y, Dimension dimension, Color c, boolean moveable)
{
// final int ALPHA = 255;
GraphConstants.setBounds(map, map.createRect(x, y, dimension.getWidth(), dimension.getHeight()));
// GraphConstants.setBorder(map, BorderFactory.createBevelBorder(BevelBorder.RAISED));
GraphConstants.setForeground(map, Color.BLACK.darker().darker());//new Color(ALPHA - c.getRed(), ALPHA - c.getGreen(), ALPHA - c.getBlue(), ALPHA));
GraphConstants.setBackground(map, c.darker());
// Add a nice looking gradient background
GraphConstants.setGradientColor(map, c.darker());
// Make sure the cell is resized on insert
// GraphConstants.setSize();
// GraphConstants.setResize(map, true);
// Add a Border Color Attribute to the Map
GraphConstants.setBorderColor(map, Color.BLACK.darker().darker());
GraphConstants.setFont(map, GraphConstants.DEFAULTFONT.deriveFont(Font.BOLD, 12));
GraphConstants.setMoveable(map, moveable);
GraphConstants.setOpaque(map, true);
GraphConstants.setResize(map, false);
GraphConstants.setAutoSize(map, true);
return map;
}
示例4: createBounds
import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
public static Map createBounds(AttributeMap map, double x, double y, Dimension dimension, Color c, boolean moveable)
{
// final int ALPHA = 255;
GraphConstants.setBounds(map, map.createRect(x, y, dimension.getWidth(), dimension.getHeight()));
// GraphConstants.setBorder(map, BorderFactory.createBevelBorder(BevelBorder.RAISED));
GraphConstants.setForeground(map, Color.BLACK.darker().darker());//new Color(ALPHA - c.getRed(), ALPHA - c.getGreen(), ALPHA - c.getBlue(), ALPHA));
GraphConstants.setBackground(map, c.darker());
// Add a nice looking gradient background
GraphConstants.setGradientColor(map, c.darker());
// Make sure the cell is resized on insert
// GraphConstants.setSize();
// GraphConstants.setResize(map, true);
// Add a Border Color Attribute to the Map
GraphConstants.setBorderColor(map, Color.BLACK.darker().darker());
GraphConstants.setFont(map, GraphConstants.DEFAULTFONT.deriveFont(Font.BOLD, 12));
GraphConstants.setMoveable(map, moveable);
GraphConstants.setOpaque(map, true);
GraphConstants.setResize(map, false);
GraphConstants.setAutoSize(map, true);
return map;
}
示例5: 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);
}
示例6: 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);
}
示例7: TableCell
import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
public TableCell(Table aTable) {
super(aTable);
GraphConstants.setBounds(getAttributes(), new Rectangle2D.Double(20,
20, 40, 20));
GraphConstants.setGradientColor(getAttributes(), Color.orange);
GraphConstants.setOpaque(getAttributes(), false);
GraphConstants.setAutoSize(getAttributes(), true);
GraphConstants.setEditable(getAttributes(), true);
addPort();
}
示例8: ViewCell
import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
public ViewCell(View aTable) {
super(aTable);
GraphConstants.setBounds(getAttributes(), new Rectangle2D.Double(20,
20, 40, 20));
GraphConstants.setGradientColor(getAttributes(), Color.orange);
GraphConstants.setOpaque(getAttributes(), false);
GraphConstants.setAutoSize(getAttributes(), true);
GraphConstants.setEditable(getAttributes(), true);
addPort();
}
示例9: CommentCell
import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
public CommentCell(Comment aTable) {
super(aTable);
GraphConstants.setBounds(getAttributes(), new Rectangle2D.Double(20,
20, 40, 20));
GraphConstants.setOpaque(getAttributes(), false);
GraphConstants.setAutoSize(getAttributes(), true);
GraphConstants.setResize(getAttributes(), true);
GraphConstants.setEditable(getAttributes(), true);
}
示例10: 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();
}
示例11: createVertex
import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
public DefaultGraphCell createVertex(String name, double x,
double y, double w, double h, Color bg, boolean raised) {
// Create vertex with the given name
DefaultGraphCell cell = new DefaultGraphCell(name);
/* ob.x = x;
ob.y = y;*/
// System.out.println("adding node:"+ob.toString()+" to cell "+cellCount +"at ("+x+","+y+")");
// Set bounds
GraphConstants.setBounds(cell.getAttributes(), new Rectangle2D.Double(
x, y, w, h));
// Set fill color
if (bg != null) {
GraphConstants.setGradientColor(cell.getAttributes(), bg);
GraphConstants.setOpaque(cell.getAttributes(), true);
}
// Set raised border
if (raised)
GraphConstants.setBorder(cell.getAttributes(), BorderFactory
.createRaisedBevelBorder());
else
// Set black border
GraphConstants.setBorderColor(cell.getAttributes(), Color.black);
// Add a Floating Port
cell.addPort();
return cell;
}
示例12: common
import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
Map common( Map attr )
{
GraphConstants.setForeground( attr, Color.BLUE );
GraphConstants.setOpaque( attr, true);
GraphConstants.setBorder( attr, BorderFactory.createRaisedBevelBorder());
return attr;
}
示例13: AbstractGraphVertex
import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
/**
* Constructor for graph
*
* @param x
* @param y
* @param data
* @param graph
*/
public AbstractGraphVertex(int x, int y, DataItem data,
MicroarrayGraph graph) {
super(data);
this.graph = graph;
this.setPosition(new Point(x,y));
GraphConstants.setGradientColor(
this.getAttributes(),
DEFAULT_VERTEX_COLOR);
GraphConstants.setBorderColor(
this.getAttributes(),
Color.black);
GraphConstants.setOpaque(
this.getAttributes(),
true);
GraphConstants.setVerticalAlignment(
this.getAttributes(),
JLabel.TOP);
Font font = GraphConstants.getFont(this.getAttributes());
font = font.deriveFont((float)font.getSize() + 3);
GraphConstants.setFont(this.getAttributes(), font);
}
示例14: adjustLayout
import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
private static void adjustLayout(FeatureDefinitionEntry feature, @Nullable Color bg) {
DefaultGraphCell cell = _featureGraphModelAdapter.getVertexCell(feature);
GraphConstants.setBounds(cell.getAttributes(), new Rectangle2D.Double(25, 25, 200, 20));
GraphConstants.setAutoSize(cell.getAttributes(), true);
if (bg != null) {
GraphConstants.setBackground(cell.getAttributes(), bg);
GraphConstants.setOpaque(cell.getAttributes(), true);
}
GraphConstants.setBorderColor(cell.getAttributes(), Color.black);
cell.addPort();
}
示例15: GraphVertex
import org.jgraph.graph.GraphConstants; //导入方法依赖的package包/类
/**
* Creates a new graph vertex. The coordinates of the new vertex are
* defined right and down from the upper left corner of the graph area.
* The parent of the vertex is defined by the parent dataset of the
* given data parameter.
*
* @param x Horizontal position of the new vertex (in pixel coordinates).
* @param y Vertical position of the new vertex (in pixel coordinates).
* @param data Dataset which this vertex is to represent on the graph.
* @throws NullPointerException If the provided DataBean is null.
*/
public GraphVertex(int x, int y, DataBean data, MicroarrayGraph graph) {
super(x, y, data, graph);
children = new ArrayList<GraphVertex>();
Color c;
if (data == null || data.getOperationRecord() == null || data.getOperationRecord().getCategoryColor() == null) {
c = DEFAULT_VERTEX_COLOR;
} else {
c = data.getOperationRecord().getCategoryColor();
}
GraphConstants.setGradientColor(this.getAttributes(),c);
GraphConstants.setBackground(this.getAttributes(),c.brighter());
GraphConstants.setOpaque(this.getAttributes(), true);
GraphConstants.setBorder(this.getAttributes(), BORDER_NORMAL);
this.addPort();
this.graph = graph;
try {
Long rowCount = Session.getSession().getDataManager().getFastRowCount(data);
if (rowCount != null) {
if (rowCount < DataManager.MAX_ROWS_TO_COUNT) {
tooltipText = ", " + rowCount + " rows";
} else {
tooltipText = ", over " + rowCount + " rows";
}
} else {
tooltipText = ""; // too large file, maybe binary, cannot say anything
}
} catch (MicroarrayException e) {
tooltipText = "";
}
graph.getGraphLayoutCache().toFront(new Object[] { this } );
graph.repaint();
}