So. Now we build our editor around a world object.
Yes! We do!
This commit is contained in:
parent
03fbd9cd25
commit
160dcb6b21
34
src/opensesim/gui/AdmInterface.java
Normal file
34
src/opensesim/gui/AdmInterface.java
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2018, tohe
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* * Redistributions of source code must retain the above copyright notice, this
|
||||||
|
* list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
package opensesim.gui;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author tohe
|
||||||
|
*/
|
||||||
|
public interface AdmInterface {
|
||||||
|
|
||||||
|
}
|
@ -27,13 +27,13 @@
|
|||||||
<Group type="102" attributes="0">
|
<Group type="102" attributes="0">
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" alignment="1" attributes="0">
|
<Group type="102" alignment="0" attributes="0">
|
||||||
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||||
<Component id="okButton" min="-2" max="-2" attributes="0"/>
|
<Component id="okButton" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="cancelButton" min="-2" max="-2" attributes="0"/>
|
<Component id="cancelButton" min="-2" max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<Component id="assetEditorPanel" alignment="0" pref="527" max="32767" attributes="0"/>
|
<Component id="assetEditorPanel" alignment="0" max="32767" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
</Group>
|
</Group>
|
||||||
@ -43,8 +43,8 @@
|
|||||||
<Group type="103" groupAlignment="0" attributes="0">
|
<Group type="103" groupAlignment="0" attributes="0">
|
||||||
<Group type="102" alignment="0" attributes="0">
|
<Group type="102" alignment="0" attributes="0">
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace max="-2" attributes="0"/>
|
||||||
<Component id="assetEditorPanel" pref="138" max="32767" attributes="0"/>
|
<Component id="assetEditorPanel" min="-2" max="-2" attributes="0"/>
|
||||||
<EmptySpace max="-2" attributes="0"/>
|
<EmptySpace pref="73" max="32767" attributes="0"/>
|
||||||
<Group type="103" groupAlignment="3" attributes="0">
|
<Group type="103" groupAlignment="3" attributes="0">
|
||||||
<Component id="cancelButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="cancelButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
<Component id="okButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
<Component id="okButton" alignment="3" min="-2" max="-2" attributes="0"/>
|
||||||
|
@ -27,18 +27,14 @@ package opensesim.gui.AssetEditor;
|
|||||||
|
|
||||||
import java.awt.Dialog;
|
import java.awt.Dialog;
|
||||||
import java.awt.Window;
|
import java.awt.Window;
|
||||||
import java.lang.annotation.Annotation;
|
|
||||||
import java.lang.reflect.Field;
|
|
||||||
|
|
||||||
import opensesim.world.AbstractAsset;
|
import opensesim.world.AbstractAsset;
|
||||||
import opensesim.world.World;
|
|
||||||
|
|
||||||
import opensesim.gui.util.EscDialog;
|
import opensesim.gui.util.EscDialog;
|
||||||
import opensesim.gui.Globals;
|
import opensesim.gui.Globals;
|
||||||
import opensesim.gui.util.Json;
|
import opensesim.gui.util.Json;
|
||||||
import opensesim.gui.util.Json.Export;
|
import opensesim.world.World;
|
||||||
|
import opensesim.world.WorldAdm;
|
||||||
import org.json.JSONException;
|
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -47,7 +43,7 @@ import org.json.JSONObject;
|
|||||||
*/
|
*/
|
||||||
public class AssetEditorDialog extends EscDialog {
|
public class AssetEditorDialog extends EscDialog {
|
||||||
|
|
||||||
|
WorldAdm worldadm;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -103,20 +99,20 @@ public class AssetEditorDialog extends EscDialog {
|
|||||||
.addGroup(layout.createSequentialGroup()
|
.addGroup(layout.createSequentialGroup()
|
||||||
.addContainerGap()
|
.addContainerGap()
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
|
.addGroup(layout.createSequentialGroup()
|
||||||
.addGap(0, 0, Short.MAX_VALUE)
|
.addGap(0, 0, Short.MAX_VALUE)
|
||||||
.addComponent(okButton)
|
.addComponent(okButton)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addComponent(cancelButton))
|
.addComponent(cancelButton))
|
||||||
.addComponent(assetEditorPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 527, Short.MAX_VALUE))
|
.addComponent(assetEditorPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
|
||||||
.addContainerGap())
|
.addContainerGap())
|
||||||
);
|
);
|
||||||
layout.setVerticalGroup(
|
layout.setVerticalGroup(
|
||||||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addGroup(layout.createSequentialGroup()
|
.addGroup(layout.createSequentialGroup()
|
||||||
.addContainerGap()
|
.addContainerGap()
|
||||||
.addComponent(assetEditorPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 138, Short.MAX_VALUE)
|
.addComponent(assetEditorPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 73, Short.MAX_VALUE)
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
|
||||||
.addComponent(cancelButton)
|
.addComponent(cancelButton)
|
||||||
.addComponent(okButton))
|
.addComponent(okButton))
|
||||||
@ -129,12 +125,23 @@ public class AssetEditorDialog extends EscDialog {
|
|||||||
|
|
||||||
private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
|
private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
|
||||||
|
|
||||||
|
if (assetEditorPanel.save(worldadm)){
|
||||||
|
dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
JSONObject result = Json.get(assetEditorPanel);
|
JSONObject result = Json.get(assetEditorPanel);
|
||||||
System.out.printf("JSON: %s\n", result.toString(5));
|
System.out.printf("JSON: %s\n", result.toString(5));
|
||||||
JSONObject all = Globals.getAssets();
|
JSONObject all = Globals.getAssets();
|
||||||
all.put(result.getString("symbol"), result);
|
all.put(result.getString("symbol"), result);
|
||||||
Globals.putAssets(all);
|
Globals.putAssets(all);
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* if (this.asset == null) {
|
/* if (this.asset == null) {
|
||||||
try {
|
try {
|
||||||
int selected = this.assetEditorPanel.assetTypesComboBox.getSelectedIndex();
|
int selected = this.assetEditorPanel.assetTypesComboBox.getSelectedIndex();
|
||||||
@ -179,7 +186,7 @@ public class AssetEditorDialog extends EscDialog {
|
|||||||
System.out.printf("JSONARRAY %s\n", cfg.toString(3));
|
System.out.printf("JSONARRAY %s\n", cfg.toString(3));
|
||||||
JSONObject world_cfg = Globals.world.getConfig();
|
JSONObject world_cfg = Globals.world.getConfig();
|
||||||
Globals.prefs.put("world", world_cfg.toString());
|
Globals.prefs.put("world", world_cfg.toString());
|
||||||
*/ dispose();
|
*/
|
||||||
|
|
||||||
}//GEN-LAST:event_okButtonActionPerformed
|
}//GEN-LAST:event_okButtonActionPerformed
|
||||||
|
|
||||||
@ -189,9 +196,12 @@ public class AssetEditorDialog extends EscDialog {
|
|||||||
|
|
||||||
}//GEN-LAST:event_cancelButtonActionPerformed
|
}//GEN-LAST:event_cancelButtonActionPerformed
|
||||||
|
|
||||||
static public boolean runDialog(Window parent, JSONObject o, JSONObject all) {
|
static public boolean runDialog(Window parent, WorldAdm worldadm, JSONObject o, JSONObject old) {
|
||||||
|
|
||||||
AssetEditorDialog d = new AssetEditorDialog(parent);
|
AssetEditorDialog d = new AssetEditorDialog(parent);
|
||||||
|
d.worldadm = worldadm;
|
||||||
|
|
||||||
|
|
||||||
if (o!=null)
|
if (o!=null)
|
||||||
Json.put(d.assetEditorPanel, o);
|
Json.put(d.assetEditorPanel, o);
|
||||||
d.pack();
|
d.pack();
|
||||||
|
@ -35,8 +35,14 @@ import javax.swing.JDialog;
|
|||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import opensesim.world.AbstractAsset;
|
import opensesim.world.AbstractAsset;
|
||||||
import opensesim.gui.Globals;
|
import opensesim.gui.Globals;
|
||||||
|
import static opensesim.gui.Globals.world;
|
||||||
|
import opensesim.gui.util.Json;
|
||||||
import opensesim.gui.util.Json.Export;
|
import opensesim.gui.util.Json.Export;
|
||||||
import opensesim.gui.util.Json.Import;
|
import opensesim.gui.util.Json.Import;
|
||||||
|
import opensesim.util.SeSimException;
|
||||||
|
import opensesim.world.World;
|
||||||
|
import opensesim.world.WorldAdm;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -69,7 +75,7 @@ public class AssetEditorPanel extends javax.swing.JPanel {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getNameField() {
|
/* public String getNameField() {
|
||||||
return nameField.getText();
|
return nameField.getText();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,7 +86,7 @@ public class AssetEditorPanel extends javax.swing.JPanel {
|
|||||||
public void putType(String type) {
|
public void putType(String type) {
|
||||||
System.out.printf("Here we have a type: %s\n", type);
|
System.out.printf("Here we have a type: %s\n", type);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
public JDialog dialog;
|
public JDialog dialog;
|
||||||
|
|
||||||
ComboBoxModel getComboBoxModel() {
|
ComboBoxModel getComboBoxModel() {
|
||||||
@ -213,24 +219,28 @@ public class AssetEditorPanel extends javax.swing.JPanel {
|
|||||||
}// </editor-fold>//GEN-END:initComponents
|
}// </editor-fold>//GEN-END:initComponents
|
||||||
|
|
||||||
@Export
|
@Export
|
||||||
public String getDeecimals(){
|
public String getDeecimals() {
|
||||||
return decimalsField.getValue().toString();
|
return decimalsField.getValue().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Import
|
@Import
|
||||||
public void setDecimals(String d){
|
public void setDecimals(String d) {
|
||||||
decimalsField.setValue(Integer.parseInt(d));
|
decimalsField.setValue(Integer.parseInt(d));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Export("type")
|
@Export(World.JKEYS.ASSET_TYPE)
|
||||||
public String getType() {
|
public String getType() {
|
||||||
int selected = assetTypesComboBox.getSelectedIndex();
|
int selected = assetTypesComboBox.getSelectedIndex();
|
||||||
return asset_types.get(selected).getName();
|
//return asset_types.get(selected).getName();
|
||||||
|
return this.type;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Import("type")
|
String type;
|
||||||
|
|
||||||
|
@Import(World.JKEYS.ASSET_TYPE)
|
||||||
public void setType(String type) {
|
public void setType(String type) {
|
||||||
|
this.type=type;
|
||||||
|
|
||||||
Class<AbstractAsset> ac = (Class<AbstractAsset>) Globals.getClassByName(type);
|
Class<AbstractAsset> ac = (Class<AbstractAsset>) Globals.getClassByName(type);
|
||||||
if (ac == null) {
|
if (ac == null) {
|
||||||
return;
|
return;
|
||||||
@ -239,13 +249,8 @@ public class AssetEditorPanel extends javax.swing.JPanel {
|
|||||||
AbstractAsset a;
|
AbstractAsset a;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
try {
|
a = ac.getConstructor(World.class, JSONObject.class).newInstance(null, null);
|
||||||
a = ac.getConstructor().newInstance();
|
} catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) {
|
||||||
} catch (NoSuchMethodException | SecurityException ex) {
|
|
||||||
Logger.getLogger(AssetEditorPanel.class.getName()).log(Level.SEVERE, null, ex);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) {
|
|
||||||
Logger.getLogger(AssetEditorPanel.class.getName()).log(Level.SEVERE, null, ex);
|
Logger.getLogger(AssetEditorPanel.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -268,15 +273,38 @@ public class AssetEditorPanel extends javax.swing.JPanel {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public boolean save(WorldAdm worldadm ){
|
||||||
|
JSONObject jo = Json.get(this);
|
||||||
|
|
||||||
|
if (jo.getString(World.JKEYS.ASSET_SYMBOL).length()==0){
|
||||||
|
javax.swing.JOptionPane.showMessageDialog(this, "Symbol must not be empty.",
|
||||||
|
"Error",
|
||||||
|
javax.swing.JOptionPane.ERROR_MESSAGE);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
worldadm.world.createAsset(worldadm.masterKey, jo);
|
||||||
|
} catch (SeSimException ex) {
|
||||||
|
javax.swing.JOptionPane.showMessageDialog(this, ex.getMessage(),
|
||||||
|
"Error",
|
||||||
|
javax.swing.JOptionPane.ERROR_MESSAGE);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
System.out.printf("JO: %s\n",jo);
|
||||||
|
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
private void assetTypesComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_assetTypesComboBoxActionPerformed
|
private void assetTypesComboBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_assetTypesComboBoxActionPerformed
|
||||||
|
|
||||||
int i = this.assetTypesComboBox.getSelectedIndex();
|
int i = this.assetTypesComboBox.getSelectedIndex();
|
||||||
setType(asset_types.get(i).getName());
|
setType(asset_types.get(i).getName());
|
||||||
//this.pack();
|
|
||||||
revalidate();
|
revalidate();
|
||||||
repaint();
|
repaint();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
}//GEN-LAST:event_assetTypesComboBoxActionPerformed
|
}//GEN-LAST:event_assetTypesComboBoxActionPerformed
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
<Group type="102" attributes="0">
|
<Group type="102" attributes="0">
|
||||||
<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="250" max="32767" attributes="0"/>
|
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
|
||||||
<Component id="jButton3" min="-2" max="-2" attributes="0"/>
|
<Component id="jButton3" 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"/>
|
||||||
@ -98,6 +98,9 @@
|
|||||||
</Events>
|
</Events>
|
||||||
</Component>
|
</Component>
|
||||||
<Component class="opensesim.gui.AssetEditor.AssetListPanel" name="assetListPanel">
|
<Component class="opensesim.gui.AssetEditor.AssetListPanel" name="assetListPanel">
|
||||||
|
<AuxValues>
|
||||||
|
<AuxValue name="JavaCodeGenerator_CreateCodeCustom" type="java.lang.String" value="new opensesim.gui.AssetEditor.AssetListPanel(worldadm)"/>
|
||||||
|
</AuxValues>
|
||||||
</Component>
|
</Component>
|
||||||
</SubComponents>
|
</SubComponents>
|
||||||
</Form>
|
</Form>
|
||||||
|
@ -25,9 +25,12 @@
|
|||||||
*/
|
*/
|
||||||
package opensesim.gui.AssetEditor;
|
package opensesim.gui.AssetEditor;
|
||||||
|
|
||||||
|
import java.awt.Window;
|
||||||
import java.awt.event.MouseEvent;
|
import java.awt.event.MouseEvent;
|
||||||
import opensesim.gui.Globals;
|
import opensesim.gui.Globals;
|
||||||
import opensesim.gui.util.EscDialog;
|
import opensesim.gui.util.EscDialog;
|
||||||
|
import opensesim.world.World;
|
||||||
|
import opensesim.world.WorldAdm;
|
||||||
|
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
@ -37,10 +40,12 @@ import org.json.JSONObject;
|
|||||||
*/
|
*/
|
||||||
public class AssetListDialog extends EscDialog {
|
public class AssetListDialog extends EscDialog {
|
||||||
|
|
||||||
|
WorldAdm worldadm;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates new form EditAssetsDialog
|
* Creates new form EditAssetsDialog
|
||||||
*/
|
*/
|
||||||
public AssetListDialog(java.awt.Frame parent, boolean modal) {
|
public AssetListDialog(Window parent, boolean modal) {
|
||||||
super(parent, modal);
|
super(parent, modal);
|
||||||
initComponents();
|
initComponents();
|
||||||
|
|
||||||
@ -54,10 +59,29 @@ public class AssetListDialog extends EscDialog {
|
|||||||
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.assetListPanel.assetTable.addMouseListener(l);
|
this.assetListPanel.assetTable.addMouseListener(l);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AssetListDialog(WorldAdm worldadm, Window parent, boolean modal) {
|
||||||
|
super(parent, modal);
|
||||||
|
this.worldadm = worldadm;
|
||||||
|
|
||||||
|
initComponents();
|
||||||
|
|
||||||
|
java.awt.event.MouseAdapter l = new java.awt.event.MouseAdapter() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void mouseClicked(MouseEvent e) {
|
||||||
|
if (e.getClickCount() == 2) {
|
||||||
|
doEdit();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
|
this.assetListPanel.assetTable.addMouseListener(l);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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
|
||||||
@ -71,7 +95,7 @@ public class AssetListDialog extends EscDialog {
|
|||||||
newButton = new javax.swing.JButton();
|
newButton = new javax.swing.JButton();
|
||||||
jButton3 = new javax.swing.JButton();
|
jButton3 = new javax.swing.JButton();
|
||||||
editButton = new javax.swing.JButton();
|
editButton = new javax.swing.JButton();
|
||||||
assetListPanel = new opensesim.gui.AssetEditor.AssetListPanel();
|
assetListPanel = new opensesim.gui.AssetEditor.AssetListPanel(worldadm);
|
||||||
|
|
||||||
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
|
||||||
setTitle("Edit Assets");
|
setTitle("Edit Assets");
|
||||||
@ -113,7 +137,7 @@ public class AssetListDialog extends EscDialog {
|
|||||||
.addGroup(layout.createSequentialGroup()
|
.addGroup(layout.createSequentialGroup()
|
||||||
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
|
||||||
.addGroup(layout.createSequentialGroup()
|
.addGroup(layout.createSequentialGroup()
|
||||||
.addGap(0, 250, Short.MAX_VALUE)
|
.addGap(0, 0, Short.MAX_VALUE)
|
||||||
.addComponent(jButton3)
|
.addComponent(jButton3)
|
||||||
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
|
||||||
.addComponent(editButton)
|
.addComponent(editButton)
|
||||||
@ -149,8 +173,9 @@ public class AssetListDialog extends EscDialog {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
JSONObject o = new JSONObject();
|
JSONObject o = new JSONObject();
|
||||||
o.put("type", type);
|
o.put(World.JKEYS.ASSET_TYPE, type);
|
||||||
AssetEditorDialog.runDialog(this, o, o);
|
|
||||||
|
AssetEditorDialog.runDialog(this, worldadm, o, null);
|
||||||
assetListPanel.reload();
|
assetListPanel.reload();
|
||||||
|
|
||||||
}//GEN-LAST:event_newButtonActionPerformed
|
}//GEN-LAST:event_newButtonActionPerformed
|
||||||
@ -161,7 +186,7 @@ public class AssetListDialog extends EscDialog {
|
|||||||
|
|
||||||
private void doEdit() {
|
private void doEdit() {
|
||||||
JSONObject o = assetListPanel.getSelectedObject();
|
JSONObject o = assetListPanel.getSelectedObject();
|
||||||
AssetEditorDialog.runDialog(this, o, o);
|
// AssetEditorDialog.runDialog(this, o, o);
|
||||||
assetListPanel.reload();
|
assetListPanel.reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,6 +26,7 @@
|
|||||||
package opensesim.gui.AssetEditor;
|
package opensesim.gui.AssetEditor;
|
||||||
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
|
import java.util.Collection;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
import javax.swing.table.DefaultTableModel;
|
import javax.swing.table.DefaultTableModel;
|
||||||
@ -33,15 +34,16 @@ import javax.swing.table.TableModel;
|
|||||||
import opensesim.world.AbstractAsset;
|
import opensesim.world.AbstractAsset;
|
||||||
import opensesim.world.World;
|
import opensesim.world.World;
|
||||||
import opensesim.gui.Globals;
|
import opensesim.gui.Globals;
|
||||||
|
import opensesim.world.WorldAdm;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author 7u83 <7u83@mail.ru>
|
* @author 7u83 <7u83@mail.ru>
|
||||||
*/
|
*/
|
||||||
public class AssetListPanel extends javax.swing.JPanel implements GuiSelectionList{
|
public class AssetListPanel extends javax.swing.JPanel implements GuiSelectionList {
|
||||||
|
|
||||||
World world;
|
WorldAdm worldadm;
|
||||||
|
|
||||||
JSONObject json_set;
|
JSONObject json_set;
|
||||||
|
|
||||||
@ -49,7 +51,7 @@ public class AssetListPanel extends javax.swing.JPanel implements GuiSelectionLi
|
|||||||
* Creates new form AssetList
|
* Creates new form AssetList
|
||||||
*/
|
*/
|
||||||
public AssetListPanel() {
|
public AssetListPanel() {
|
||||||
world = Globals.world;
|
|
||||||
initComponents();
|
initComponents();
|
||||||
|
|
||||||
if (Globals.prefs == null) {
|
if (Globals.prefs == null) {
|
||||||
@ -58,9 +60,9 @@ public class AssetListPanel extends javax.swing.JPanel implements GuiSelectionLi
|
|||||||
|
|
||||||
json_set = new JSONObject(Globals.prefs.get("myassets", "{"
|
json_set = new JSONObject(Globals.prefs.get("myassets", "{"
|
||||||
+ "EUR:{name:Euro,decimals:8,type:opensesim.sesim.Assets.FurtureAsset}}"));
|
+ "EUR:{name:Euro,decimals:8,type:opensesim.sesim.Assets.FurtureAsset}}"));
|
||||||
|
|
||||||
json_set = Globals.getAssets();
|
json_set = Globals.getAssets();
|
||||||
reload();
|
// reload();
|
||||||
|
|
||||||
assetTable.setRowSelectionAllowed(true);
|
assetTable.setRowSelectionAllowed(true);
|
||||||
|
|
||||||
@ -69,6 +71,13 @@ public class AssetListPanel extends javax.swing.JPanel implements GuiSelectionLi
|
|||||||
assetTable.getColumnModel().getColumn(2).setPreferredWidth(80);
|
assetTable.getColumnModel().getColumn(2).setPreferredWidth(80);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AssetListPanel(WorldAdm worldadm) {
|
||||||
|
|
||||||
|
this();
|
||||||
|
this.worldadm = worldadm;
|
||||||
|
reload();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public JSONObject getSelectedObject() {
|
public JSONObject getSelectedObject() {
|
||||||
int row = assetTable.getSelectedRow();
|
int row = assetTable.getSelectedRow();
|
||||||
@ -77,7 +86,7 @@ public class AssetListPanel extends javax.swing.JPanel implements GuiSelectionLi
|
|||||||
}
|
}
|
||||||
|
|
||||||
final void reload() {
|
final void reload() {
|
||||||
json_set = Globals.getAssets();
|
/* json_set = Globals.getAssets();
|
||||||
DefaultTableModel m = (DefaultTableModel) assetTable.getModel();
|
DefaultTableModel m = (DefaultTableModel) assetTable.getModel();
|
||||||
|
|
||||||
|
|
||||||
@ -98,7 +107,10 @@ public class AssetListPanel extends javax.swing.JPanel implements GuiSelectionLi
|
|||||||
Logger.getLogger(AssetListPanel.class.getName()).log(Level.SEVERE, null, ex);
|
Logger.getLogger(AssetListPanel.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
m.addRow(new Object[]{
|
m.addRow(new Object[]{
|
||||||
|
|
||||||
@ -107,6 +119,35 @@ public class AssetListPanel extends javax.swing.JPanel implements GuiSelectionLi
|
|||||||
type_name
|
type_name
|
||||||
});
|
});
|
||||||
|
|
||||||
|
}*/
|
||||||
|
|
||||||
|
Collection<AbstractAsset> assets;
|
||||||
|
assets = worldadm.world.getAssetCollection();
|
||||||
|
DefaultTableModel m = (DefaultTableModel) assetTable.getModel();
|
||||||
|
m.setRowCount(0);
|
||||||
|
for (AbstractAsset asset : assets) {
|
||||||
|
JSONObject o;
|
||||||
|
o = asset.getJson();
|
||||||
|
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[]{
|
||||||
|
o.opt("symbol"),
|
||||||
|
o.opt("name"),
|
||||||
|
type_name
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -144,7 +185,6 @@ public class AssetListPanel extends javax.swing.JPanel implements GuiSelectionLi
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 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
|
||||||
|
@ -26,6 +26,8 @@
|
|||||||
package opensesim.gui.AssetEditor;
|
package opensesim.gui.AssetEditor;
|
||||||
|
|
||||||
import java.awt.Window;
|
import java.awt.Window;
|
||||||
|
import java.lang.reflect.Constructor;
|
||||||
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
@ -34,6 +36,8 @@ import javax.swing.DefaultComboBoxModel;
|
|||||||
import opensesim.world.AbstractAsset;
|
import opensesim.world.AbstractAsset;
|
||||||
import opensesim.gui.Globals;
|
import opensesim.gui.Globals;
|
||||||
import opensesim.gui.util.EscDialog;
|
import opensesim.gui.util.EscDialog;
|
||||||
|
import opensesim.world.World;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@ -61,10 +65,16 @@ public class SelectAssetTypeDialog extends EscDialog {
|
|||||||
System.out.printf("ACL: %s\n", asset_type.getName());
|
System.out.printf("ACL: %s\n", asset_type.getName());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ait = asset_type.newInstance();
|
Constructor<AbstractAsset> c;
|
||||||
|
c = asset_type.getConstructor(World.class,JSONObject.class);
|
||||||
|
ait = c.newInstance(null,null);
|
||||||
|
|
||||||
|
//ait = asset_type.getConstructor<AbstractAsset>(World.class,JSONObject.class).
|
||||||
vector.add(i, ait.getTypeName());
|
vector.add(i, ait.getTypeName());
|
||||||
} catch (InstantiationException | IllegalAccessException | ClassCastException ex) {
|
} catch (InstantiationException | IllegalAccessException | ClassCastException ex) {
|
||||||
Logger.getLogger(AssetEditorPanel.class.getName()).log(Level.SEVERE, null, ex);
|
Logger.getLogger(AssetEditorPanel.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
|
} catch (NoSuchMethodException | SecurityException | IllegalArgumentException | InvocationTargetException ex) {
|
||||||
|
Logger.getLogger(SelectAssetTypeDialog.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new DefaultComboBoxModel(vector.toArray());
|
return new DefaultComboBoxModel(vector.toArray());
|
||||||
|
@ -211,6 +211,11 @@ public class Globals {
|
|||||||
|
|
||||||
static public ArrayList<Class<AbstractAsset>> getAvailableAssetsTypes(boolean sort) {
|
static public ArrayList<Class<AbstractAsset>> getAvailableAssetsTypes(boolean sort) {
|
||||||
|
|
||||||
|
// if class_cache is not initialized return an empty list
|
||||||
|
if (class_cache == null){
|
||||||
|
return new ArrayList<>();
|
||||||
|
}
|
||||||
|
|
||||||
Collection<Class> asset_types_raw;
|
Collection<Class> asset_types_raw;
|
||||||
asset_types_raw = class_cache.getClassCollection(AbstractAsset.class);
|
asset_types_raw = class_cache.getClassCollection(AbstractAsset.class);
|
||||||
|
|
||||||
@ -230,8 +235,8 @@ public class Globals {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
// a1 = o1.newInstance();
|
// a1 = o1.newInstance();
|
||||||
a1 = o1.getConstructor().newInstance();
|
a1 = o1.getConstructor(World.class,JSONObject.class).newInstance(null,null);
|
||||||
a2 = o2.getConstructor().newInstance();
|
a2 = o2.getConstructor(World.class,JSONObject.class).newInstance(null,null);
|
||||||
} catch (InstantiationException | IllegalAccessException | NoSuchMethodException | SecurityException | IllegalArgumentException | InvocationTargetException ex) {
|
} catch (InstantiationException | IllegalAccessException | NoSuchMethodException | SecurityException | IllegalArgumentException | InvocationTargetException ex) {
|
||||||
Logger.getLogger(AssetEditorPanel.class.getName()).log(Level.SEVERE, null, ex);
|
Logger.getLogger(AssetEditorPanel.class.getName()).log(Level.SEVERE, null, ex);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -70,13 +70,17 @@ import opensesim.old_sesim.Scheduler;
|
|||||||
|
|
||||||
import opensesim.util.XClassLoader;
|
import opensesim.util.XClassLoader;
|
||||||
import opensesim.world.World;
|
import opensesim.world.World;
|
||||||
|
import opensesim.world.WorldAdm;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author 7u83 <7u83@mail.ru>
|
* @author 7u83 <7u83@mail.ru>
|
||||||
*/
|
*/
|
||||||
public class SeSimApplication extends javax.swing.JFrame {
|
public class SeSimApplication extends javax.swing.JFrame {
|
||||||
|
|
||||||
|
|
||||||
|
WorldAdm worldadm;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates new form NewMDIApplication
|
* Creates new form NewMDIApplication
|
||||||
*/
|
*/
|
||||||
@ -86,6 +90,11 @@ public class SeSimApplication extends javax.swing.JFrame {
|
|||||||
Globals.setLookAndFeel(Globals.prefs.get(Globals.PrefKeys.LAF, "Nimbus"));
|
Globals.setLookAndFeel(Globals.prefs.get(Globals.PrefKeys.LAF, "Nimbus"));
|
||||||
// Globals.setLookAndFeel("Metal");
|
// Globals.setLookAndFeel("Metal");
|
||||||
initComponents();
|
initComponents();
|
||||||
|
|
||||||
|
|
||||||
|
worldadm = new WorldAdm();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Get default screen and place our window
|
// Get default screen and place our window
|
||||||
// to the center of this screen
|
// to the center of this screen
|
||||||
@ -929,11 +938,14 @@ public class SeSimApplication extends javax.swing.JFrame {
|
|||||||
}//GEN-LAST:event_jMenuItem1ActionPerformed
|
}//GEN-LAST:event_jMenuItem1ActionPerformed
|
||||||
|
|
||||||
private void assetsMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_assetsMenuItemActionPerformed
|
private void assetsMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_assetsMenuItemActionPerformed
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
opensesim.gui.AssetEditor.AssetListDialog dialog;
|
opensesim.gui.AssetEditor.AssetListDialog dialog;
|
||||||
dialog = new opensesim.gui.AssetEditor.AssetListDialog(this,true);
|
dialog = new opensesim.gui.AssetEditor.AssetListDialog(worldadm,this,true);
|
||||||
dialog.setLocationRelativeTo(this);
|
dialog.setLocationRelativeTo(this);
|
||||||
dialog.setVisible(rootPaneCheckingEnabled);
|
dialog.setVisible(rootPaneCheckingEnabled);
|
||||||
dialog.dispose();
|
dialog.dispose();
|
||||||
}//GEN-LAST:event_assetsMenuItemActionPerformed
|
}//GEN-LAST:event_assetsMenuItemActionPerformed
|
||||||
|
|
||||||
private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
|
private void jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem2ActionPerformed
|
||||||
@ -970,6 +982,11 @@ public class SeSimApplication extends javax.swing.JFrame {
|
|||||||
*/
|
*/
|
||||||
public static void main(String args[]) throws IllegalAccessException, InstantiationException {
|
public static void main(String args[]) throws IllegalAccessException, InstantiationException {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//opensesim.world.World.MasterApi mapi = new opensesim.world.World.MasterApi();
|
||||||
|
|
||||||
|
|
||||||
// testing
|
// testing
|
||||||
|
|
||||||
|
@ -160,18 +160,19 @@ public abstract class AbstractAsset {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
/* public JSONObject getConfig() {
|
public JSONObject getJson() {
|
||||||
JSONObject cfg = new JSONObject();
|
JSONObject cfg = new JSONObject();
|
||||||
cfg.put(AbstractAsset.JSON_ID,id.toString());
|
cfg.put(World.JKEYS.ASSET_TYPE, this.getClass().getName());
|
||||||
cfg.put(AbstractAsset.JSON_CLASS, this.getClass().getName());
|
|
||||||
cfg.put(AbstractAsset.JSON_SYMBOL, this.getSymbol());
|
cfg.put(AbstractAsset.JSON_SYMBOL, this.getSymbol());
|
||||||
cfg.put(AbstractAsset.JSON_DECIMALS, this.getDecimals());
|
cfg.put(AbstractAsset.JSON_DECIMALS, this.getDecimals());
|
||||||
cfg.put(AbstractAsset.JSON_NAME, this.getName());
|
cfg.put(AbstractAsset.JSON_NAME, this.getName());
|
||||||
cfg.put(AbstractAsset.JSON_DESCRIPTION, this.getDescription());
|
cfg.put(AbstractAsset.JSON_DESCRIPTION, this.getDescription());
|
||||||
|
|
||||||
return cfg;
|
return cfg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
public void putConfig(JSONObject cfg) {
|
public void putConfig(JSONObject cfg) {
|
||||||
symbol = cfg.optString(AbstractAsset.JSON_SYMBOL);
|
symbol = cfg.optString(AbstractAsset.JSON_SYMBOL);
|
||||||
decimals = cfg.optInt(AbstractAsset.JSON_DECIMALS, AbstractAsset.DECIMALS_DEFAULT);
|
decimals = cfg.optInt(AbstractAsset.JSON_DECIMALS, AbstractAsset.DECIMALS_DEFAULT);
|
||||||
|
49
src/opensesim/world/WorldAdm.java
Normal file
49
src/opensesim/world/WorldAdm.java
Normal file
@ -0,0 +1,49 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (c) 2018, tohe
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* * Redistributions of source code must retain the above copyright notice, this
|
||||||
|
* list of conditions and the following disclaimer.
|
||||||
|
* * Redistributions in binary form must reproduce the above copyright notice,
|
||||||
|
* this list of conditions and the following disclaimer in the documentation
|
||||||
|
* and/or other materials provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||||
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||||
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
||||||
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
||||||
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
||||||
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||||
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||||
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*/
|
||||||
|
package opensesim.world;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author tohe
|
||||||
|
*/
|
||||||
|
public class WorldAdm {
|
||||||
|
public World world;
|
||||||
|
public long masterKey;
|
||||||
|
public WorldAdm(){
|
||||||
|
masterKey = 123456;
|
||||||
|
world = new World(masterKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
public World getWorld() {
|
||||||
|
return world;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getMasterKey() {
|
||||||
|
return masterKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user