Skip to content
Snippets Groups Projects
Commit 5b97e63a authored by Matej Kovár's avatar Matej Kovár
Browse files

updated javadocs, added "remove primary face" method

parent dc9ad153
No related branches found
No related tags found
No related merge requests found
...@@ -181,6 +181,9 @@ ...@@ -181,6 +181,9 @@
<ResourceString bundle="cz/fidentis/analyst/gui/Bundle.properties" key="ProjectTopComp.removeButton1.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/> <ResourceString bundle="cz/fidentis/analyst/gui/Bundle.properties" key="ProjectTopComp.removeButton1.text" replaceFormat="org.openide.util.NbBundle.getMessage({sourceFileName}.class, &quot;{key}&quot;)"/>
</Property> </Property>
</Properties> </Properties>
<Events>
<EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="removeButton1MouseClicked"/>
</Events>
<Constraints> <Constraints>
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription"> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout" value="org.netbeans.modules.form.compat2.layouts.DesignGridBagLayout$GridBagConstraintsDescription">
<GridBagConstraints gridX="1" gridY="0" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="16" insetsLeft="22" insetsBottom="13" insetsRight="4" anchor="18" weightX="0.0" weightY="0.0"/> <GridBagConstraints gridX="1" gridY="0" gridWidth="1" gridHeight="1" fill="0" ipadX="0" ipadY="0" insetsTop="16" insetsLeft="22" insetsBottom="13" insetsRight="4" anchor="18" weightX="0.0" weightY="0.0"/>
......
...@@ -15,7 +15,6 @@ import cz.fidentis.analyst.face.HumanFace; ...@@ -15,7 +15,6 @@ import cz.fidentis.analyst.face.HumanFace;
import cz.fidentis.analyst.mesh.io.ModelFileFilter; import cz.fidentis.analyst.mesh.io.ModelFileFilter;
import java.awt.Dimension; import java.awt.Dimension;
import java.io.File; import java.io.File;
import java.io.IOException;
import javax.swing.ImageIcon; import javax.swing.ImageIcon;
import javax.swing.JFileChooser; import javax.swing.JFileChooser;
import javax.swing.JOptionPane; import javax.swing.JOptionPane;
...@@ -52,6 +51,9 @@ public final class ProjectTopComp extends TopComponent { ...@@ -52,6 +51,9 @@ public final class ProjectTopComp extends TopComponent {
private Project project; private Project project;
/**
* Creates new ProjectTopComp, initializes new project
*/
public ProjectTopComp() { public ProjectTopComp() {
project = new Project(); project = new Project();
initComponents(); initComponents();
...@@ -139,6 +141,11 @@ public final class ProjectTopComp extends TopComponent { ...@@ -139,6 +141,11 @@ public final class ProjectTopComp extends TopComponent {
removeButton1.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N removeButton1.setFont(new java.awt.Font("Tahoma", 0, 12)); // NOI18N
org.openide.awt.Mnemonics.setLocalizedText(removeButton1, org.openide.util.NbBundle.getMessage(ProjectTopComp.class, "ProjectTopComp.removeButton1.text")); // NOI18N org.openide.awt.Mnemonics.setLocalizedText(removeButton1, org.openide.util.NbBundle.getMessage(ProjectTopComp.class, "ProjectTopComp.removeButton1.text")); // NOI18N
removeButton1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseClicked(java.awt.event.MouseEvent evt) {
removeButton1MouseClicked(evt);
}
});
gridBagConstraints = new java.awt.GridBagConstraints(); gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1; gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 0; gridBagConstraints.gridy = 0;
...@@ -213,11 +220,25 @@ public final class ProjectTopComp extends TopComponent { ...@@ -213,11 +220,25 @@ public final class ProjectTopComp extends TopComponent {
add(jPanel1, java.awt.BorderLayout.CENTER); add(jPanel1, java.awt.BorderLayout.CENTER);
}// </editor-fold>//GEN-END:initComponents }// </editor-fold>//GEN-END:initComponents
/**
*
* @param evt starts function for loading model
*/
private void addButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_addButton1MouseClicked private void addButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_addButton1MouseClicked
loadModel(); loadModel();
}//GEN-LAST:event_addButton1MouseClicked }//GEN-LAST:event_addButton1MouseClicked
/**
* TEMP. behavior, remove button will be removing selected secondary face later
* @param evt Removes primary face
*/
private void removeButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_removeButton1MouseClicked
if (this.project.getPrimaryFace() != null) {
this.project.removePrimaryFace();
jLabel1.setText("");
}
}//GEN-LAST:event_removeButton1MouseClicked
// Variables declaration - do not modify//GEN-BEGIN:variables // Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton addButton1; private javax.swing.JButton addButton1;
private javax.swing.JButton analyzeButton1; private javax.swing.JButton analyzeButton1;
...@@ -297,8 +318,8 @@ public final class ProjectTopComp extends TopComponent { ...@@ -297,8 +318,8 @@ public final class ProjectTopComp extends TopComponent {
HumanFace loadedFace; HumanFace loadedFace;
loadedFace = new HumanFace(new File (file.getPath())); loadedFace = new HumanFace(new File (file.getPath()));
this.project.setPrimaryFace(loadedFace); this.project.setPrimaryFace(loadedFace);
jLabel1.setText("Loaded"); jLabel1.setText(file.getName());
} catch (IOException e) { } catch (Exception e) {
System.out.println(e.getMessage()); System.out.println(e.getMessage());
JOptionPane.showMessageDialog(this, "File doesn't contain any model", "Model is not loaded.", JOptionPane.showMessageDialog(this, "File doesn't contain any model", "Model is not loaded.",
0, new ImageIcon(getClass().getResource("/notLoadedModel.png"))); 0, new ImageIcon(getClass().getResource("/notLoadedModel.png")));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment