Package it.univr.di.cstnu.visualization
Class TNEditor
java.lang.Object
java.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
it.univr.di.cstnu.visualization.TNEditor
- All Implemented Interfaces:
ImageObserver
,MenuContainer
,Serializable
,Accessible
,RootPaneContainer
,WindowConstants
A simple graphical application for creating/loading/modifying/saving/checking CSTNs.
- Version:
- $Rev: 993 $
- Author:
- posenato
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JFrame
JFrame.AccessibleJFrame
Nested classes/interfaces inherited from class java.awt.Frame
Frame.AccessibleAWTFrame
Nested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.Type
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
FieldsModifier and TypeFieldDescriptionNecessary TNGraph structure to represent the derived graph.(package private) JComboBox
<AbstractCSTN.CheckAlgorithm> Drop-down list for selecting CSTN Checking Algorithm(package private) boolean
Cleaned result.(package private) boolean
True if the contingent link is also to be represented as ordinary constraints.(package private) JPanel
(package private) CSTN
CSTN checker(package private) AbstractCSTN.CheckAlgorithm
Which check algorithm for CSTN(package private) JComboBox
<AbstractCSTN.DCSemantics> semantic combo for CSTN(package private) CSTNPSU
CSTNPSU checker(package private) AbstractCSTN.CSTNCheckStatus
CSTN check status(package private) CSTNU
CSTNU checker(package private) CSTNU2CSTN
CSTNU2CSTN checker(package private) CSTNU.CSTNUCheckStatus
CSTNU check statusCurrent edge implementation class(package private) TNGraph.NetworkType
The kind of network the system is currently showing(package private) int
Number of cycles of CSTN(U) check step-by-stepThe current wanted semantics(package private) String
Default load/save directorystatic final String
Name of the derived graph Big Viewer(package private) JButton
Button for a bigger derived-network viewerstatic final String
Name of the distance viewer panel(package private) AbstractCSTN.EdgesToCheck
<? extends Edge> Edges to check in CSTN(U) check step-by-stepstatic final String
Name of the editor panel(package private) JPanel
The epsilon panel(package private) boolean
Some buttons have meaning only in some contexts.(package private) JLabel
The graph info label(package private) static final URL
static final String
Name of the input graph Big ViewerNecessary TNGraph structure to represent the input graph.(package private) JButton
Button for a bigger input-network viewer(package private) edu.uci.ics.jung.algorithms.layout.AbstractLayout
<LabeledNode, ? extends Edge> Layout for the input graph.(package private) JToggleButton
Button for re-layout input graph(package private) final edu.uci.ics.jung.algorithms.layout.AbstractLayout
<LabeledNode, ? extends Edge> Layout for derived graph.(package private) static final Logger
class logger(package private) JLabel
(package private) int
Position of the mode box for the main editor(package private) int
Position of the mode box for the viewerstatic final Function
<MouseEvent, String> Tooltip rendering for the mouse movementNecessary TNGraph structure to represent an auxiliary graph.(package private) boolean
OnlyToZ says if the DC checking has to be made propagating constraints only to time-point Z(package private) JCheckBox
(package private) OSTNU
OSTNU checker(package private) OSTNU.OSTNUCheckStatus
OSTNU check status(package private) PCSTNU
PCSTNU checker(package private) final Dimension
the preferred sizes for the two views(package private) int
Reaction time for CSTN(package private) JPanel
(package private) JPanel
(package private) JPanel
(package private) JPanel
(package private) JButton
Result Save Button(package private) STN
STN checker(package private) STN.CheckAlgorithm
Which check algorithm to use for STN(package private) STN.STNCheckStatus
STN check status(package private) STNU
STNU checker(package private) STNU.CheckAlgorithm
Which check algorithm to use for STNU(package private) JComboBox
<STNU.CheckAlgorithm> Swing combo-select for the stnuCheckAlg.(package private) STNU.STNUCheckStatus
STNU check status(package private) org.netbeans.validation.api.ui.swing.ValidationPanel
Validation panel for CSTN row(package private) org.netbeans.validation.api.ui.swing.ValidationPanel
Validation panel for CSTNPSU row(package private) org.netbeans.validation.api.ui.swing.ValidationPanel
Validation panel for CSTNU row(package private) JEditorPane
Message area above the derived (no input) graph.(package private) final edu.uci.ics.jung.visualization.VisualizationViewer
<LabeledNode, ? extends Edge> The BasicVisualizationServer<V, E> for input graph.(package private) final edu.uci.ics.jung.visualization.VisualizationViewer
<LabeledNode, ? extends Edge> The BasicVisualizationServer<V, E> for derived graph.(package private) static final URL
Fields inherited from class javax.swing.JFrame
accessibleContext, rootPane, rootPaneCheckingEnabled
Fields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) final <E extends Edge>
voidbuildRenderContext
(edu.uci.ics.jung.visualization.VisualizationViewer<LabeledNode, E> viewer, boolean firstViewer) Adds vertex and edge renders, tooltips, and mouse behavior to a viewer.(package private) static String
final void
init()
Initialize all other components of the GUI using the parameter values passed.(package private) final void
loadGraphG
(File fileName) Loads TNGraph stored in file 'fileName' into attribute this.g.
Be careful!static void
(package private) final boolean
manageParameters
(String[] args) Simple method to manage command line parameters using the args4j library.(package private) final void
(package private) final void
saveGraphToFile
(TNGraph<? extends Edge> graphToSave, File file) (package private) final void
setDefaultParametersForNetwork
(TNGraph.NetworkType networkType) Set all default parameters about the editor according to the input type.(package private) static <E extends Edge>
voidsetNodeEdgeRenders
(edu.uci.ics.jung.visualization.BasicVisualizationServer<LabeledNode, E> viewer, boolean firstViewer) Sets up vertex and edge renders.(package private) final void
showCommandRow
(TNGraph.NetworkType networkType) In the command panel, only one row of commands is visible.(package private) final void
Update node positions in the derived graph.(package private) final void
Update the vvViewer after a check, making some common operations.(package private) final boolean
Shows a ConfirmDialog to ask the user if they want to stay or not with the current input network.Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update
Methods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
Methods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate, validateTree
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.awt.MenuContainer
getFont, postEvent
-
Field Details
-
DERIVED_GRAPH_BIG_VIEWER_NAME
Name of the derived graph Big Viewer- See Also:
-
DISTANCE_VIEWER_NAME
Name of the distance viewer panel- See Also:
-
EDITOR_NAME
Name of the editor panel- See Also:
-
INPUT_GRAPH_BIG_VIEWER_NAME
Name of the input graph Big Viewer- See Also:
-
mouseEventToolTipFunction
Tooltip rendering for the mouse movement -
INFO_ICON_FILE
-
LOG
class logger -
WARN_ICON_FILE
-
checkedGraph
Necessary TNGraph structure to represent the derived graph. -
inputGraph
Necessary TNGraph structure to represent the input graph. -
layoutViewer
Layout for derived graph. -
preferredSize
the preferred sizes for the two views -
vvEditor
The BasicVisualizationServer<V, E> for input graph. -
vvViewer
The BasicVisualizationServer<V, E> for derived graph. -
dcCurrentSem
The current wanted semantics -
cleanResult
boolean cleanResultCleaned result. True to store a cleaned result -
contingentAlsoAsOrdinary
boolean contingentAlsoAsOrdinaryTrue if the contingent link is also to be represented as ordinary constraints. -
controlSouthPanel
JPanel controlSouthPanel -
cstn
CSTN cstnCSTN checker -
cstnCheckAlg
AbstractCSTN.CheckAlgorithm cstnCheckAlgWhich check algorithm for CSTN -
checkingAlgCSTNComboBox
JComboBox<AbstractCSTN.CheckAlgorithm> checkingAlgCSTNComboBoxDrop-down list for selecting CSTN Checking Algorithm -
cstnDCSemanticsComboBox
JComboBox<AbstractCSTN.DCSemantics> cstnDCSemanticsComboBoxsemantic combo for CSTN -
cstnpsu
CSTNPSU cstnpsuCSTNPSU checker -
pcstnu
PCSTNU pcstnuPCSTNU checker -
cstnStatus
AbstractCSTN.CSTNCheckStatus cstnStatusCSTN check status -
cstnu
CSTNU cstnuCSTNU checker -
cstnu2cstn
CSTNU2CSTN cstnu2cstnCSTNU2CSTN checker -
cstnuStatus
CSTNU.CSTNUCheckStatus cstnuStatusCSTNU check status -
currentEdgeImpl
Current edge implementation class -
currentTNGraphType
TNGraph.NetworkType currentTNGraphTypeThe kind of network the system is currently showing -
cycle
int cycleNumber of cycles of CSTN(U) check step-by-step -
defaultDir
String defaultDirDefault load/save directory -
edgesToCheck
AbstractCSTN.EdgesToCheck<? extends Edge> edgesToCheckEdges to check in CSTN(U) check step-by-step -
epsilonPanel
JPanel epsilonPanelThe epsilon panel -
graphInfoLabel
JLabel graphInfoLabelThe graph info label -
inputGraphBiggerViewer
JButton inputGraphBiggerViewerButton for a bigger input-network viewer -
derivedGraphBiggerViewer
JButton derivedGraphBiggerViewerButton for a bigger derived-network viewer -
layoutEditor
edu.uci.ics.jung.algorithms.layout.AbstractLayout<LabeledNode,? extends Edge> layoutEditorLayout for the input graph. -
layoutToggleButton
JToggleButton layoutToggleButtonButton for re-layout input graph -
mapInfoLabel
JLabel mapInfoLabel -
modeBoxIndex
int modeBoxIndexPosition of the mode box for the main editor -
modeBoxViewerIndex
int modeBoxViewerIndexPosition of the mode box for the viewer -
oneStepBackGraph
Necessary TNGraph structure to represent an auxiliary graph. -
onlyToZ
boolean onlyToZOnlyToZ says if the DC checking has to be made propagating constraints only to time-point Z -
onlyToZCB
JCheckBox onlyToZCB -
reactionTime
int reactionTimeReaction time for CSTN -
rowForAppButtons
JPanel rowForAppButtons -
rowForSTNButtons
JPanel rowForSTNButtons -
rowForSTNUButtons
JPanel rowForSTNUButtons -
rowForOSTNUButtons
JPanel rowForOSTNUButtons -
saveTNResultButton
JButton saveTNResultButtonResult Save Button -
stn
STN stnSTN checker -
stnCheckAlg
STN.CheckAlgorithm stnCheckAlgWhich check algorithm to use for STN -
stnStatus
STN.STNCheckStatus stnStatusSTN check status -
stnu
STNU stnuSTNU checker -
ostnu
OSTNU ostnuOSTNU checker -
stnuCheckAlg
STNU.CheckAlgorithm stnuCheckAlgWhich check algorithm to use for STNU -
stnuCheckAlgComboSelect
JComboBox<STNU.CheckAlgorithm> stnuCheckAlgComboSelectSwing combo-select for the stnuCheckAlg. -
stnuStatus
STNU.STNUCheckStatus stnuStatusSTNU check status -
ostnuStatus
OSTNU.OSTNUCheckStatus ostnuStatusOSTNU check status -
validationPanelCSTN
org.netbeans.validation.api.ui.swing.ValidationPanel validationPanelCSTNValidation panel for CSTN row -
validationPanelCSTNU
org.netbeans.validation.api.ui.swing.ValidationPanel validationPanelCSTNUValidation panel for CSTNU row -
validationPanelCSTNPSU
org.netbeans.validation.api.ui.swing.ValidationPanel validationPanelCSTNPSUValidation panel for CSTNPSU row -
viewerMessageArea
JEditorPane viewerMessageAreaMessage area above the derived (no input) graph. -
extraButtons
boolean extraButtonsSome buttons have meaning only in some contexts. The default is not to show.
-
-
Constructor Details
-
TNEditor
public TNEditor()Initializes the fundamental fields. The initialization of the rest of the fields and the starting of the GUI is made by theinit()
method, after that, possible input parameters are read.
-
-
Method Details
-
getGraphLabelDescription
- Parameters:
g
- graph- Returns:
- a string describing essential characteristics of the graph.
-
main
- Parameters:
args
- an array ofString
objects.
-
setNodeEdgeRenders
static <E extends Edge> void setNodeEdgeRenders(edu.uci.ics.jung.visualization.BasicVisualizationServer<LabeledNode, E> viewer, boolean firstViewer) Sets up vertex and edge renders.- Type Parameters:
E
- type of edge- Parameters:
viewer
- viewerfirstViewer
- true if the viewer is in the first position
-
init
public final void init()Initialize all other components of the GUI using the parameter values passed. -
buildRenderContext
final <E extends Edge> void buildRenderContext(edu.uci.ics.jung.visualization.VisualizationViewer<LabeledNode, E> viewer, boolean firstViewer) Adds vertex and edge renders, tooltips, and mouse behavior to a viewer.- Type Parameters:
E
- type of edge- Parameters:
viewer
- viewerfirstViewer
- true if the viewer is in the first position
-
loadGraphG
Loads TNGraph stored in file 'fileName' into attribute this.g.
Be careful! The extension of the file name determines the kind of TNGraph..stn ===> STN .cstn ===> CSTN .stnu ===> STNU .cstnu ===> CSTNU .pcstnu ===> PCSTNU .cstpsu ===> CSTNPSU .ostnu ===> OSTNU
- Parameters:
fileName
- file name- Throws:
SAXException
- noneParserConfigurationException
- noneIOException
- none
-
manageParameters
Simple method to manage command line parameters using the args4j library.- Parameters:
args
- none- Returns:
- false if a parameter is missing or wrong. True if every parameter is given in the right format.
-
resetDerivedGraphStatus
final void resetDerivedGraphStatus() -
saveGraphToFile
- Parameters:
graphToSave
- graph to savefile
- file where to save- Throws:
IOException
- if the file cannot be used to save the graph.
-
setDefaultParametersForNetwork
Set all default parameters about the editor according to the input type.- Parameters:
networkType
- network type
-
showCommandRow
In the command panel, only one row of commands is visible. This method makes visible one row, hiding the others.- Parameters:
networkType
- network type
-
updateNodePositions
final void updateNodePositions()Update node positions in the derived graph. -
updatevvViewer
final void updatevvViewer()Update the vvViewer after a check, making some common operations. -
userWantsToStayWithCurrentNetworkInEditor
final boolean userWantsToStayWithCurrentNetworkInEditor()Shows a ConfirmDialog to ask the user if they want to stay or not with the current input network.- Returns:
- true if the user wants to stay with the current graph, false for any other action, or if the input network is void.
-