-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2a8fc2e
commit 7034277
Showing
25 changed files
with
344 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
src/main/java/br/com/davidbuzatto/yaas/gui/pda/PDAIDSimulationViewerFrame.form
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
|
||
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> | ||
<Properties> | ||
<Property name="defaultCloseOperation" type="int" value="0"/> | ||
<Property name="title" type="java.lang.String" value="Simulation ID Viewer"/> | ||
<Property name="iconImage" type="java.awt.Image" editor="org.netbeans.modules.form.RADConnectionPropertyEditor"> | ||
<Connection code="new javax.swing.ImageIcon( getClass().getResource( "/arrow_right.png" ) ).getImage()" type="code"/> | ||
</Property> | ||
</Properties> | ||
<SyntheticProperties> | ||
<SyntheticProperty name="formSizePolicy" type="int" value="1"/> | ||
<SyntheticProperty name="generateCenter" type="boolean" value="true"/> | ||
</SyntheticProperties> | ||
<Events> | ||
<EventHandler event="windowClosing" listener="java.awt.event.WindowListener" parameters="java.awt.event.WindowEvent" handler="formWindowClosing"/> | ||
</Events> | ||
<AuxValues> | ||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> | ||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> | ||
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> | ||
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> | ||
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> | ||
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> | ||
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> | ||
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> | ||
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> | ||
</AuxValues> | ||
|
||
<Layout> | ||
<DimensionLayout dim="0"> | ||
<Group type="103" groupAlignment="0" attributes="0"> | ||
<Component id="scrollDrawPanel" alignment="0" pref="300" max="32767" attributes="0"/> | ||
</Group> | ||
</DimensionLayout> | ||
<DimensionLayout dim="1"> | ||
<Group type="103" groupAlignment="0" attributes="0"> | ||
<Component id="scrollDrawPanel" alignment="1" max="32767" attributes="0"/> | ||
</Group> | ||
</DimensionLayout> | ||
</Layout> | ||
<SubComponents> | ||
<Container class="javax.swing.JScrollPane" name="scrollDrawPanel"> | ||
|
||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/> | ||
<SubComponents> | ||
<Container class="br.com.davidbuzatto.yaas.gui.pda.PDAIDViewerDrawPanel" name="drawPanel"> | ||
|
||
<Layout> | ||
<DimensionLayout dim="0"> | ||
<Group type="103" groupAlignment="0" attributes="0"> | ||
<EmptySpace min="0" pref="798" max="32767" attributes="0"/> | ||
</Group> | ||
</DimensionLayout> | ||
<DimensionLayout dim="1"> | ||
<Group type="103" groupAlignment="0" attributes="0"> | ||
<EmptySpace min="0" pref="598" max="32767" attributes="0"/> | ||
</Group> | ||
</DimensionLayout> | ||
</Layout> | ||
</Container> | ||
</SubComponents> | ||
</Container> | ||
</SubComponents> | ||
</Form> |
129 changes: 129 additions & 0 deletions
129
src/main/java/br/com/davidbuzatto/yaas/gui/pda/PDAIDSimulationViewerFrame.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
/* | ||
* Copyright (C) 2023 Prof. Dr. David Buzatto | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
package br.com.davidbuzatto.yaas.gui.pda; | ||
|
||
import br.com.davidbuzatto.yaas.model.pda.PDA; | ||
import br.com.davidbuzatto.yaas.model.pda.PDAID; | ||
import br.com.davidbuzatto.yaas.util.Utils; | ||
import java.util.List; | ||
|
||
/** | ||
* A viewer of a ID tree for the simulation proccess. | ||
* | ||
* @author Prof. Dr. David Buzatto | ||
*/ | ||
public class PDAIDSimulationViewerFrame extends javax.swing.JFrame { | ||
|
||
private int currentSimulationStep; | ||
private PDAInternalFrame pdaIFrame; | ||
private PDA pda; | ||
List<PDASimulationStep> simulationSteps; | ||
|
||
/** | ||
* Creates new form PDAIDSimulationViewerFrame | ||
*/ | ||
public PDAIDSimulationViewerFrame( | ||
PDAInternalFrame pdaIFrame, | ||
PDA pda, | ||
List<PDASimulationStep> simulationSteps ) { | ||
|
||
this.pdaIFrame = pdaIFrame; | ||
this.pda = pda; | ||
this.simulationSteps = simulationSteps; | ||
|
||
initComponents(); | ||
setLocationRelativeTo( pdaIFrame ); | ||
setAlwaysOnTop( true ); | ||
|
||
drawPanel.setPda( pda ); | ||
drawPanel.arrangeAndProccessIdsForSimulation( simulationSteps ); | ||
drawPanel.repaint(); | ||
drawPanel.revalidate(); | ||
|
||
setCurrentSimulationStep( currentSimulationStep ); | ||
|
||
} | ||
|
||
/** | ||
* This method is called from within the constructor to initialize the form. | ||
* WARNING: Do NOT modify this code. The content of this method is always | ||
* regenerated by the Form Editor. | ||
*/ | ||
@SuppressWarnings( "unchecked" ) | ||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents | ||
private void initComponents() { | ||
|
||
scrollDrawPanel = new javax.swing.JScrollPane(); | ||
drawPanel = new br.com.davidbuzatto.yaas.gui.pda.PDAIDViewerDrawPanel(); | ||
|
||
setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE); | ||
setTitle("Simulation ID Viewer"); | ||
setIconImage(new javax.swing.ImageIcon( getClass().getResource( "/arrow_right.png" ) ).getImage()); | ||
addWindowListener(new java.awt.event.WindowAdapter() { | ||
public void windowClosing(java.awt.event.WindowEvent evt) { | ||
formWindowClosing(evt); | ||
} | ||
}); | ||
|
||
javax.swing.GroupLayout drawPanelLayout = new javax.swing.GroupLayout(drawPanel); | ||
drawPanel.setLayout(drawPanelLayout); | ||
drawPanelLayout.setHorizontalGroup( | ||
drawPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) | ||
.addGap(0, 798, Short.MAX_VALUE) | ||
); | ||
drawPanelLayout.setVerticalGroup( | ||
drawPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) | ||
.addGap(0, 598, Short.MAX_VALUE) | ||
); | ||
|
||
scrollDrawPanel.setViewportView(drawPanel); | ||
|
||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); | ||
getContentPane().setLayout(layout); | ||
layout.setHorizontalGroup( | ||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) | ||
.addComponent(scrollDrawPanel, javax.swing.GroupLayout.DEFAULT_SIZE, 300, Short.MAX_VALUE) | ||
); | ||
layout.setVerticalGroup( | ||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) | ||
.addComponent(scrollDrawPanel, javax.swing.GroupLayout.Alignment.TRAILING) | ||
); | ||
|
||
pack(); | ||
setLocationRelativeTo(null); | ||
}// </editor-fold>//GEN-END:initComponents | ||
|
||
private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing | ||
Utils.showInformationMessage( this, "This window will close automatically when you stop the simulation." ); | ||
}//GEN-LAST:event_formWindowClosing | ||
|
||
public void setCurrentSimulationStep( int currentSimulationStep ) { | ||
this.currentSimulationStep = currentSimulationStep; | ||
for ( PDASimulationStep step : simulationSteps ) { | ||
step.getId().setActiveInSimulation( false ); | ||
} | ||
for ( int i = 0; i <= currentSimulationStep; i++ ) { | ||
simulationSteps.get( i ).getId().setActiveInSimulation( true ); | ||
} | ||
drawPanel.repaint(); | ||
} | ||
|
||
// Variables declaration - do not modify//GEN-BEGIN:variables | ||
private br.com.davidbuzatto.yaas.gui.pda.PDAIDViewerDrawPanel drawPanel; | ||
private javax.swing.JScrollPane scrollDrawPanel; | ||
// End of variables declaration//GEN-END:variables | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.