Update javadoc.
This commit is contained in:
parent
990b74bf1a
commit
17da90c32c
@ -100,7 +100,7 @@ public class GraphStatistics {
|
|||||||
*
|
*
|
||||||
* @param boundingBox Bounding-box for the graph.
|
* @param boundingBox Bounding-box for the graph.
|
||||||
* @param nbRoadOneWay Number of one-way roads in the graph.
|
* @param nbRoadOneWay Number of one-way roads in the graph.
|
||||||
* @param nbRoadTwoTayws Number of two-ways roads in the graph.
|
* @param nbRoadTwoWays Number of two-ways roads in the graph.
|
||||||
* @param maximumSpeed Maximum speed of any road of the graph. You can use
|
* @param maximumSpeed Maximum speed of any road of the graph. You can use
|
||||||
* {@link #NO_MAXIMUM_SPEED} to indicate that the graph has no maximum
|
* {@link #NO_MAXIMUM_SPEED} to indicate that the graph has no maximum
|
||||||
* speed limit.
|
* speed limit.
|
||||||
|
@ -139,6 +139,19 @@ public class AlgorithmPanel extends JPanel implements DrawingChangeListener {
|
|||||||
List<ActionListener> startActionListeners = new ArrayList<>();
|
List<ActionListener> startActionListeners = new ArrayList<>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Create a new AlgorithmPanel with the given parameters.
|
||||||
|
*
|
||||||
|
* @param parent Parent component for this panel. Only use for centering
|
||||||
|
* dialogs.
|
||||||
|
* @param baseAlgorithm Base algorithm for this algorithm panel.
|
||||||
|
* @param title Title of the panel.
|
||||||
|
* @param nodeNames Names of the input nodes.
|
||||||
|
* @param enableModeSelection <code>true</code> to enable {@link Mode}
|
||||||
|
* selection.
|
||||||
|
* @param enableArcFilterSelection <code>true</code> to enable {@link ArcFilter}
|
||||||
|
* selection.
|
||||||
|
*
|
||||||
|
* @see ArcFilterFactory
|
||||||
*/
|
*/
|
||||||
public AlgorithmPanel(Component parent, Class<? extends AbstractAlgorithm<?>> baseAlgorithm,
|
public AlgorithmPanel(Component parent, Class<? extends AbstractAlgorithm<?>> baseAlgorithm,
|
||||||
String title, String[] nodeNames, boolean enableModeSelection,
|
String title, String[] nodeNames, boolean enableModeSelection,
|
||||||
@ -312,7 +325,7 @@ public class AlgorithmPanel extends JPanel implements DrawingChangeListener {
|
|||||||
*
|
*
|
||||||
* @param title Title for the label.
|
* @param title Title for the label.
|
||||||
*
|
*
|
||||||
* @return
|
* @return A new JLabel containing the given title with proper font.
|
||||||
*/
|
*/
|
||||||
protected JLabel createTitleLabel(String title) {
|
protected JLabel createTitleLabel(String title) {
|
||||||
JLabel titleLabel = new JLabel(title);
|
JLabel titleLabel = new JLabel(title);
|
||||||
@ -328,7 +341,12 @@ public class AlgorithmPanel extends JPanel implements DrawingChangeListener {
|
|||||||
/**
|
/**
|
||||||
* Create the combo box for the algorithm selection.
|
* Create the combo box for the algorithm selection.
|
||||||
*
|
*
|
||||||
* @return
|
* @param baseAlgorithm Base algorithm for which the select box should be
|
||||||
|
* created.
|
||||||
|
*
|
||||||
|
* @return A new JComboBox containing algorithms for the given base algorithm.
|
||||||
|
*
|
||||||
|
* @see AlgorithmFactory
|
||||||
*/
|
*/
|
||||||
protected JComboBox<String> createAlgoritmSelectComboBox(
|
protected JComboBox<String> createAlgoritmSelectComboBox(
|
||||||
Class<? extends AbstractAlgorithm<?>> baseAlgorithm) {
|
Class<? extends AbstractAlgorithm<?>> baseAlgorithm) {
|
||||||
@ -343,8 +361,9 @@ public class AlgorithmPanel extends JPanel implements DrawingChangeListener {
|
|||||||
/**
|
/**
|
||||||
* Create a node input panel with the given node input names.
|
* Create a node input panel with the given node input names.
|
||||||
*
|
*
|
||||||
* @param nodeNames
|
* @param nodeNames Field names for the inputs to create.
|
||||||
* @return
|
*
|
||||||
|
* @return A new NodesInputPanel containing inputs for the given names.
|
||||||
*/
|
*/
|
||||||
protected NodesInputPanel createNodesInputPanel(String[] nodeNames) {
|
protected NodesInputPanel createNodesInputPanel(String[] nodeNames) {
|
||||||
final Color[] nodeColors = { new Color(57, 172, 115), new Color(255, 77, 77),
|
final Color[] nodeColors = { new Color(57, 172, 115), new Color(255, 77, 77),
|
||||||
@ -358,6 +377,15 @@ public class AlgorithmPanel extends JPanel implements DrawingChangeListener {
|
|||||||
return panel;
|
return panel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if the given list of nodes does not contain any <code>null</code>
|
||||||
|
* value.
|
||||||
|
*
|
||||||
|
* @param nodes List of {@link Node} to check.
|
||||||
|
*
|
||||||
|
* @return <code>true</code> if the list does not contain any <code>null</code>
|
||||||
|
* value, <code>false</code> otherwise.
|
||||||
|
*/
|
||||||
protected boolean allNotNull(List<Node> nodes) {
|
protected boolean allNotNull(List<Node> nodes) {
|
||||||
boolean allNotNull = true;
|
boolean allNotNull = true;
|
||||||
for (Node node: nodes) {
|
for (Node node: nodes) {
|
||||||
@ -382,7 +410,7 @@ public class AlgorithmPanel extends JPanel implements DrawingChangeListener {
|
|||||||
/**
|
/**
|
||||||
* Add a new start action listener to this class.
|
* Add a new start action listener to this class.
|
||||||
*
|
*
|
||||||
* @param listener
|
* @param listener Listener to add.
|
||||||
*/
|
*/
|
||||||
public void addStartActionListener(ActionListener listener) {
|
public void addStartActionListener(ActionListener listener) {
|
||||||
this.startActionListeners.add(listener);
|
this.startActionListeners.add(listener);
|
||||||
|
@ -59,7 +59,7 @@ public class NodesInputPanel extends JPanel
|
|||||||
* @param point
|
* @param point
|
||||||
*
|
*
|
||||||
* @return the closest node to the given point, or null if no node is "close
|
* @return the closest node to the given point, or null if no node is "close
|
||||||
* enough".
|
* enough".
|
||||||
*/
|
*/
|
||||||
public Node findClosestNode(Point point) {
|
public Node findClosestNode(Point point) {
|
||||||
Node minNode = null;
|
Node minNode = null;
|
||||||
@ -124,14 +124,23 @@ public class NodesInputPanel extends JPanel
|
|||||||
private NodeFinder nodeFinder;
|
private NodeFinder nodeFinder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param drawing Original drawing used (see {@link:newDrawingLoaded}).
|
* Create a new NodesInputPanel.
|
||||||
* @param graph Original graph used (see {@link:newGraphLoaded});
|
*
|
||||||
*/
|
*/
|
||||||
public NodesInputPanel() {
|
public NodesInputPanel() {
|
||||||
super(new GridBagLayout());
|
super(new GridBagLayout());
|
||||||
initInputToFill();
|
initInputToFill();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add an InputChanged listener to this panel. This listener will be notified by
|
||||||
|
* a {@link InputChangedEvent} each time an input in this panel change (click,
|
||||||
|
* clear, manual input).
|
||||||
|
*
|
||||||
|
* @param listener Listener to add.
|
||||||
|
*
|
||||||
|
* @see InputChangedEvent
|
||||||
|
*/
|
||||||
public void addInputChangedListener(ActionListener listener) {
|
public void addInputChangedListener(ActionListener listener) {
|
||||||
inputChangeListeners.add(listener);
|
inputChangeListeners.add(listener);
|
||||||
}
|
}
|
||||||
@ -293,7 +302,7 @@ public class NodesInputPanel extends JPanel
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return The node for the given text field, or null if the content of the text
|
* @return The node for the given text field, or null if the content of the text
|
||||||
* field is invalid.
|
* field is invalid.
|
||||||
*/
|
*/
|
||||||
protected Node getNodeForInput(JTextField textfield) {
|
protected Node getNodeForInput(JTextField textfield) {
|
||||||
try {
|
try {
|
||||||
@ -307,7 +316,7 @@ public class NodesInputPanel extends JPanel
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return List of nodes associated with the input. Some nodes may be null if
|
* @return List of nodes associated with the input. Some nodes may be null if
|
||||||
* their associated input is invalid.
|
* their associated input is invalid.
|
||||||
*/
|
*/
|
||||||
public List<Node> getNodeForInputs() {
|
public List<Node> getNodeForInputs() {
|
||||||
List<Node> nodes = new ArrayList<>(nodeInputs.size());
|
List<Node> nodes = new ArrayList<>(nodeInputs.size());
|
||||||
|
@ -12,8 +12,8 @@ public class StreamCapturer extends OutputStream {
|
|||||||
private JTextArea output;
|
private JTextArea output;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param prefix
|
* @param output Output JTextArea to which this stream should print.
|
||||||
* @param output
|
* @param prefix Prefix to add to each line of this output.
|
||||||
*/
|
*/
|
||||||
public StreamCapturer(JTextArea output, String prefix) {
|
public StreamCapturer(JTextArea output, String prefix) {
|
||||||
this.prefix = prefix;
|
this.prefix = prefix;
|
||||||
@ -21,6 +21,11 @@ public class StreamCapturer extends OutputStream {
|
|||||||
this.output = output;
|
this.output = output;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create a new StreamCapturer without prefix.
|
||||||
|
*
|
||||||
|
* @param output Output JTextArea to which this stream should print.
|
||||||
|
*/
|
||||||
public StreamCapturer(JTextArea output) {
|
public StreamCapturer(JTextArea output) {
|
||||||
this(output, null);
|
this(output, null);
|
||||||
}
|
}
|
||||||
|
@ -398,7 +398,6 @@ public class BasicDrawing extends JPanel implements Drawing {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
|
||||||
* @see org.insa.graphics.drawing.Drawing#clear()
|
* @see org.insa.graphics.drawing.Drawing#clear()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@ -414,7 +413,6 @@ public class BasicDrawing extends JPanel implements Drawing {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
|
||||||
* @see org.insa.graphics.drawing.Drawing#clearOverlays()
|
* @see org.insa.graphics.drawing.Drawing#clearOverlays()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
@ -458,7 +456,6 @@ public class BasicDrawing extends JPanel implements Drawing {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
|
||||||
* @see
|
* @see
|
||||||
* org.insa.graphics.drawing.Drawing#addDrawingClickListener(org.insa.graphics.
|
* org.insa.graphics.drawing.Drawing#addDrawingClickListener(org.insa.graphics.
|
||||||
* drawing.DrawingClickListener)
|
* drawing.DrawingClickListener)
|
||||||
@ -470,7 +467,6 @@ public class BasicDrawing extends JPanel implements Drawing {
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
|
||||||
* @see org.insa.graphics.drawing.Drawing#removeDrawingClickListener(org.insa.
|
* @see org.insa.graphics.drawing.Drawing#removeDrawingClickListener(org.insa.
|
||||||
* graphics.drawing.DrawingClickListener)
|
* graphics.drawing.DrawingClickListener)
|
||||||
*/
|
*/
|
||||||
|
@ -16,8 +16,26 @@ public class FileUtils {
|
|||||||
// Preferences
|
// Preferences
|
||||||
private static Preferences preferences = Preferences.userRoot().node(FileUtils.class.getName());
|
private static Preferences preferences = Preferences.userRoot().node(FileUtils.class.getName());
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Type of folder with associated preferred folder and path filters.
|
||||||
|
*
|
||||||
|
*/
|
||||||
public enum FolderType {
|
public enum FolderType {
|
||||||
Map, PathInput, PathOutput
|
|
||||||
|
/**
|
||||||
|
* Folder type for graph files input (*.mapgr).
|
||||||
|
*/
|
||||||
|
Map,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Folder type for path inputs (*.path).
|
||||||
|
*/
|
||||||
|
PathInput,
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Folder type for path outputs (*.path).
|
||||||
|
*/
|
||||||
|
PathOutput
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class PreferencesEntry {
|
private static class PreferencesEntry {
|
||||||
@ -55,7 +73,11 @@ public class FileUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @param folderType Type of folder to retrieve.
|
||||||
|
*
|
||||||
* @return A File instance pointing to the preferred folder for the given type.
|
* @return A File instance pointing to the preferred folder for the given type.
|
||||||
|
*
|
||||||
|
* @see FolderType
|
||||||
*/
|
*/
|
||||||
public static File getPreferredFolder(FolderType folderType) {
|
public static File getPreferredFolder(FolderType folderType) {
|
||||||
PreferencesEntry entry = folderToEntry.get(folderType);
|
PreferencesEntry entry = folderToEntry.get(folderType);
|
||||||
@ -66,12 +88,18 @@ public class FileUtils {
|
|||||||
return folder;
|
return folder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param folderType Type of folder to update.
|
||||||
|
* @param newPreferredFolder New preferred folder.
|
||||||
|
*/
|
||||||
public static void updatePreferredFolder(FolderType folderType, File newPreferredFolder) {
|
public static void updatePreferredFolder(FolderType folderType, File newPreferredFolder) {
|
||||||
PreferencesEntry entry = folderToEntry.get(folderType);
|
PreferencesEntry entry = folderToEntry.get(folderType);
|
||||||
preferences.put(entry.key, newPreferredFolder.getAbsolutePath());
|
preferences.put(entry.key, newPreferredFolder.getAbsolutePath());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* @param folderType Type of folder for which the filter should be retrieved.
|
||||||
|
*
|
||||||
* @return A FileFilter corresponding to input graph files.
|
* @return A FileFilter corresponding to input graph files.
|
||||||
*/
|
*/
|
||||||
public static FileFilter getFileFilter(FolderType folderType) {
|
public static FileFilter getFileFilter(FolderType folderType) {
|
||||||
@ -79,8 +107,12 @@ public class FileUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param folderType
|
* @param folderType Type of folder for which a file chooser should be created.
|
||||||
* @return
|
* @param defaultFileName Default file name to show, or null to not show any
|
||||||
|
* file.
|
||||||
|
*
|
||||||
|
* @return A new JFileChooser pointing to the preferred folder for the given
|
||||||
|
* folderType, with the given default file selected (if given).
|
||||||
*/
|
*/
|
||||||
public static JFileChooser createFileChooser(FolderType folderType, String defaultFileName) {
|
public static JFileChooser createFileChooser(FolderType folderType, String defaultFileName) {
|
||||||
JFileChooser chooser = new JFileChooser();
|
JFileChooser chooser = new JFileChooser();
|
||||||
@ -104,6 +136,14 @@ public class FileUtils {
|
|||||||
return chooser;
|
return chooser;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param folderType Type of folder for which a file chooser should be created.
|
||||||
|
*
|
||||||
|
* @return A new JFileChooser pointing to the preferred folder for the given
|
||||||
|
* folderType.
|
||||||
|
*
|
||||||
|
* @see #createFileChooser(FolderType, String)
|
||||||
|
*/
|
||||||
public static JFileChooser createFileChooser(FolderType folderType) {
|
public static JFileChooser createFileChooser(FolderType folderType) {
|
||||||
return createFileChooser(folderType, null);
|
return createFileChooser(folderType, null);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user