use of org.freeplane.features.edge.EdgeColorConfiguration in project freeplane by freeplane.
the class MEdgeController method editEdgeColorConfiguration.
public void editEdgeColorConfiguration(MapModel map) {
final List<Color> oldColors = edgeColorsConfigurationFactory.create(map).colors;
final ColorListEditorPanelBuilder colorListEditorPanelBuilder = new ColorListEditorPanelBuilder(oldColors);
final JComponent panel = colorListEditorPanelBuilder.getPanel();
JScrollPane jscrollpane = new JRestrictedSizeScrollPane(panel);
UITools.setScrollbarIncrement(jscrollpane);
jscrollpane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
jscrollpane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
jscrollpane.setMaximumSize(new Dimension(Integer.MAX_VALUE, 600));
String title = TextUtils.getText("editEdgeColors");
final int status = JOptionPane.showConfirmDialog(UITools.getCurrentFrame(), jscrollpane, title, JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
switch(status) {
case JOptionPane.OK_OPTION:
final List<Color> newColors = colorListEditorPanelBuilder.getColors();
edgeColorsConfigurationFactory.setConfiguration(map, new EdgeColorConfiguration(newColors));
break;
default:
}
}
Aggregations