Java Code Examples for org.jgraph.graph.GraphConstants#setInset()

The following examples show how to use org.jgraph.graph.GraphConstants#setInset() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: OverviewGraphModel.java    From CQL with GNU Affero General Public License v3.0 6 votes vote down vote up
/**
 *
 *
 * @param vertex
 *
 * @return
 */
private static AttributeMap commonVertexAttributes(OverviewVertex vertex) {
	AttributeMap map = new AttributeMap();

	GraphConstants.setAutoSize(map, true);
	GraphConstants.setInset(map, 5);
	GraphConstants.setFont(map, GraphConstants.DEFAULTFONT.deriveFont(Font.BOLD, 12));
	GraphConstants.setOpaque(map, true);

	ImageIcon icon = vertex.getThumbnail();

	if (icon != null) {
		GraphConstants.setIcon(map, vertex.getThumbnail());
	} else {
		GraphConstants.setIcon(map, new ImageIcon());
	}

	GraphConstants.setVerticalTextPosition(map, SwingConstants.TOP);

	return map;
}
 
Example 2
Source File: ViewGraphModel.java    From CQL with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * Returns the attribute map for vertices (i.e. EntityNodes).
 *
 * @return a map of attributes to be used for new vertices
 */
private AttributeMap vertexAttributes() {
	AttributeMap map = new AttributeMap();

	GraphConstants.setAutoSize(map, true);
	GraphConstants.setInset(map, 5);
	GraphConstants.setBorder(map, BorderFactory.createLineBorder(getColor(_mode + "entity_border"),
			getIntWidth(_mode + "entity_border", 1)));
	GraphConstants.setBackground(map, getColor(_mode + "entity_bg"));
	GraphConstants.setForeground(map, getColor(_mode + "entity_fg"));
	GraphConstants.setFont(map, GraphConstants.DEFAULTFONT.deriveFont(Font.BOLD, 12));
	GraphConstants.setOpaque(map, true);

	return map;
}
 
Example 3
Source File: ViewGraphModel.java    From CQL with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * Returns the attribute map for virtual vertices (i.e. constaint nodes).
 *
 * @return a map of attributes to be used for new virtual vertices
 */
private AttributeMap virtualVertexAttributes() {
	AttributeMap map = new AttributeMap();

	GraphConstants.setAutoSize(map, true);
	GraphConstants.setInset(map, 5);
	GraphConstants.setBorder(map, BorderFactory.createLineBorder(getColor(_mode + "constraint_border"),
			getIntWidth(_mode + "constraint_border", 1)));
	GraphConstants.setBackground(map, getColor(_mode + "constraint_bg"));
	GraphConstants.setForeground(map, getColor(_mode + "constraint_fg"));
	GraphConstants.setFont(map, GraphConstants.DEFAULTFONT.deriveFont(Font.BOLD, 12));
	GraphConstants.setOpaque(map, true);

	return map;
}
 
Example 4
Source File: SketchGraphModel.java    From CQL with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * Returns the attribute map for vertices (i.e. EntityNodes).
 *
 * @return a map of attributes to be used for new vertices
 */
private AttributeMap vertexAttributes() {
	AttributeMap map = new AttributeMap();

	GraphConstants.setAutoSize(map, true);
	GraphConstants.setInset(map, 5);
	GraphConstants.setBorder(map, BorderFactory.createLineBorder(getColor(_mode + "entity_border"),
			getIntWidth(_mode + "entity_border", 1)));
	GraphConstants.setBackground(map, getColor(_mode + "entity_bg"));
	GraphConstants.setForeground(map, getColor(_mode + "entity_fg"));
	GraphConstants.setFont(map, GraphConstants.DEFAULTFONT.deriveFont(Font.BOLD, 12));
	GraphConstants.setOpaque(map, true);

	return map;
}
 
Example 5
Source File: SketchGraphModel.java    From CQL with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * Returns the attribute map for virtual vertices (i.e. constaint nodes).
 *
 * @return a map of attributes to be used for new virtual vertices
 */
private AttributeMap virtualVertexAttributes() {
	AttributeMap map = new AttributeMap();

	GraphConstants.setAutoSize(map, true);
	GraphConstants.setInset(map, 5);
	GraphConstants.setBorder(map, BorderFactory.createLineBorder(getColor(_mode + "constraint_border"),
			getIntWidth(_mode + "constraint_border", 1)));
	GraphConstants.setBackground(map, getColor(_mode + "constraint_bg"));
	GraphConstants.setForeground(map, getColor(_mode + "constraint_fg"));
	GraphConstants.setFont(map, GraphConstants.DEFAULTFONT.deriveFont(Font.BOLD, 12));
	GraphConstants.setOpaque(map, true);

	return map;
}
 
Example 6
Source File: SubjectAreaCell.java    From MogwaiERDesignerNG with GNU General Public License v3.0 5 votes vote down vote up
public SubjectAreaCell(SubjectArea aArea) {
    super(aArea);

    GraphConstants.setAutoSize(getAttributes(), true);
    GraphConstants.setEditable(getAttributes(), true);
    GraphConstants.setInset(getAttributes(), 20);
    GraphConstants.setGroupOpaque(getAttributes(), true);
}