Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor dead comment and TODO cleanup #159

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 1 addition & 16 deletions WoPeD-BPELExport/src/main/java/org/woped/bpel/BPEL.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import org.woped.core.utilities.Utils;
import org.woped.gui.translations.Messages;

// TODO class description
/** Operations with BPEL files. */
public class BPEL {

private static BPEL bpelMainClass;
Expand All @@ -34,39 +34,33 @@ public class BPEL {
private FileFilter _filter;
private String _fileextension = "bpel";

// TODO method description
public BPEL() {
if (BPEL.bpelMainClass != null) return;
this.initFilefilter();
bpelMainClass = this;
}

// TODO method description
private final void initFilefilter() {
this._extensions = new Vector<String>();
this._extensions.add(this._fileextension);
this._filter = new FileFilterImpl(FileFilterImpl.BPELFilter, "BPEL (*.bpel)", this._extensions);
}

// TODO method description
public static final BPEL getBPELMainClass() {
if (bpelMainClass == null) {
new BPEL();
}
return bpelMainClass;
}

// TODO method description
public FileFilter getFilefilter() {
return this._filter;
}

// TODO method description
public boolean checkFileExtension(JFileChooser jfc) {
return ((FileFilterImpl) jfc.getFileFilter()).getFilterType() == FileFilterImpl.BPELFilter;
}

// TODO method description
public String getSavePath(String basicPath, JFileChooser jfc) {
return basicPath
+ Utils.getQualifiedFileName(jfc.getSelectedFile().getName(), this._extensions);
Expand All @@ -81,24 +75,18 @@ public boolean saveFile(String Path, IEditor editor) {
m.createModel(pnp.getElementContainer());
ProcessDocument doc = ProcessDocument.Factory.newInstance();
TProcess process = doc.addNewProcess();
// BPEL.genBpelProcess();
// BPEL.Process.set(m.generate_bpel());
// setGlobals(BPEL.Process, pnp);
process.set(m.generate_bpel());
setGlobals(process, pnp);
// File Output
XmlOptions opt = new XmlOptions();

// opt.setSavePrettyPrintIndent(2);
// opt.setUseDefaultNamespace();
Map<String, String> map = new HashMap<String, String>();
map.put("http://docs.oasis-open.org/wsbpel/2.0/process/executable", "bpel");
map.put("http://www.w3.org/2001/XMLSchema", "xs");
opt = opt.setSaveSuggestedPrefixes(map);
opt.setSavePrettyPrint();
try {
doc.save(new File(Path), opt);
// bpelDoc.save(new File(Path), opt);
return true;
} catch (IOException e) {
return false;
Expand Down Expand Up @@ -128,8 +116,6 @@ public String genPreview(IEditor editor) {
return "" + Messages.getString("BPEL.genPreview.Error");
}
XmlOptions opt = new XmlOptions();
// opt.setSavePrettyPrintIndent(2);
// opt.setUseDefaultNamespace();
Map<String, String> map = new HashMap<String, String>();
map.put("http://docs.oasis-open.org/wsbpel/2.0/process/executable", "bpel");
map.put("http://www.w3.org/2001/XMLSchema", "xs");
Expand All @@ -139,7 +125,6 @@ public String genPreview(IEditor editor) {
}

public static TProcess genBpelProcess() {
// if(BPEL.Process != null)return BPEL.Process;
XmlOptions opt = new XmlOptions();
opt.setUseDefaultNamespace();
opt.setSavePrettyPrint();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,17 +122,13 @@ public String getAppdir() {
public abstract boolean readConfig(InputStream is);

/**
* TODO: DOCUMENTATION (silenco)
*
* @param file
* @param configType type indicator for type of currently handled configuration
* @return
*/
public abstract boolean readConfig(File file);

/**
* TODO: DOCUMENTATION (silenco)
*
* @param confDoc
* @return
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ public boolean initConfig() {
}

/**
* TODO: DOCUMENTATION (silenco)
*
* @return indicates whether loading was successful
*/
public boolean readConfig() {
Expand Down Expand Up @@ -160,8 +158,6 @@ public boolean readConfig(InputStream is) {
}

/**
* TODO: DOCUMENTATION (silenco)
*
* @param file
* @return
*/
Expand All @@ -188,8 +184,6 @@ public boolean readConfig(File file) {
}

/**
* TODO: DOCUMENTATION (silenco)
*
* @param configDoc
* @return
*/
Expand Down Expand Up @@ -285,8 +279,6 @@ public boolean readConfig(XmlObject configDoc) {
}

/**
* TODO: DOCUMENTATION (silenco)
*
* @param file
* @return
*/
Expand Down
6 changes: 0 additions & 6 deletions WoPeD-Core/src/main/java/org/woped/core/Constants.java

This file was deleted.

11 changes: 11 additions & 0 deletions WoPeD-Core/src/main/java/org/woped/core/WoPeDConstants.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package org.woped.core;

public class WoPeDConstants {

public static final String CORE_LOGGER = "CORE_LOGGER";

// Keep in synch with mvn pom file.
// Could read directly from pom like this:
// https://stackoverflow.com/questions/3697449/retrieve-version-from-maven-pom-xml-in-code
public static final String WOPED_VERSION = "3.9.1";
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import java.util.List;
import java.util.Map;
import javax.swing.UIManager;
import org.woped.core.Constants;
import org.woped.core.WoPeDConstants;
import org.woped.core.config.ConfigurationManager;
import org.woped.core.config.IGeneralConfiguration;
import org.woped.core.gui.IEditorAware;
Expand All @@ -55,7 +55,7 @@ public AbstractApplicationMediator(IUserInterface ui, IGeneralConfiguration conf
viewControllerMap = new HashMap<String, IViewController>();
boolean confOK = true;

LoggerManager.info(Constants.CORE_LOGGER, "START INIT Application");
LoggerManager.info(WoPeDConstants.CORE_LOGGER, "START INIT Application");
setUi(ui);
setConf(conf);

Expand All @@ -64,8 +64,8 @@ public AbstractApplicationMediator(IUserInterface ui, IGeneralConfiguration conf
confOK = conf.initConfig();
if (!confOK) {
// This should NEVER happen!
LoggerManager.fatal(Constants.CORE_LOGGER, "Could really not load any configuration.");
LoggerManager.info(Constants.CORE_LOGGER, "EXIT WoPeD - LOGGING DEACTIVATED");
LoggerManager.fatal(WoPeDConstants.CORE_LOGGER, "Could really not load any configuration.");
LoggerManager.info(WoPeDConstants.CORE_LOGGER, "EXIT WoPeD - LOGGING DEACTIVATED");
System.exit(0);
}
}
Expand All @@ -79,9 +79,9 @@ public AbstractApplicationMediator(IUserInterface ui, IGeneralConfiguration conf

UIManager.setLookAndFeel(ConfigurationManager.getConfiguration().getLookAndFeel());
LoggerManager.info(
Constants.CORE_LOGGER, "Look-And-Feel set to " + Platform.getSystemLookAndFeel());
WoPeDConstants.CORE_LOGGER, "Look-And-Feel set to " + Platform.getSystemLookAndFeel());
} catch (Exception e) {
LoggerManager.debug(Constants.CORE_LOGGER, "Look-And-Feel could not be set");
LoggerManager.debug(WoPeDConstants.CORE_LOGGER, "Look-And-Feel could not be set");
}
}

Expand Down Expand Up @@ -118,7 +118,7 @@ public static IViewController createViewController(String className, String id)
return vc;
} catch (Exception e1) {
LoggerManager.error(
Constants.CORE_LOGGER,
WoPeDConstants.CORE_LOGGER,
"Could not create the ViewController (ID:" + id + ")" + e1.getMessage());
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
import org.jgraph.graph.GraphModel;
import org.jgraph.graph.GraphUndoManager;
import org.jgraph.graph.Port;
import org.woped.core.Constants;
import org.woped.core.WoPeDConstants;
import org.woped.core.config.ConfigurationManager;
import org.woped.core.model.PetriNetModelProcessor;
import org.woped.core.model.petrinet.AbstractPetriNetElementModel;
Expand Down Expand Up @@ -204,7 +204,7 @@ public void connect(DefaultEdge edge, boolean insertIntoCache) {
}
//
} else {
LoggerManager.warn(Constants.CORE_LOGGER, "Not a valid connection, did nothing!");
LoggerManager.warn(WoPeDConstants.CORE_LOGGER, "Not a valid connection, did nothing!");
}
}

Expand Down Expand Up @@ -241,7 +241,7 @@ public GroupModel group(
if (mainElement != null && name != null) {
// Create Group Cell
GroupModel group = new GroupModel(mainElement, name, additional, ungroupable);
LoggerManager.debug(Constants.CORE_LOGGER, "Grouping of Elements created.");
LoggerManager.debug(WoPeDConstants.CORE_LOGGER, "Grouping of Elements created.");
return group;
} else {
GroupModel group = new GroupModel(mainElement, name, additional, ungroupable);
Expand Down Expand Up @@ -283,7 +283,7 @@ public void ungroup(Object[] cells) {
graphModel.remove(groups.toArray());
// Select Children
setSelectionCells(children.toArray());
LoggerManager.debug(Constants.CORE_LOGGER, "Grouping of Elements deleted. ");
LoggerManager.debug(WoPeDConstants.CORE_LOGGER, "Grouping of Elements deleted. ");
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import org.jgraph.graph.CellView;
import org.jgraph.graph.GraphLayoutCache;
import org.jgraph.graph.GraphModel;
import org.woped.core.Constants;
import org.woped.core.WoPeDConstants;
import org.woped.core.utilities.LoggerManager;

/**
Expand Down Expand Up @@ -89,14 +89,14 @@ public void valueForCellChanged(Object cell, Object newValue) {
if (cell instanceof DefaultMutableTreeNode) {
if (((DefaultMutableTreeNode) cell).getUserObject() == null) {
if (newValue == null) {
LoggerManager.debug(Constants.CORE_LOGGER, "Edit not added: No change.");
LoggerManager.debug(WoPeDConstants.CORE_LOGGER, "Edit not added: No change.");
} else {
super.valueForCellChanged(cell, newValue);
}
} else if (!((DefaultMutableTreeNode) cell).getUserObject().equals(newValue)) {
super.valueForCellChanged(cell, newValue);
} else {
LoggerManager.debug(Constants.CORE_LOGGER, "Edit not added: No change.");
LoggerManager.debug(WoPeDConstants.CORE_LOGGER, "Edit not added: No change.");
}
} else {
super.valueForCellChanged(cell, newValue);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import java.util.HashMap;
import java.util.LinkedList;
import java.util.Map;
import org.woped.core.Constants;
import org.woped.core.WoPeDConstants;
import org.woped.core.utilities.LoggerManager;

/**
Expand Down Expand Up @@ -52,7 +52,7 @@ public void unregister(int viewEventType, AbstractEventProcessor vep) {

if (processors == null || !processors.contains(vep)) {
LoggerManager.warn(
Constants.CORE_LOGGER,
WoPeDConstants.CORE_LOGGER,
"Tried to unregister a AbstractViewEventProcessor which has not"
+ " registered for this type.");
return;
Expand Down
6 changes: 3 additions & 3 deletions WoPeD-Core/src/main/java/org/woped/core/model/ArcModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import org.jgraph.graph.DefaultPort;
import org.jgraph.graph.GraphConstants;
import org.jgraph.graph.PortView;
import org.woped.core.Constants;
import org.woped.core.WoPeDConstants;
import org.woped.core.config.ConfigurationManager;
import org.woped.core.config.DefaultStaticConfiguration;
import org.woped.core.model.petrinet.AbstractPetriNetElementModel;
Expand Down Expand Up @@ -287,7 +287,7 @@ public void addPoint(Point2D c, int index) {
HashMap<Object, Object> map = new HashMap<Object, Object>();
GraphConstants.setPoints(map, points);
getAttributes().applyMap(map);
LoggerManager.debug(Constants.CORE_LOGGER, "Point added " + c.toString());
LoggerManager.debug(WoPeDConstants.CORE_LOGGER, "Point added " + c.toString());
}

/**
Expand Down Expand Up @@ -369,7 +369,7 @@ public void removePoint(Point2D l) {
points.remove(pos);
GraphConstants.setPoints(map, points);
getAttributes().applyMap(map);
LoggerManager.debug(Constants.CORE_LOGGER, "Point removed");
LoggerManager.debug(WoPeDConstants.CORE_LOGGER, "Point removed");
}

public boolean hasPoint(Point2D p, int tolerance) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
import java.util.List;
import java.util.Vector;
import javax.swing.ImageIcon;
import org.woped.core.Constants;
import org.woped.core.WoPeDConstants;
import org.woped.core.config.ConfigurationManager;
import org.woped.core.model.petrinet.AbstractPetriNetElementModel;
import org.woped.core.utilities.LoggerManager;
Expand Down Expand Up @@ -387,7 +387,8 @@ public void setArcPoints(List<?> points) {
newPoints.add(new Point2D.Double(p.getX1(), p.getX2()));
} else {
LoggerManager.error(
Constants.CORE_LOGGER, "Could not convert " + o.toString() + "to Point2D. Skipped");
WoPeDConstants.CORE_LOGGER,
"Could not convert " + o.toString() + "to Point2D. Skipped");
}
}

Expand Down
Loading