use of com.sldeditor.ui.widgets.ValueComboBoxData in project sldeditor by robward-scisys.
the class VOGeoServerFTSComposite method updateSymbol.
/*
* (non-Javadoc)
*
* @see
* com.sldeditor.ui.detail.vendor.geoserver.VendorOptionInterface#updateSymbol(org.geotools.
* styling.FeatureTypeStyle)
*/
@Override
public void updateSymbol(FeatureTypeStyle featureTypeStyle) {
Map<String, String> options = featureTypeStyle.getOptions();
GroupConfigInterface groupPanel = getGroup(GroupIdEnum.VO_FTS_COMPOSITE);
if (groupPanel.isPanelEnabled()) {
ValueComboBoxData name = fieldConfigVisitor.getComboBox(FieldIdEnum.VO_FTS_COMPOSITE_OPTION);
double opacity = fieldConfigVisitor.getDouble(FieldIdEnum.VO_FTS_COMPOSITE_OPACITY);
StringBuilder composite = new StringBuilder();
composite.append(name.getKey());
if (!(Math.abs(opacity - DEFAULT_COMPOSITE_OPACITY) < 0.0001)) {
// Don't add to string if the opacity is set to the default
composite.append(",");
composite.append(opacity);
}
options.put(FeatureTypeStyle.COMPOSITE, composite.toString());
} else {
options.remove(FeatureTypeStyle.COMPOSITE);
}
}
use of com.sldeditor.ui.widgets.ValueComboBoxData in project sldeditor by robward-scisys.
the class VOGeoServerFTSRuleEvaluation method updateSymbol.
/*
* (non-Javadoc)
*
* @see
* com.sldeditor.ui.detail.vendor.geoserver.VendorOptionInterface#updateSymbol(org.geotools.
* styling.FeatureTypeStyle)
*/
@Override
public void updateSymbol(FeatureTypeStyle featureTypeStyle) {
Map<String, String> options = featureTypeStyle.getOptions();
GroupConfigInterface groupPanel = getGroup(GroupIdEnum.VO_FTS_RULE_EVALUATION);
if (groupPanel.isPanelEnabled()) {
ValueComboBoxData value = fieldConfigVisitor.getComboBox(FieldIdEnum.VO_FTS_RULE_EVALUATION_OPTION);
options.put(FeatureTypeStyle.KEY_EVALUATION_MODE, value.getKey());
} else {
options.remove(FeatureTypeStyle.KEY_EVALUATION_MODE);
}
}
use of com.sldeditor.ui.widgets.ValueComboBoxData in project sldeditor by robward-scisys.
the class SLDTextArea method makeTextAreaPanel.
/**
* Make text area panel.
*
* @return the j component
*/
private JPanel makeTextAreaPanel() {
JPanel sldSourcePanel = new JPanel(false);
sldSourcePanel.setLayout(new BorderLayout());
List<ValueComboBoxData> dataList = new ArrayList<ValueComboBoxData>();
dataList.add(new ValueComboBoxData(SLDOutputFormatEnum.SLD.name(), "SLD", VendorOptionManager.getInstance().getDefaultVendorOptionVersion()));
dataList.add(new ValueComboBoxData(SLDOutputFormatEnum.YSLD.name(), "YSLD", VendorOptionManager.getInstance().getDefaultVendorOptionVersion()));
/*
* Code to be uncommented to used when gt-mbstyles becomes a supported module.
*
* dataList.add(new ValueComboBoxData(SLDOutputFormatEnum.MAPBOX.name(), "MapBox",
* VendorOptionManager.getInstance().getDefaultVendorOptionVersion()));
*/
// Options panel
JPanel optionsPanel = new JPanel();
JLabel label = new JLabel(Localisation.getField(SLDTextArea.class, "SLDTextArea.format"));
optionsPanel.add(label);
comboBox = new ValueComboBox();
comboBox.setPreferredSize(new Dimension(BasePanel.WIDGET_STANDARD_WIDTH, BasePanel.WIDGET_HEIGHT));
comboBox.initialiseSingle(dataList);
comboBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
ValueComboBox comboBox = (ValueComboBox) e.getSource();
if (comboBox.getSelectedItem() != null) {
String name = comboBox.getSelectedValue().getKey();
outputFormat = SLDOutputFormatEnum.valueOf(SLDOutputFormatEnum.class, name);
outputText();
}
}
});
optionsPanel.add(comboBox);
sldSourcePanel.add(optionsPanel, BorderLayout.NORTH);
// Scroll pane
JScrollPane scrollPane = new JScrollPane();
sldSourcePanel.add(scrollPane);
sldSourceTextArea = new JTextArea();
scrollPane.setViewportView(sldSourceTextArea);
sldSourceTextArea.setEditable(false);
sldSourceTextArea.setWrapStyleWord(true);
sldSourceTextArea.setLineWrap(true);
sldSourcePanel.add(scrollPane, BorderLayout.CENTER);
return sldSourcePanel;
}
use of com.sldeditor.ui.widgets.ValueComboBoxData in project sldeditor by robward-scisys.
the class MenuComboBox method createMenu.
/**
* Creates the menu.
*
* @param listAll the list all
* @return the combo menu
*/
private ComboMenu createMenu(List<ValueComboBoxDataGroup> listAll) {
ComboMenu menu = new ComboMenu("");
if (listAll != null) {
for (ValueComboBoxDataGroup group : listAll) {
if (group.isSubMenu()) {
JMenu subMenu = new JMenu(group.getGroupName());
for (ValueComboBoxData data : group.getDataList()) {
if (VendorOptionManager.getInstance().isAllowed(vendorOptionVersionsList, data.getVendorOption())) {
ComboMenuItem menuItem = new ComboMenuItem(data);
subMenu.add(menuItem);
dataMap.put(data.getKey(), data);
if (firstValue == null) {
firstValue = data;
}
}
}
if (subMenu.getMenuComponentCount() > 1) {
menu.add(subMenu);
}
} else {
for (ValueComboBoxData data : group.getDataList()) {
if (VendorOptionManager.getInstance().isAllowed(vendorOptionVersionsList, data.getVendorOption())) {
ComboMenuItem menuItem = new ComboMenuItem(data);
menu.add(menuItem);
dataMap.put(data.getKey(), data);
if (firstValue == null) {
firstValue = data;
}
}
}
}
}
}
return menu;
}
use of com.sldeditor.ui.widgets.ValueComboBoxData in project sldeditor by robward-scisys.
the class MenuComboBox method main.
/**
* The main method.
*
* @param args the arguments
*/
public static void main(String[] args) {
try {
UIManager.setLookAndFeel("com.sun.java.swing.plaf.windows.WindowsLookAndFeel");
} catch (Exception evt) {
// Do nothing
}
List<ValueComboBoxData> list1 = new ArrayList<ValueComboBoxData>();
list1.add(new ValueComboBoxData("circle", "Circle", MenuComboBox.class));
ValueComboBoxData square = new ValueComboBoxData("square", "Square", MenuComboBox.class);
list1.add(square);
list1.add(new ValueComboBoxData("triangle", "Triangle", MenuComboBox.class));
List<ValueComboBoxData> list2 = new ArrayList<ValueComboBoxData>();
list2.add(new ValueComboBoxData("shp://lArrow", "shp://lArrow", MenuComboBox.class));
list2.add(new ValueComboBoxData("shp://star", "shp://star", MenuComboBox.class));
list2.add(new ValueComboBoxData("shp://dot", "shp://dot", MenuComboBox.class));
List<ValueComboBoxDataGroup> listAll = new ArrayList<ValueComboBoxDataGroup>();
listAll.add(new ValueComboBoxDataGroup("", list1, false));
listAll.add(new ValueComboBoxDataGroup("Shapes", list2, true));
MenuComboBox comboMenu = new MenuComboBox(null);
comboMenu.initialiseMenu(listAll);
comboMenu.setSelectedData(square);
JFrame frame = new JFrame();
JPanel panel = new JPanel();
panel.add(comboMenu);
frame.getContentPane().setLayout(new FlowLayout());
frame.getContentPane().add(panel);
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) {
System.exit(0);
}
});
frame.setSize(370, 100);
frame.setVisible(true);
}
Aggregations