mirror of
https://github.com/OMGeeky/ATCS.git
synced 2025-12-26 15:57:22 +01:00
Warnings hunt.
This commit is contained in:
@@ -1,6 +1,11 @@
|
||||
package com.zackehh.siphash;
|
||||
|
||||
import static com.zackehh.siphash.SipHashConstants.*;
|
||||
import static com.zackehh.siphash.SipHashConstants.DEFAULT_C;
|
||||
import static com.zackehh.siphash.SipHashConstants.DEFAULT_D;
|
||||
import static com.zackehh.siphash.SipHashConstants.INITIAL_V0;
|
||||
import static com.zackehh.siphash.SipHashConstants.INITIAL_V1;
|
||||
import static com.zackehh.siphash.SipHashConstants.INITIAL_V2;
|
||||
import static com.zackehh.siphash.SipHashConstants.INITIAL_V3;
|
||||
|
||||
/**
|
||||
* Main entry point for SipHash, providing a basic hash
|
||||
|
||||
@@ -32,13 +32,13 @@ import javax.swing.event.HyperlinkEvent;
|
||||
import javax.swing.event.HyperlinkListener;
|
||||
import javax.swing.plaf.FontUIResource;
|
||||
|
||||
import prefuse.data.expression.parser.ExpressionParser;
|
||||
|
||||
import com.gpl.rpg.atcontentstudio.model.Workspace;
|
||||
import com.gpl.rpg.atcontentstudio.ui.StudioFrame;
|
||||
import com.gpl.rpg.atcontentstudio.ui.WorkerDialog;
|
||||
import com.gpl.rpg.atcontentstudio.ui.WorkspaceSelector;
|
||||
|
||||
import prefuse.data.expression.parser.ExpressionParser;
|
||||
|
||||
|
||||
public class ATContentStudio {
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.gpl.rpg.atcontentstudio.model;
|
||||
|
||||
import java.awt.Image;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileNotFoundException;
|
||||
@@ -8,7 +9,6 @@ import java.io.FileOutputStream;
|
||||
import java.io.FileWriter;
|
||||
import java.io.IOException;
|
||||
import java.io.Serializable;
|
||||
import java.io.StringBufferInputStream;
|
||||
import java.io.StringReader;
|
||||
import java.io.StringWriter;
|
||||
import java.util.ArrayList;
|
||||
@@ -16,12 +16,10 @@ import java.util.Collections;
|
||||
import java.util.Enumeration;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
import java.util.Set;
|
||||
|
||||
import javax.swing.tree.TreeNode;
|
||||
import javax.xml.parsers.DocumentBuilder;
|
||||
@@ -1313,7 +1311,7 @@ public class Project implements ProjectTreeNode, Serializable {
|
||||
transformer.transform(input, output);
|
||||
|
||||
String tempString = temp.toString();
|
||||
doc = builder.parse(new StringBufferInputStream(tempString));
|
||||
doc = builder.parse(new ByteArrayInputStream(tempString.getBytes("UTF-8")));
|
||||
input = new DOMSource(doc);
|
||||
transformer = TransformerFactory.newInstance().newTransformer(new StreamSource(new StringReader(
|
||||
"<?xml version=\"1.0\"?>\r\n" +
|
||||
|
||||
@@ -158,7 +158,7 @@ public class WorkspaceSettings {
|
||||
value = defaultValue;
|
||||
}
|
||||
|
||||
public abstract void readFromJson(Map json);
|
||||
public abstract void readFromJson(@SuppressWarnings("rawtypes") Map json);
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
public void saveToJson(Map json) {
|
||||
@@ -188,6 +188,7 @@ public class WorkspaceSettings {
|
||||
super(id, null);
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
@Override
|
||||
public void saveToJson(Map json) {
|
||||
if (value != null) json.put(id, value);
|
||||
@@ -201,6 +202,7 @@ public class WorkspaceSettings {
|
||||
this.value = this.defaultValue = defaultValue;
|
||||
}
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@Override
|
||||
public void readFromJson(Map json) {
|
||||
value = new ArrayList<X>();
|
||||
|
||||
@@ -172,6 +172,7 @@ public class Requirement extends JSONElement {
|
||||
case skillLevel:
|
||||
case spentGold:
|
||||
case timerElapsed:
|
||||
case factionScore:
|
||||
break;
|
||||
}
|
||||
if (this.required_obj != null) this.required_obj.addBacklink((GameDataElement) this.parent);
|
||||
|
||||
@@ -99,7 +99,7 @@ public class TMXMapSet implements ProjectTreeNode {
|
||||
while(getProject().open) {
|
||||
try {
|
||||
watchService = FileSystems.getDefault().newWatchService();
|
||||
WatchKey watchKey = folderPath.register(watchService, StandardWatchEventKinds.ENTRY_MODIFY);
|
||||
/*WatchKey watchKey = */folderPath.register(watchService, StandardWatchEventKinds.ENTRY_MODIFY);
|
||||
WatchKey wk;
|
||||
validService: while(getProject().open) {
|
||||
wk = watchService.take();
|
||||
|
||||
@@ -652,7 +652,7 @@ public abstract class Editor extends JPanel implements ProjectElementListener {
|
||||
return gdeBox;
|
||||
}
|
||||
|
||||
public JComboBox<QuestStage> addQuestStageBox(JPanel pane, Project proj, String label, Integer initialValue, boolean writable, final FieldUpdateListener listener, Quest quest, final JComboBox questSelectionBox) {
|
||||
public JComboBox<QuestStage> addQuestStageBox(JPanel pane, Project proj, String label, Integer initialValue, boolean writable, final FieldUpdateListener listener, Quest quest, @SuppressWarnings("rawtypes") final JComboBox questSelectionBox) {
|
||||
JPanel gdePane = new JPanel();
|
||||
gdePane.setLayout(new JideBoxLayout(gdePane, JideBoxLayout.LINE_AXIS, 6));
|
||||
JLabel gdeLabel = new JLabel(label);
|
||||
@@ -702,7 +702,7 @@ public abstract class Editor extends JPanel implements ProjectElementListener {
|
||||
|
||||
|
||||
|
||||
@SuppressWarnings({ "rawtypes", "unchecked" })
|
||||
@SuppressWarnings({ "rawtypes"})
|
||||
public JList addBacklinksList(JPanel pane, GameDataElement gde) {
|
||||
return addBacklinksList(pane, gde, "Elements linking to this one");
|
||||
}
|
||||
@@ -866,7 +866,6 @@ public abstract class Editor extends JPanel implements ProjectElementListener {
|
||||
return currentQuest.stages.get(index - 1);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void setSelectedItem(Object anItem) {
|
||||
selected = (QuestStage) anItem;
|
||||
|
||||
@@ -36,6 +36,7 @@ public class ActorConditionEditor extends JSONElementEditor {
|
||||
private IntegerBasedCheckBox stackingBox;
|
||||
|
||||
//private JTextField roundVisualField;
|
||||
@SuppressWarnings("rawtypes")
|
||||
private JComboBox roundVisualField;
|
||||
private JSpinner roundHpMinField;
|
||||
private JSpinner roundHpMaxField;
|
||||
@@ -43,6 +44,7 @@ public class ActorConditionEditor extends JSONElementEditor {
|
||||
private JSpinner roundApMaxField;
|
||||
|
||||
//private JTextField fullRoundVisualField;
|
||||
@SuppressWarnings("rawtypes")
|
||||
private JComboBox fullRoundVisualField;
|
||||
private JSpinner fullRoundHpMinField;
|
||||
private JSpinner fullRoundHpMaxField;
|
||||
|
||||
@@ -96,6 +96,7 @@ public class DialogueEditor extends JSONElementEditor {
|
||||
private JPanel rewardsParamsPane;
|
||||
private MyComboBox rewardMap;
|
||||
private JTextField rewardObjId;
|
||||
@SuppressWarnings("rawtypes")
|
||||
private JComboBox rewardObjIdCombo;
|
||||
private MyComboBox rewardObj;
|
||||
private JComponent rewardValue;
|
||||
@@ -120,6 +121,7 @@ public class DialogueEditor extends JSONElementEditor {
|
||||
private JComboBox requirementTypeCombo;
|
||||
private JPanel requirementParamsPane;
|
||||
private MyComboBox requirementObj;
|
||||
@SuppressWarnings("rawtypes")
|
||||
private JComboBox requirementSkill;
|
||||
private JTextField requirementObjId;
|
||||
private JComponent requirementValue;
|
||||
|
||||
@@ -44,7 +44,6 @@ import com.gpl.rpg.atcontentstudio.ui.ScrollablePanel;
|
||||
import com.gpl.rpg.atcontentstudio.ui.ScrollablePanel.ScrollableSizeHint;
|
||||
import com.gpl.rpg.atcontentstudio.ui.sprites.SpriteChooser;
|
||||
import com.jidesoft.swing.JideBoxLayout;
|
||||
import com.jidesoft.swing.JideScrollPane;
|
||||
import com.jidesoft.swing.JideTabbedPane;
|
||||
|
||||
public abstract class JSONElementEditor extends Editor {
|
||||
@@ -303,6 +302,7 @@ public abstract class JSONElementEditor extends Editor {
|
||||
}
|
||||
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
public boolean idChanging() {
|
||||
JSONElement node = (JSONElement) target;
|
||||
List<GameDataElement> toModify = new LinkedList<GameDataElement>();
|
||||
|
||||
@@ -40,8 +40,6 @@ public class QuestEditor extends JSONElementEditor {
|
||||
|
||||
private static final long serialVersionUID = 5701667955210615366L;
|
||||
|
||||
private static final Integer one = 1;
|
||||
|
||||
private static final String form_view_id = "Form";
|
||||
private static final String json_view_id = "JSON";
|
||||
|
||||
|
||||
@@ -316,7 +316,7 @@ public class WorldMapEditor extends Editor implements FieldUpdateListener {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
String selectedMap = null;
|
||||
boolean update = false;
|
||||
// boolean update = false;
|
||||
int x = (int) (e.getX() / mapView.zoomLevel);
|
||||
int y = (int) (e.getY() / mapView.zoomLevel);
|
||||
for (String s : mapView.mapLocations.keySet()) {
|
||||
@@ -333,19 +333,19 @@ public class WorldMapEditor extends Editor implements FieldUpdateListener {
|
||||
if (mapView.getSelectedMapsIDs().size() > 1) {
|
||||
removeFromSelection(selectedMap);
|
||||
// mapView.selected.remove(selectedMap);
|
||||
update = true;
|
||||
// update = true;
|
||||
}
|
||||
} else {
|
||||
addToSelection(selectedMap);
|
||||
// mapView.selected.add(selectedMap);
|
||||
update = true;
|
||||
// update = true;
|
||||
}
|
||||
} else {
|
||||
clearSelection();
|
||||
// mapView.selected.clear();
|
||||
addToSelection(selectedMap);
|
||||
// mapView.selected.add(selectedMap);
|
||||
update = true;
|
||||
// update = true;
|
||||
}
|
||||
}
|
||||
} else if (editMode == EditMode.addMap && mapBeingAddedID != null) {
|
||||
@@ -354,7 +354,7 @@ public class WorldMapEditor extends Editor implements FieldUpdateListener {
|
||||
pushToModel();
|
||||
}
|
||||
mapView.updateFromModel();
|
||||
update = true;
|
||||
// update = true;
|
||||
mapBeingAddedID = null;
|
||||
}
|
||||
// if (update) {
|
||||
|
||||
@@ -85,7 +85,7 @@ public class WorldMapView extends JComponent implements Scrollable {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
String selectedMap = null;
|
||||
boolean update = false;
|
||||
// boolean update = false;
|
||||
int x = (int) (e.getX() / zoomLevel);
|
||||
int y = (int) (e.getY() / zoomLevel);
|
||||
for (String s : mapLocations.keySet()) {
|
||||
|
||||
@@ -341,12 +341,12 @@ public class WriterModeEditor extends Editor {
|
||||
}
|
||||
|
||||
Node rNode;
|
||||
int i = 1;
|
||||
// int i = 1;
|
||||
for (WriterModeData.WriterReply reply : dialogue.replies) {
|
||||
if (reply instanceof EmptyReply && reply.next_dialogue != null) {
|
||||
if (cells.get(reply.next_dialogue) == null) {
|
||||
rNode = addDialogueNode(reply.next_dialogue);
|
||||
Edge e = graph.addEdge(dNode, rNode);
|
||||
/*Edge e = */graph.addEdge(dNode, rNode);
|
||||
} else {
|
||||
rNode = cells.get(reply.next_dialogue);
|
||||
Edge e = graph.addEdge(dNode, rNode);
|
||||
@@ -355,7 +355,7 @@ public class WriterModeEditor extends Editor {
|
||||
} else {
|
||||
if (cells.get(reply) == null) {
|
||||
rNode = addReplyNode(reply);
|
||||
Edge e = graph.addEdge(dNode, rNode);
|
||||
/*Edge e = */graph.addEdge(dNode, rNode);
|
||||
// e.setString(LABEL, "#"+i++);
|
||||
} else {
|
||||
rNode = cells.get(reply);
|
||||
@@ -380,7 +380,7 @@ public class WriterModeEditor extends Editor {
|
||||
if (reply.next_dialogue != null) {
|
||||
if (cells.get(reply.next_dialogue) == null) {
|
||||
Node dNode = addDialogueNode(reply.next_dialogue);
|
||||
Edge e = graph.addEdge(rNode, dNode);
|
||||
/*Edge e = */graph.addEdge(rNode, dNode);
|
||||
} else {
|
||||
Node dNode = cells.get(reply.next_dialogue);
|
||||
Edge e = graph.addEdge(rNode, dNode);
|
||||
@@ -665,7 +665,7 @@ public class WriterModeEditor extends Editor {
|
||||
cells.get(selected).set(LABEL, selected.text);
|
||||
}
|
||||
|
||||
static final String createNextDefaultNodeString = "createNextDefaultNode";
|
||||
// static final String createNextDefaultNodeString = "createNextDefaultNode";
|
||||
final AbstractAction createNextDefaultNode = new AbstractAction("Create next default") {
|
||||
private static final long serialVersionUID = 1658086056088672748L;
|
||||
|
||||
@@ -689,7 +689,7 @@ public class WriterModeEditor extends Editor {
|
||||
}
|
||||
}
|
||||
if (newNode!= null) {
|
||||
Edge edge = graph.addEdge(cells.get(selected), newNode);
|
||||
/*Edge edge = */graph.addEdge(cells.get(selected), newNode);
|
||||
setSelected(newWrNode);
|
||||
|
||||
m_vis.run("colors");
|
||||
@@ -732,7 +732,7 @@ public class WriterModeEditor extends Editor {
|
||||
temp.next_dialogue = newWrNode;
|
||||
|
||||
newNode = addDialogueNode(newWrNode);
|
||||
Edge edge = graph.addEdge(cells.get(selected), newNode);
|
||||
/*Edge edge = */graph.addEdge(cells.get(selected), newNode);
|
||||
setSelected(newWrNode);
|
||||
|
||||
m_vis.run("colors");
|
||||
@@ -758,7 +758,7 @@ public class WriterModeEditor extends Editor {
|
||||
if (selected instanceof WriterReply) {
|
||||
newWrNode = data.new WriterReply(((WriterReply) selected).parent);
|
||||
newNode = addReplyNode(newWrNode);
|
||||
Edge edge = graph.addEdge(cells.get(((WriterReply) selected).parent), newNode);
|
||||
/*Edge edge = */graph.addEdge(cells.get(((WriterReply) selected).parent), newNode);
|
||||
setSelected(newWrNode);
|
||||
|
||||
m_vis.run("colors");
|
||||
@@ -903,18 +903,18 @@ public class WriterModeEditor extends Editor {
|
||||
}
|
||||
}
|
||||
|
||||
public void selectScrollAndEdit(WriterNode node) {
|
||||
if (node != null) {
|
||||
setSelected(node);
|
||||
|
||||
m_vis.run("colors");
|
||||
m_vis.run("layout");
|
||||
m_vis.run("scrollToSelectedAndEdit");
|
||||
|
||||
revalidate();
|
||||
repaint();
|
||||
}
|
||||
}
|
||||
// public void selectScrollAndEdit(WriterNode node) {
|
||||
// if (node != null) {
|
||||
// setSelected(node);
|
||||
//
|
||||
// m_vis.run("colors");
|
||||
// m_vis.run("layout");
|
||||
// m_vis.run("scrollToSelectedAndEdit");
|
||||
//
|
||||
// revalidate();
|
||||
// repaint();
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user