use of com.sldeditor.common.vendoroption.VersionData in project sldeditor by robward-scisys.
the class ReadPanelConfig method decodeVersionData.
/**
* Decode version data.
*
* @param xmlVendorOption the xml vendor option
* @return the version data
*/
public static VersionData decodeVersionData(XMLVendorOption xmlVendorOption) {
VersionData versionData = VendorOptionManager.getInstance().getDefaultVendorOptionVersionData();
if (xmlVendorOption != null) {
try {
String vendorOptionClassName = xmlVendorOption.getClassType().trim();
Class<?> vendorOptionClass = Class.forName(vendorOptionClassName);
versionData = VersionData.decode(vendorOptionClass, xmlVendorOption.getVersion());
} catch (ClassNotFoundException e) {
e.printStackTrace();
}
}
return versionData;
}
use of com.sldeditor.common.vendoroption.VersionData in project sldeditor by robward-scisys.
the class VendorOptionPresentModel method getMinimum.
/**
* Gets the minimum vendor option version.
*
* @return the minimum vendor option version
*/
public List<VersionData> getMinimum() {
List<VersionData> minimum = new ArrayList<VersionData>();
VendorOptionPresent voPresent = vendorOptionsPresentList.get(vendorOptionsPresentList.size() - 1);
VersionData data = voPresent.getVendorOptionInfo().getVersionData().getEarliest();
minimum.add(data);
return minimum;
}
use of com.sldeditor.common.vendoroption.VersionData in project sldeditor by robward-scisys.
the class VendorOptionTableModel method setValueAt.
/*
* (non-Javadoc)
*
* @see javax.swing.table.AbstractTableModel#setValueAt(java.lang.Object, int, int)
*/
@Override
public void setValueAt(Object aValue, int rowIndex, int columnIndex) {
if ((columnIndex == 1) && (rowIndex >= 0) && (rowIndex < selectedVersionList.size())) {
VersionData value = (VersionData) aValue;
selectedVersionList.remove(rowIndex);
selectedVersionList.add(value);
fireTableCellUpdated(rowIndex, columnIndex);
}
}
use of com.sldeditor.common.vendoroption.VersionData in project sldeditor by robward-scisys.
the class VendorOptionTableModel method setSelectedVendorOptionVersions.
/**
* Sets the selected vendor option versions.
*
* @param selectedVersionList the new selected vendor option versions
*/
public void setSelectedVendorOptionVersions(List<VersionData> selectedVersionList) {
if (selectedVersionList != null) {
this.selectedVersionList = new ArrayList<VersionData>();
for (VendorOptionTypeInterface key : nameOrder) {
boolean found = false;
for (VersionData versionData : selectedVersionList) {
if (versionData.getVendorOptionType() == key.getClass()) {
found = true;
this.selectedVersionList.clear();
this.selectedVersionList.add(versionData);
VendorOptionInfoManager.getInstance().setSelectedVersion(instance, versionData);
}
}
if (!found) {
VersionData notSetVersion = VersionData.getNotSetVersion(key.getClass());
this.selectedVersionList.add(notSetVersion);
VendorOptionInfoManager.getInstance().setSelectedVersion(instance, notSetVersion);
}
}
VersionData defaultVendorOption = VendorOptionManager.getInstance().getDefaultVendorOptionVersionData();
this.selectedVersionList.remove(defaultVendorOption);
this.fireTableDataChanged();
}
}
use of com.sldeditor.common.vendoroption.VersionData in project sldeditor by robward-scisys.
the class VersionCellEditor method getTableCellEditorComponent.
/*
* (non-Javadoc)
*
* @see javax.swing.table.TableCellEditor#getTableCellEditorComponent(javax.swing.JTable,
* java.lang.Object, boolean, int, int)
*/
@Override
public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column) {
selectedRowIndex = row;
if (value instanceof VersionData) {
this.versionData = (VersionData) value;
}
listVersionData = model.getVendorOption(row);
MenuComboBox comboVersionData = new MenuComboBox(this);
List<ValueComboBoxDataGroup> dataSelectionList = VendorOptionMenuUtils.createMenu(listVersionData);
comboVersionData.vendorOptionsUpdated(listVersionData);
comboVersionData.initialiseMenu(dataSelectionList);
VendorOptionMenuUtils.setSelected(comboVersionData, this.versionData);
if (isSelected) {
comboVersionData.setBackground(table.getSelectionBackground());
} else {
comboVersionData.setBackground(table.getSelectionForeground());
}
return comboVersionData;
}
Aggregations