Removed dead code
This commit is contained in:
parent
5a30e4fde2
commit
84c6718c8e
@ -1,4 +1,4 @@
|
|||||||
#Wed, 05 Dec 2018 17:40:04 +0100
|
#Wed, 05 Dec 2018 17:57:49 +0100
|
||||||
annotation.processing.enabled=true
|
annotation.processing.enabled=true
|
||||||
annotation.processing.enabled.in.editor=false
|
annotation.processing.enabled.in.editor=false
|
||||||
annotation.processing.processors.list=
|
annotation.processing.processors.list=
|
||||||
|
@ -29,13 +29,13 @@
|
|||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" attributes="0">
|
<Group type="102" attributes="0">
|
||||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||||
<Component id="jButton3" min="-2" max="-2" attributes="0"/>
|
<Component id="deleteButton" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="editButton" min="-2" max="-2" attributes="0"/>
|
<Component id="editButton" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="newButton" min="-2" max="-2" attributes="0"/>
|
<Component id="newButton" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="jButton1" min="-2" max="-2" attributes="0"/>
|
<Component id="doneButton" min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<Group type="102" alignment="0" attributes="0">
|
<Group type="102" alignment="0" attributes="0">
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
@ -54,8 +54,8 @@
|
|||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="3" attributes="0">
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
<Component id="newButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="newButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="doneButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="jButton3" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="deleteButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="editButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="editButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
@ -64,12 +64,12 @@
|
|||||||
</DimensionLayout>
|
</DimensionLayout>
|
||||||
</Layout>
|
</Layout>
|
||||||
<SubComponents>
|
<SubComponents>
|
||||||
<Component class="javax.swing.JButton" name="jButton1">
|
<Component class="javax.swing.JButton" name="doneButton">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" value="Done"/>
|
<Property name="text" type="java.lang.String" value="Done"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="doneButtonActionPerformed"/>
|
||||||
</Events>
|
</Events>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JButton" name="newButton">
|
<Component class="javax.swing.JButton" name="newButton">
|
||||||
@ -81,12 +81,12 @@
|
|||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="newButtonActionPerformed"/>
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="newButtonActionPerformed"/>
|
||||||
</Events>
|
</Events>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JButton" name="jButton3">
|
<Component class="javax.swing.JButton" name="deleteButton">
|
||||||
<Properties>
|
<Properties>
|
||||||
<Property name="text" type="java.lang.String" value="Delete"/>
|
<Property name="text" type="java.lang.String" value="Delete"/>
|
||||||
</Properties>
|
</Properties>
|
||||||
<Events>
|
<Events>
|
||||||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton3ActionPerformed"/>
|
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="deleteButtonActionPerformed"/>
|
||||||
</Events>
|
</Events>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="javax.swing.JButton" name="editButton">
|
<Component class="javax.swing.JButton" name="editButton">
|
||||||
|
@ -91,9 +91,9 @@ public class AssetListDialog extends EscDialog {
|
|||||||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
|
||||||
private void initComponents() {
|
private void initComponents() {
|
||||||
|
|
||||||
jButton1 = new javax.swing.JButton();
|
doneButton = new javax.swing.JButton();
|
||||||
newButton = new javax.swing.JButton();
|
newButton = new javax.swing.JButton();
|
||||||
jButton3 = new javax.swing.JButton();
|
deleteButton = new javax.swing.JButton();
|
||||||
editButton = new javax.swing.JButton();
|
editButton = new javax.swing.JButton();
|
||||||
assetListPanel = new opensesim.gui.AssetEditor.AssetListPanel(worldadm);
|
assetListPanel = new opensesim.gui.AssetEditor.AssetListPanel(worldadm);
|
||||||
|
|
||||||
@ -101,10 +101,10 @@ public class AssetListDialog extends EscDialog {
|
|||||||
setTitle("Edit Assets");
|
setTitle("Edit Assets");
|
||||||
setModal(true);
|
setModal(true);
|
||||||
|
|
||||||
jButton1.setText("Done");
|
doneButton.setText("Done");
|
||||||
jButton1.addActionListener(new java.awt.event.ActionListener() {
|
doneButton.addActionListener(new java.awt.event.ActionListener() {
|
||||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
jButton1ActionPerformed(evt);
|
doneButtonActionPerformed(evt);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -116,10 +116,10 @@ public class AssetListDialog extends EscDialog {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
jButton3.setText("Delete");
|
deleteButton.setText("Delete");
|
||||||
jButton3.addActionListener(new java.awt.event.ActionListener() {
|
deleteButton.addActionListener(new java.awt.event.ActionListener() {
|
||||||
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
public void actionPerformed(java.awt.event.ActionEvent evt) {
|
||||||
jButton3ActionPerformed(evt);
|
deleteButtonActionPerformed(evt);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -138,13 +138,13 @@ public class AssetListDialog extends EscDialog {
|
|||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addGroup(layout.createSequentialGroup()
|
.addGroup(layout.createSequentialGroup()
|
||||||
.addGap(0, 0, Short.MAX_VALUE)
|
.addGap(0, 0, Short.MAX_VALUE)
|
||||||
.addComponent(jButton3)
|
.addComponent(deleteButton)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addComponent(editButton)
|
.addComponent(editButton)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addComponent(newButton)
|
.addComponent(newButton)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addComponent(jButton1))
|
.addComponent(doneButton))
|
||||||
.addGroup(layout.createSequentialGroup()
|
.addGroup(layout.createSequentialGroup()
|
||||||
.addContainerGap()
|
.addContainerGap()
|
||||||
.addComponent(assetListPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
|
.addComponent(assetListPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
|
||||||
@ -158,8 +158,8 @@ public class AssetListDialog extends EscDialog {
|
|||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
.addComponent(newButton)
|
.addComponent(newButton)
|
||||||
.addComponent(jButton1)
|
.addComponent(doneButton)
|
||||||
.addComponent(jButton3)
|
.addComponent(deleteButton)
|
||||||
.addComponent(editButton))
|
.addComponent(editButton))
|
||||||
.addContainerGap())
|
.addContainerGap())
|
||||||
);
|
);
|
||||||
@ -180,13 +180,13 @@ public class AssetListDialog extends EscDialog {
|
|||||||
|
|
||||||
}//GEN-LAST:event_newButtonActionPerformed
|
}//GEN-LAST:event_newButtonActionPerformed
|
||||||
|
|
||||||
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
|
private void doneButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_doneButtonActionPerformed
|
||||||
dispose();
|
dispose();
|
||||||
}//GEN-LAST:event_jButton1ActionPerformed
|
}//GEN-LAST:event_doneButtonActionPerformed
|
||||||
|
|
||||||
private void doEdit() {
|
private void doEdit() {
|
||||||
JSONObject o = assetListPanel.getSelectedObject();
|
JSONObject o = assetListPanel.getSelectedObject();
|
||||||
// AssetEditorDialog.runDialog(this, o, o);
|
AssetEditorDialog.runDialog(this, worldadm, o, o);
|
||||||
assetListPanel.reload();
|
assetListPanel.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -197,13 +197,13 @@ public class AssetListDialog extends EscDialog {
|
|||||||
|
|
||||||
}//GEN-LAST:event_editButtonActionPerformed
|
}//GEN-LAST:event_editButtonActionPerformed
|
||||||
|
|
||||||
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
|
private void deleteButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteButtonActionPerformed
|
||||||
JSONObject o = assetListPanel.getSelectedObject();
|
JSONObject o = assetListPanel.getSelectedObject();
|
||||||
JSONObject ass = Globals.getAssets();
|
JSONObject ass = Globals.getAssets();
|
||||||
ass.remove(o.getString("symbol"));
|
ass.remove(o.getString(World.JKEYS.ASSET_SYMBOL));
|
||||||
Globals.putAssets(ass);
|
Globals.putAssets(ass);
|
||||||
assetListPanel.reload();
|
assetListPanel.reload();
|
||||||
}//GEN-LAST:event_jButton3ActionPerformed
|
}//GEN-LAST:event_deleteButtonActionPerformed
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param args the command line arguments
|
* @param args the command line arguments
|
||||||
@ -250,9 +250,9 @@ public class AssetListDialog extends EscDialog {
|
|||||||
|
|
||||||
// Variables declaration - do not modify//GEN-BEGIN:variables
|
// Variables declaration - do not modify//GEN-BEGIN:variables
|
||||||
private opensesim.gui.AssetEditor.AssetListPanel assetListPanel;
|
private opensesim.gui.AssetEditor.AssetListPanel assetListPanel;
|
||||||
|
private javax.swing.JButton deleteButton;
|
||||||
|
private javax.swing.JButton doneButton;
|
||||||
private javax.swing.JButton editButton;
|
private javax.swing.JButton editButton;
|
||||||
private javax.swing.JButton jButton1;
|
|
||||||
private javax.swing.JButton jButton3;
|
|
||||||
private javax.swing.JButton newButton;
|
private javax.swing.JButton newButton;
|
||||||
// End of variables declaration//GEN-END:variables
|
// End of variables declaration//GEN-END:variables
|
||||||
}
|
}
|
||||||
|
@ -45,8 +45,6 @@ public class AssetListPanel extends javax.swing.JPanel implements GuiSelectionLi
|
|||||||
|
|
||||||
WorldAdm worldadm;
|
WorldAdm worldadm;
|
||||||
|
|
||||||
JSONObject json_set;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates new form AssetList
|
* Creates new form AssetList
|
||||||
*/
|
*/
|
||||||
@ -58,12 +56,6 @@ public class AssetListPanel extends javax.swing.JPanel implements GuiSelectionLi
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
json_set = new JSONObject(Globals.prefs.get("myassets", "{"
|
|
||||||
+ "EUR:{name:Euro,decimals:8,type:opensesim.sesim.Assets.FurtureAsset}}"));
|
|
||||||
|
|
||||||
json_set = Globals.getAssets();
|
|
||||||
// reload();
|
|
||||||
|
|
||||||
assetTable.setRowSelectionAllowed(true);
|
assetTable.setRowSelectionAllowed(true);
|
||||||
|
|
||||||
assetTable.getColumnModel().getColumn(0).setPreferredWidth(30);
|
assetTable.getColumnModel().getColumn(0).setPreferredWidth(30);
|
||||||
@ -82,44 +74,10 @@ public class AssetListPanel extends javax.swing.JPanel implements GuiSelectionLi
|
|||||||
public JSONObject getSelectedObject() {
|
public JSONObject getSelectedObject() {
|
||||||
int row = assetTable.getSelectedRow();
|
int row = assetTable.getSelectedRow();
|
||||||
String symbol = (String) assetTable.getValueAt(row, 0);
|
String symbol = (String) assetTable.getValueAt(row, 0);
|
||||||
return json_set.getJSONObject(symbol);
|
return worldadm.world.getAssetBySymbol(symbol).getJson();
|
||||||
}
|
}
|
||||||
|
|
||||||
final void reload() {
|
final void reload() {
|
||||||
/* json_set = Globals.getAssets();
|
|
||||||
DefaultTableModel m = (DefaultTableModel) assetTable.getModel();
|
|
||||||
|
|
||||||
|
|
||||||
m.setRowCount(0);
|
|
||||||
for (String symbol : json_set.keySet()) {
|
|
||||||
JSONObject o = json_set.optJSONObject(symbol);
|
|
||||||
if (o == null) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
Class <AbstractAsset> a = Globals.getClassByName(o.optString("type"));
|
|
||||||
String type_name;
|
|
||||||
|
|
||||||
try {
|
|
||||||
type_name=a.getConstructor(World.class,JSONObject.class).newInstance(null,null).getTypeName();
|
|
||||||
|
|
||||||
} catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) {
|
|
||||||
Logger.getLogger(AssetListPanel.class.getName()).log(Level.SEVERE, null, ex);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
m.addRow(new Object[]{
|
|
||||||
|
|
||||||
symbol,
|
|
||||||
o.opt("name"),
|
|
||||||
type_name
|
|
||||||
});
|
|
||||||
|
|
||||||
}*/
|
|
||||||
|
|
||||||
Collection<AbstractAsset> assets;
|
Collection<AbstractAsset> assets;
|
||||||
assets = worldadm.world.getAssetCollection();
|
assets = worldadm.world.getAssetCollection();
|
||||||
@ -177,14 +135,6 @@ public class AssetListPanel extends javax.swing.JPanel implements GuiSelectionLi
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void uppdate() {
|
|
||||||
DefaultTableModel m;
|
|
||||||
|
|
||||||
m = (DefaultTableModel) this.assetTable.getModel();
|
|
||||||
m.fireTableDataChanged();
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is called from within the constructor to initialize the form.
|
* This method is called from within the constructor to initialize the form.
|
||||||
* WARNING: Do NOT modify this code. The content of this method is always
|
* WARNING: Do NOT modify this code. The content of this method is always
|
||||||
|
@ -137,6 +137,10 @@ public class World {
|
|||||||
return Collections.unmodifiableCollection(assetsById);
|
return Collections.unmodifiableCollection(assetsById);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AbstractAsset getAssetBySymbol(String symbol){
|
||||||
|
return this.assetsBySymbol.get(symbol);
|
||||||
|
}
|
||||||
|
|
||||||
public Collection<AssetPair> getAssetPairsCollection() {
|
public Collection<AssetPair> getAssetPairsCollection() {
|
||||||
return Collections.unmodifiableCollection(assetPairs);
|
return Collections.unmodifiableCollection(assetPairs);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user