use of easik.overview.edge.ViewDefinitionEdge in project fql by CategoricalData.
the class OverviewGraphModel method getAttributes.
/**
* Overridden method to get cell attributes; we make sure the appropriate
* attributes are applied to the Easik objects before returning them.
*
* @see DefaultGraphModel.getAttributes(Object)
*
* @param o
*
* @return
*/
@Override
public AttributeMap getAttributes(Object o) {
if (o instanceof GraphCell) {
GraphCell cell = (GraphCell) o;
AttributeMap attribs = cell.getAttributes();
AttributeMap easikAttribs = null;
if (cell instanceof SketchNode) {
easikAttribs = sketchAttributes((SketchNode) cell);
} else if (cell instanceof ViewNode) {
easikAttribs = viewAttributes((ViewNode) cell);
} else if (cell instanceof ViewDefinitionEdge) {
easikAttribs = viewEdgeAttributes((ViewDefinitionEdge) cell);
// easikAttribs =
// easik.sketch.util.graph.SketchGraphModel.normalEdgeAttributes();
}
if (easikAttribs != null) {
if (_overview.isCellSelected(cell)) {
Color selColor = getColor("selection");
float lineWidth = getWidth("selection", 3);
int borderWidth = 1;
Border currentBorder = GraphConstants.getBorder(easikAttribs);
if (currentBorder instanceof LineBorder) {
borderWidth = ((LineBorder) currentBorder).getThickness();
}
GraphConstants.setBorder(easikAttribs, BorderFactory.createLineBorder(selColor, borderWidth));
GraphConstants.setForeground(easikAttribs, selColor);
GraphConstants.setLineColor(easikAttribs, selColor);
GraphConstants.setLineWidth(easikAttribs, lineWidth);
}
if (attribs == null) {
cell.setAttributes(easikAttribs);
attribs = easikAttribs;
} else {
attribs.applyMap(easikAttribs);
}
return attribs;
}
}
return super.getAttributes(o);
}
Aggregations