Class TNEditor

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, RootPaneContainer, WindowConstants

public class TNEditor extends JFrame
A simple graphical application for creating/loading/modifying/saving/checking CSTNs. It is based on EdgePluggable.
Version:
$Rev: 898 $
Author:
posenato
See Also:
  • Field Details

    • DERIVED_GRAPH_BIG_VIEWER_NAME

      public static final String DERIVED_GRAPH_BIG_VIEWER_NAME
      Name of the derived graph big viewer
      See Also:
    • DISTANCE_VIEWER_NAME

      public static final String DISTANCE_VIEWER_NAME
      Name of the distance viewer panel
      See Also:
    • EDITOR_NAME

      public static final String EDITOR_NAME
      Name of the editor panel
      See Also:
    • INPUT_GRAPH_BIG_VIEWER_NAME

      public static final String INPUT_GRAPH_BIG_VIEWER_NAME
      Name of the input graph big viewer
      See Also:
    • mouseEventToolTipFunction

      public static final Function<MouseEvent,String> mouseEventToolTipFunction
      Tooltip rendering for the mouse movement
    • INFO_ICON_FILE

      static final URL INFO_ICON_FILE
    • LOG

      static final Logger LOG
      class logger
    • WARN_ICON_FILE

      static final URL WARN_ICON_FILE
    • checkedGraph

      final TNGraph<? extends Edge> checkedGraph
      TNGraph structures necessary to represent derived graph.
    • inputGraph

      final TNGraph<? extends Edge> inputGraph
      TNGraph structures necessary to represent input graph.
    • dcCurrentSem

      public AbstractCSTN.DCSemantics dcCurrentSem
      The current wanted semantics
    • cleanResult

      boolean cleanResult
      Cleaned result. True to store a cleaned result
    • contingentAlsoAsOrdinary

      boolean contingentAlsoAsOrdinary
      True if contingent link as to be represented also as ordinary constraints.
    • controlSouthPanel

      JPanel controlSouthPanel
    • cstn

      CSTN cstn
      CSTN checker
    • cstnCheckAlg

      Which check alg for CSTN
    • checkingAlgCSTNComboBox

      JComboBox<AbstractCSTN.CheckAlgorithm> checkingAlgCSTNComboBox
      Drop-down list for selecting CSTN CheckingAlgorithm
    • cstnDCSemanticsComboBox

      JComboBox<AbstractCSTN.DCSemantics> cstnDCSemanticsComboBox
      semantic combo for CSTN
    • cstnpsu

      CSTNPSU cstnpsu
      CSTNPSU checker
    • pcstnu

      PCSTNU pcstnu
      PCSTNU checker
    • cstnStatus

      CSTN check status
    • cstnu

      CSTNU cstnu
      CSTNU checker
    • cstnu2cstn

      CSTNU2CSTN cstnu2cstn
      CSTNU2CSTN checker
    • cstnuStatus

      CSTNU check status
    • currentEdgeImpl

      Class<? extends Edge> currentEdgeImpl
      Current edge implementation class
    • currentTNGraphType

      TNGraph.NetworkType currentTNGraphType
      The kind of network the system is currently showing
    • cycle

      int cycle
      Number of cycles of CSTN(U) check step-by-step
    • defaultDir

      String defaultDir
      Default load/save directory
    • edgesToCheck

      AbstractCSTN.EdgesToCheck<? extends Edge> edgesToCheck
      Edges to check in CSTN(U) check step-by-step
    • epsilonPanel

      JPanel epsilonPanel
      The epsilon panel
    • graphInfoLabel

      JLabel graphInfoLabel
      The graph info label
    • inputGraphBiggerViewer

      JButton inputGraphBiggerViewer
      Button for input network bigger viewer
    • derivedGraphBiggerViewer

      JButton derivedGraphBiggerViewer
      Button for derived network bigger viewer
    • layoutEditor

      edu.uci.ics.jung.algorithms.layout.AbstractLayout<LabeledNode,? extends Edge> layoutEditor
      Layout for input graph.
    • layoutToggleButton

      JToggleButton layoutToggleButton
      Button for re-layout input graph
    • layoutViewer

      final edu.uci.ics.jung.algorithms.layout.AbstractLayout<LabeledNode,? extends Edge> layoutViewer
      Layout for derived graph.
    • mapInfoLabel

      JLabel mapInfoLabel
    • modeBoxIndex

      int modeBoxIndex
      Position of the mode box for the main editor
    • modeBoxViewerIndex

      int modeBoxViewerIndex
      Position of the mode box for the viewer
    • oneStepBackGraph

      TNGraph<? extends Edge> oneStepBackGraph
      TNGraph structures necessary to represent an auxiliary graph.
    • onlyToZ

      boolean onlyToZ
      OnlyToZ says if the DC checking has to be made propagating constraints only to time-point Z
    • onlyToZCB

      JCheckBox onlyToZCB
    • preferredSize

      final Dimension preferredSize
      the preferred sizes for the two views
    • reactionTime

      int reactionTime
      Reaction time for CSTN
    • rowForAppButtons

      JPanel rowForAppButtons
    • rowForSTNButtons

      JPanel rowForSTNButtons
    • rowForSTNUButtons

      JPanel rowForSTNUButtons
    • rowForOSTNUButtons

      JPanel rowForOSTNUButtons
    • saveTNResultButton

      JButton saveTNResultButton
      Result Save Button
    • stn

      STN stn
      STN checker
    • stnCheckAlg

      STN.CheckAlgorithm stnCheckAlg
      Which check alg to use for STN
    • stnStatus

      STN check status
    • stnu

      STNU stnu
      STNU checker
    • ostnu

      OSTNU ostnu
      OSTNU checker
    • stnuCheckAlg

      STNU.CheckAlgorithm stnuCheckAlg
      Which check alg to use for STNU
    • stnuCheckAlgComboSelect

      JComboBox<STNU.CheckAlgorithm> stnuCheckAlgComboSelect
      Swing combo select for the stnuCheckAlg.
    • stnuStatus

      STNU check status
    • ostnuStatus

      OSTNU check status
    • validationPanelCSTN

      org.netbeans.validation.api.ui.swing.ValidationPanel validationPanelCSTN
      Validation panel for CSTN row
    • validationPanelCSTNU

      org.netbeans.validation.api.ui.swing.ValidationPanel validationPanelCSTNU
      Validation panel for CSTNU row
    • validationPanelCSTNPSU

      org.netbeans.validation.api.ui.swing.ValidationPanel validationPanelCSTNPSU
      Validation panel for CSTNPSU row
    • viewerMessageArea

      JEditorPane viewerMessageArea
      Message area above the derived (no input) graph.
    • vvEditor

      final edu.uci.ics.jung.visualization.VisualizationViewer<LabeledNode,? extends Edge> vvEditor
      The BasicVisualizationServer<V,E> for input graph.
    • vvViewer

      final edu.uci.ics.jung.visualization.VisualizationViewer<LabeledNode,? extends Edge> vvViewer
      The BasicVisualizationServer<V,E> for derived graph.
    • extraButtons

      boolean extraButtons
      Some buttons have meaning only for some contexts. The default is not to show.
  • Constructor Details

    • TNEditor

      public TNEditor()
      Initializes the fundamental fields. The initialization of the rest of fields and the starting of GUI is made by init() method, after that possible input parameter are read.
  • Method Details

    • getGraphLabelDescription

      static String getGraphLabelDescription(TNGraph<?> g)
      Parameters:
      g - graph
      Returns:
      a string describing essential characteristics of the graph.
    • main

      public static void main(String[] args)
      Parameters:
      args - an array of String objects.
    • setNodeEdgeRenders

      static <E extends Edge> void setNodeEdgeRenders(edu.uci.ics.jung.visualization.BasicVisualizationServer<LabeledNode,E> viewer, boolean firstViewer)
      Sets up vertex and edges renders.
      Type Parameters:
      E - type of edge
      Parameters:
      viewer - viewer
      firstViewer - true if viewer is in the first position
    • init

      public final void init()
      Initialize all others component of the GUI using the parameter values passed by
    • buildRenderContext

      final <E extends Edge> void buildRenderContext(edu.uci.ics.jung.visualization.VisualizationViewer<LabeledNode,E> viewer, boolean firstViewer)
      Adds vertex and edges renders, tooltips and mouse behavior to a viewer.
      Type Parameters:
      E - type of edge
      Parameters:
      viewer - viewer
      firstViewer - true if viewer is in the first position
    • loadGraphG

      final void loadGraphG(File fileName) throws IOException, ParserConfigurationException, SAXException
      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 - none
      ParserConfigurationException - none
      IOException - none
    • manageParameters

      final boolean manageParameters(String[] args)
      Simple method to manage command line parameters using args4j library.
      Parameters:
      args - none
      Returns:
      false if a parameter is missing, or it is wrong. True if every parameter is given in a right format.
    • resetDerivedGraphStatus

      final void resetDerivedGraphStatus()
    • saveGraphToFile

      final void saveGraphToFile(TNGraph<? extends Edge> graphToSave, File file) throws IOException
      Parameters:
      graphToSave - graph to save
      file - file where to save
      Throws:
      IOException - if file cannot be used for saving the graph.
    • setDefaultParametersForNetwork

      final void setDefaultParametersForNetwork(TNGraph.NetworkType networkType)
      Set all default parameter about the editor according to the input type.
      Parameters:
      networkType - network type
    • showCommandRow

      final void showCommandRow(TNGraph.NetworkType networkType)
      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 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 user if he wants to stay or not with the current input network.
      Returns:
      true if the user wants to stay with current graph, false for any other action or if the input network is void.