@Override public void focusLost(FocusEvent e) { vizState.label.put(elt, labelText.getText()); }
});
final AlloyModel model = vizState.getCurrentModel();
final AlloyNodeElement elt2;
if (elt instanceof AlloyType) elt2=model.getSuperType((AlloyType)elt); else if (elt instanceof AlloySet) elt2=((AlloySet)elt).getType(); else elt2=null;
JComboBox color = new OurCombobox(true, DotColor.valuesWithout(DotColor.MAGIC), 100, 35, vizState.nodeColor.get(elt)) {
private static final long serialVersionUID = 0;
@Override public String do_getText(Object value) { if (value==null) return "Inherit"; else return ((DotColor)value).getDisplayedText(); }
@Override public Icon do_getIcon(Object value) { if (value==null) value=vizState.nodeColor.resolve(elt2); return value==null ? null : ((DotColor)value).getIcon(vizState.getNodePalette()); }
@Override public void do_changed(Object value) { vizState.nodeColor.put(elt, (DotColor)value); }
};
JComboBox shape = new OurCombobox(true, DotShape.values(), 125, 35, vizState.shape.get(elt)) {
private static final long serialVersionUID = 0;
@Override public String do_getText(Object value) { if (value==null) return "Inherit"; else return ((DotShape)value).getDisplayedText(); }
@Override public Icon do_getIcon(Object value) { if (value==null) value=vizState.shape.resolve(elt2); return value==null ? null : ((DotShape)value).getIcon(); }
@Override public void do_changed(Object value) { vizState.shape.put(elt, (DotShape)value); }
};
JComboBox style = new OurCombobox(true, DotStyle.values(), 95, 35, vizState.nodeStyle.get(elt)) {
private static final long serialVersionUID = 0;
@Override public String do_getText(Object value) { if (value==null) return "Inherit"; else return ((DotStyle)value).getDisplayedText(); }
@Override public Icon do_getIcon(Object value) { if (value==null) value=vizState.nodeStyle.resolve(elt2); return value==null ? null : ((DotStyle)value).getIcon(); }
@Override public void do_changed(Object value) { vizState.nodeStyle.put(elt, (DotStyle)value); }
};
//
answer.add(OurUtil.makeH(10, labelText, wcolor, color, style, shape, 2, null));
if (elt instanceof AlloyType) {
JPanel vis = vizState.nodeVisible .pick(elt, "Show", "Display members as nodes");
JPanel con = vizState.hideUnconnected.pick(elt, "Hide unconnected nodes", "Hide nodes without arcs");
JPanel num = vizState.number .pick(elt, "Number nodes", "Attach atom number to node label as suffix");
JPanel proj = null;
if (vizState.canProject((AlloyType)elt))
proj = new OurCheckbox("Project over this sig", "Click here to " + (enabled?"":"un") + "project over this signature", enabled ? OurCheckbox.ALL_OFF : OurCheckbox.ALL_ON) {
private static final long serialVersionUID = 0;
public Icon do_action() {
if (enabled) projectAlloyType((AlloyType)elt); else deprojectAlloyType((AlloyType)elt);
lastElement = elt;
return enabled ? ALL_ON : ALL_OFF;
}
};
labelText.setEnabled(enabled && !vizState.useOriginalName());
color.setEnabled(enabled);
shape.setEnabled(enabled);
style.setEnabled(enabled);
vis.setEnabled(enabled);
con.setEnabled(enabled);
num.setEnabled(enabled && !vizState.useOriginalName());
JPanel a=OurUtil.makeVR(wcolor,vis,num),b;
if (proj!=null) b=OurUtil.makeVR(wcolor, con, proj); else b=OurUtil.makeVR(wcolor, con);