Loading GUI/src/main/java/cz/fidentis/analyst/gui/ProjectTopComp.java +0 −2 Original line number Diff line number Diff line Loading @@ -290,8 +290,6 @@ public final class ProjectTopComp extends TopComponent { .setAcceptAllFileFilterUsed(true) .showOpenDialog(); System.out.println("AAA"); if (file== null) { System.out.print("No file chosen."); } else { Loading GUI/src/main/java/cz/fidentis/analyst/gui/Wireframe.javadeleted 100644 → 0 +0 −76 Original line number Diff line number Diff line /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package cz.fidentis.analyst.gui; import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JLabel; import org.openide.awt.ActionID; import org.openide.awt.ActionReference; import org.openide.awt.ActionReferences; import org.openide.awt.ActionRegistration; import org.openide.util.NbBundle.Messages; /** * * @author Richard Pajerský * * Wireframe button in toolbar and Edit */ @ActionID( category = "Edit", id = "cz.fidentis.analyst.gui.Wireframe" ) @ActionRegistration( iconBase = "wireframe16x16.png", displayName = "#CTL_Wireframe" ) @ActionReferences({ @ActionReference(path = "Menu/Edit", position = 2600, separatorBefore = 2550), @ActionReference(path = "Toolbars/File", position = 300) }) @Messages("CTL_Wireframe=Wireframe") public final class Wireframe implements ActionListener { /** * Flag for whether model should be displayed as wire-frame */ boolean wiredModelClicked = false; @Override public void actionPerformed(ActionEvent e) { if (wiredModelClicked) { //resetLabelBackround(wiredModelButton); wiredModelClicked = false; Canvas.setDrawWired(wiredModelClicked); /*canvasSymmetryPanel.setDrawWired(wiredModelClicked); canvasModelView.setDrawWired(wiredModelClicked);*/ } else { //setLabelBackround(wiredModelButton); wiredModelClicked = true; Canvas.setDrawWired(wiredModelClicked); /*canvasSymmetryPanel.setDrawWired(wiredModelClicked); canvasModelView.setDrawWired(wiredModelClicked);*/ } } /** * Changes backround of labels to darker green color * @param jl label of which backround changes */ private void setLabelBackround(JLabel jl) { jl.setBackground(new Color(11,56,49)); } /** * Changes backround of the label back to original * @param jl label of which backround is return to original */ private void resetLabelBackround(JLabel jl) { jl.setBackground(new Color(20,114,105)); } } GUI/src/main/java/cz/fidentis/analyst/gui/canvas/Canvas.form +0 −38 Original line number Diff line number Diff line Loading @@ -226,44 +226,6 @@ </Constraint> </Constraints> </Component> <Component class="javax.swing.JLabel" name="whiteBackroundButton"> <Properties> <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> <Image iconType="3" name="/whiteBackroundCanvas.png"/> </Property> <Property name="toolTipText" type="java.lang.String" value="White backround"/> <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> <Color id="Hand Cursor"/> </Property> </Properties> <Events> <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="whiteBackroundButtonMouseClicked"/> </Events> <Constraints> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> <AbsoluteConstraints x="50" y="130" width="-1" height="-1"/> </Constraint> </Constraints> </Component> <Component class="javax.swing.JLabel" name="blackBackroundButton"> <Properties> <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> <Image iconType="3" name="/blackBackroundCanvas.png"/> </Property> <Property name="toolTipText" type="java.lang.String" value="Dark background"/> <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> <Color id="Hand Cursor"/> </Property> </Properties> <Events> <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="blackBackroundButtonMouseClicked"/> </Events> <Constraints> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> <AbsoluteConstraints x="50" y="190" width="-1" height="-1"/> </Constraint> </Constraints> </Component> <Container class="javax.swing.JPanel" name="jPanel1"> <Properties> <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> Loading GUI/src/main/java/cz/fidentis/analyst/gui/canvas/Canvas.java +0 −40 Original line number Diff line number Diff line Loading @@ -169,8 +169,6 @@ public class Canvas extends javax.swing.JPanel { plusNavigationButton = new javax.swing.JButton(); jLabel1 = new javax.swing.JLabel(); rightNavigationButton1 = new javax.swing.JButton(); whiteBackroundButton = new javax.swing.JLabel(); blackBackroundButton = new javax.swing.JLabel(); jPanel1 = new javax.swing.JPanel(); setBackground(new java.awt.Color(0, 0, 0)); Loading Loading @@ -313,28 +311,6 @@ public class Canvas extends javax.swing.JPanel { jLayeredPane1.add(rightNavigationButton1); rightNavigationButton1.setBounds(90, 40, 30, 30); whiteBackroundButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/whiteBackroundCanvas.png"))); // NOI18N whiteBackroundButton.setToolTipText("White backround"); whiteBackroundButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); whiteBackroundButton.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { whiteBackroundButtonMouseClicked(evt); } }); jLayeredPane1.add(whiteBackroundButton); whiteBackroundButton.setBounds(50, 130, 56, 56); blackBackroundButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/blackBackroundCanvas.png"))); // NOI18N blackBackroundButton.setToolTipText("Dark background"); blackBackroundButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); blackBackroundButton.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { blackBackroundButtonMouseClicked(evt); } }); jLayeredPane1.add(blackBackroundButton); blackBackroundButton.setBounds(50, 190, 56, 56); jPanel1.setBackground(new java.awt.Color(0, 0, 0)); jPanel1.setLayout(new java.awt.BorderLayout()); jLayeredPane1.add(jPanel1); Loading Loading @@ -427,22 +403,7 @@ public class Canvas extends javax.swing.JPanel { resetButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resetButton.png"))); }//GEN-LAST:event_resetButtonMouseExited private void whiteBackroundButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_whiteBackroundButtonMouseClicked sceneRenderer.setBrightBackground(); renderScene(); whiteBackroundButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/whiteBackroundCanvasPressed.png"))); blackBackroundButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/blackBackroundCanvas.png"))); }//GEN-LAST:event_whiteBackroundButtonMouseClicked private void blackBackroundButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_blackBackroundButtonMouseClicked sceneRenderer.setDarkBackground(); renderScene(); whiteBackroundButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/whiteBackroundCanvas.png"))); blackBackroundButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/blackBackroundCanvasPressed.png"))); }//GEN-LAST:event_blackBackroundButtonMouseClicked // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel blackBackroundButton; private javax.swing.JButton downNavigationButton; private javax.swing.JLabel jLabel1; private javax.swing.JLayeredPane jLayeredPane1; Loading @@ -453,6 +414,5 @@ public class Canvas extends javax.swing.JPanel { private javax.swing.JLabel resetButton; private javax.swing.JButton rightNavigationButton1; private javax.swing.JButton upNavigationButton; private javax.swing.JLabel whiteBackroundButton; // End of variables declaration//GEN-END:variables } GUI/src/main/java/cz/fidentis/analyst/gui/core/RenderingToolBar.java 0 → 100644 +121 −0 Original line number Diff line number Diff line package cz.fidentis.analyst.gui.core; import com.jogamp.opengl.GL2; import cz.fidentis.analyst.gui.canvas.Canvas; import cz.fidentis.analyst.gui.scene.DrawableMesh; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.net.URL; import java.util.HashMap; import java.util.Map; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JToolBar; import javax.swing.SwingConstants; import org.openide.awt.Mnemonics; /** * Rendering toolbar. * * @author Radek Oslejsek */ public class RenderingToolBar extends JToolBar { public static final int WIDTH = 40; public enum Button { WIREFRAME, BACKGROUND; @Override public String toString() { switch (this) { case WIREFRAME: return "wireframe"; case BACKGROUND: return "background"; default: return toString(); } } } private final Map<Button, JButton> buttons = new HashMap<>(); private final Canvas canvas; public RenderingToolBar(Canvas canvas) { this.canvas = canvas; initToolBar(); initButtons(); initEvents(); } private void initToolBar() { setOrientation(javax.swing.SwingConstants.VERTICAL); setRollover(true); setFloatable(false); } private void initButtons() { for (Button butEnum: Button.values()) { JButton button = new JButton(); URL icon = getClass().getResource("/" + butEnum + "32x32.png"); if (icon != null) { button.setIcon(new ImageIcon(getClass().getResource("/" + butEnum + "32x32.png"))); } Mnemonics.setLocalizedText(button, org.openide.util.NbBundle.getMessage(RenderingToolBar.class, "RenderingToolBar." + butEnum +".text")); button.setFocusable(false); button.setHorizontalTextPosition(SwingConstants.CENTER); button.setVerticalTextPosition(SwingConstants.BOTTOM); buttons.put(butEnum, button); add(button); } } private void initEvents() { for (Button butEnum: Button.values()) { JButton button = buttons.get(butEnum); button.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent evt) { switch (butEnum) { case WIREFRAME: wireframeButtonClicked(evt); break; case BACKGROUND: backgroundButtonClicked(evt); break; } } }); } } private void wireframeButtonClicked(MouseEvent evt) { boolean on = buttons.get(Button.WIREFRAME).isSelected(); for (DrawableMesh dm: canvas.getScene().getDrawables()) { if (on) { dm.setRenderMode(GL2.GL_FILL); buttons.get(Button.WIREFRAME).setSelected(false); } else { dm.setRenderMode(GL2.GL_LINE); buttons.get(Button.WIREFRAME).setSelected(true); } } canvas.renderScene(); } private void backgroundButtonClicked(MouseEvent evt) { boolean on = buttons.get(Button.BACKGROUND).isSelected(); if (on) { canvas.getSceneRenderer().setDarkBackground(); buttons.get(Button.BACKGROUND).setSelected(false); } else { canvas.getSceneRenderer().setBrightBackground(); buttons.get(Button.BACKGROUND).setSelected(true); } canvas.renderScene(); } } Loading
GUI/src/main/java/cz/fidentis/analyst/gui/ProjectTopComp.java +0 −2 Original line number Diff line number Diff line Loading @@ -290,8 +290,6 @@ public final class ProjectTopComp extends TopComponent { .setAcceptAllFileFilterUsed(true) .showOpenDialog(); System.out.println("AAA"); if (file== null) { System.out.print("No file chosen."); } else { Loading
GUI/src/main/java/cz/fidentis/analyst/gui/Wireframe.javadeleted 100644 → 0 +0 −76 Original line number Diff line number Diff line /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ package cz.fidentis.analyst.gui; import java.awt.Color; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.JLabel; import org.openide.awt.ActionID; import org.openide.awt.ActionReference; import org.openide.awt.ActionReferences; import org.openide.awt.ActionRegistration; import org.openide.util.NbBundle.Messages; /** * * @author Richard Pajerský * * Wireframe button in toolbar and Edit */ @ActionID( category = "Edit", id = "cz.fidentis.analyst.gui.Wireframe" ) @ActionRegistration( iconBase = "wireframe16x16.png", displayName = "#CTL_Wireframe" ) @ActionReferences({ @ActionReference(path = "Menu/Edit", position = 2600, separatorBefore = 2550), @ActionReference(path = "Toolbars/File", position = 300) }) @Messages("CTL_Wireframe=Wireframe") public final class Wireframe implements ActionListener { /** * Flag for whether model should be displayed as wire-frame */ boolean wiredModelClicked = false; @Override public void actionPerformed(ActionEvent e) { if (wiredModelClicked) { //resetLabelBackround(wiredModelButton); wiredModelClicked = false; Canvas.setDrawWired(wiredModelClicked); /*canvasSymmetryPanel.setDrawWired(wiredModelClicked); canvasModelView.setDrawWired(wiredModelClicked);*/ } else { //setLabelBackround(wiredModelButton); wiredModelClicked = true; Canvas.setDrawWired(wiredModelClicked); /*canvasSymmetryPanel.setDrawWired(wiredModelClicked); canvasModelView.setDrawWired(wiredModelClicked);*/ } } /** * Changes backround of labels to darker green color * @param jl label of which backround changes */ private void setLabelBackround(JLabel jl) { jl.setBackground(new Color(11,56,49)); } /** * Changes backround of the label back to original * @param jl label of which backround is return to original */ private void resetLabelBackround(JLabel jl) { jl.setBackground(new Color(20,114,105)); } }
GUI/src/main/java/cz/fidentis/analyst/gui/canvas/Canvas.form +0 −38 Original line number Diff line number Diff line Loading @@ -226,44 +226,6 @@ </Constraint> </Constraints> </Component> <Component class="javax.swing.JLabel" name="whiteBackroundButton"> <Properties> <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> <Image iconType="3" name="/whiteBackroundCanvas.png"/> </Property> <Property name="toolTipText" type="java.lang.String" value="White backround"/> <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> <Color id="Hand Cursor"/> </Property> </Properties> <Events> <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="whiteBackroundButtonMouseClicked"/> </Events> <Constraints> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> <AbsoluteConstraints x="50" y="130" width="-1" height="-1"/> </Constraint> </Constraints> </Component> <Component class="javax.swing.JLabel" name="blackBackroundButton"> <Properties> <Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor"> <Image iconType="3" name="/blackBackroundCanvas.png"/> </Property> <Property name="toolTipText" type="java.lang.String" value="Dark background"/> <Property name="cursor" type="java.awt.Cursor" editor="org.netbeans.modules.form.editors2.CursorEditor"> <Color id="Hand Cursor"/> </Property> </Properties> <Events> <EventHandler event="mouseClicked" listener="java.awt.event.MouseListener" parameters="java.awt.event.MouseEvent" handler="blackBackroundButtonMouseClicked"/> </Events> <Constraints> <Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout" value="org.netbeans.modules.form.compat2.layouts.DesignAbsoluteLayout$AbsoluteConstraintsDescription"> <AbsoluteConstraints x="50" y="190" width="-1" height="-1"/> </Constraint> </Constraints> </Component> <Container class="javax.swing.JPanel" name="jPanel1"> <Properties> <Property name="background" type="java.awt.Color" editor="org.netbeans.beaninfo.editors.ColorEditor"> Loading
GUI/src/main/java/cz/fidentis/analyst/gui/canvas/Canvas.java +0 −40 Original line number Diff line number Diff line Loading @@ -169,8 +169,6 @@ public class Canvas extends javax.swing.JPanel { plusNavigationButton = new javax.swing.JButton(); jLabel1 = new javax.swing.JLabel(); rightNavigationButton1 = new javax.swing.JButton(); whiteBackroundButton = new javax.swing.JLabel(); blackBackroundButton = new javax.swing.JLabel(); jPanel1 = new javax.swing.JPanel(); setBackground(new java.awt.Color(0, 0, 0)); Loading Loading @@ -313,28 +311,6 @@ public class Canvas extends javax.swing.JPanel { jLayeredPane1.add(rightNavigationButton1); rightNavigationButton1.setBounds(90, 40, 30, 30); whiteBackroundButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/whiteBackroundCanvas.png"))); // NOI18N whiteBackroundButton.setToolTipText("White backround"); whiteBackroundButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); whiteBackroundButton.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { whiteBackroundButtonMouseClicked(evt); } }); jLayeredPane1.add(whiteBackroundButton); whiteBackroundButton.setBounds(50, 130, 56, 56); blackBackroundButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/blackBackroundCanvas.png"))); // NOI18N blackBackroundButton.setToolTipText("Dark background"); blackBackroundButton.setCursor(new java.awt.Cursor(java.awt.Cursor.HAND_CURSOR)); blackBackroundButton.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseClicked(java.awt.event.MouseEvent evt) { blackBackroundButtonMouseClicked(evt); } }); jLayeredPane1.add(blackBackroundButton); blackBackroundButton.setBounds(50, 190, 56, 56); jPanel1.setBackground(new java.awt.Color(0, 0, 0)); jPanel1.setLayout(new java.awt.BorderLayout()); jLayeredPane1.add(jPanel1); Loading Loading @@ -427,22 +403,7 @@ public class Canvas extends javax.swing.JPanel { resetButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/resetButton.png"))); }//GEN-LAST:event_resetButtonMouseExited private void whiteBackroundButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_whiteBackroundButtonMouseClicked sceneRenderer.setBrightBackground(); renderScene(); whiteBackroundButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/whiteBackroundCanvasPressed.png"))); blackBackroundButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/blackBackroundCanvas.png"))); }//GEN-LAST:event_whiteBackroundButtonMouseClicked private void blackBackroundButtonMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_blackBackroundButtonMouseClicked sceneRenderer.setDarkBackground(); renderScene(); whiteBackroundButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/whiteBackroundCanvas.png"))); blackBackroundButton.setIcon(new javax.swing.ImageIcon(getClass().getResource("/blackBackroundCanvasPressed.png"))); }//GEN-LAST:event_blackBackroundButtonMouseClicked // Variables declaration - do not modify//GEN-BEGIN:variables private javax.swing.JLabel blackBackroundButton; private javax.swing.JButton downNavigationButton; private javax.swing.JLabel jLabel1; private javax.swing.JLayeredPane jLayeredPane1; Loading @@ -453,6 +414,5 @@ public class Canvas extends javax.swing.JPanel { private javax.swing.JLabel resetButton; private javax.swing.JButton rightNavigationButton1; private javax.swing.JButton upNavigationButton; private javax.swing.JLabel whiteBackroundButton; // End of variables declaration//GEN-END:variables }
GUI/src/main/java/cz/fidentis/analyst/gui/core/RenderingToolBar.java 0 → 100644 +121 −0 Original line number Diff line number Diff line package cz.fidentis.analyst.gui.core; import com.jogamp.opengl.GL2; import cz.fidentis.analyst.gui.canvas.Canvas; import cz.fidentis.analyst.gui.scene.DrawableMesh; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import java.net.URL; import java.util.HashMap; import java.util.Map; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JToolBar; import javax.swing.SwingConstants; import org.openide.awt.Mnemonics; /** * Rendering toolbar. * * @author Radek Oslejsek */ public class RenderingToolBar extends JToolBar { public static final int WIDTH = 40; public enum Button { WIREFRAME, BACKGROUND; @Override public String toString() { switch (this) { case WIREFRAME: return "wireframe"; case BACKGROUND: return "background"; default: return toString(); } } } private final Map<Button, JButton> buttons = new HashMap<>(); private final Canvas canvas; public RenderingToolBar(Canvas canvas) { this.canvas = canvas; initToolBar(); initButtons(); initEvents(); } private void initToolBar() { setOrientation(javax.swing.SwingConstants.VERTICAL); setRollover(true); setFloatable(false); } private void initButtons() { for (Button butEnum: Button.values()) { JButton button = new JButton(); URL icon = getClass().getResource("/" + butEnum + "32x32.png"); if (icon != null) { button.setIcon(new ImageIcon(getClass().getResource("/" + butEnum + "32x32.png"))); } Mnemonics.setLocalizedText(button, org.openide.util.NbBundle.getMessage(RenderingToolBar.class, "RenderingToolBar." + butEnum +".text")); button.setFocusable(false); button.setHorizontalTextPosition(SwingConstants.CENTER); button.setVerticalTextPosition(SwingConstants.BOTTOM); buttons.put(butEnum, button); add(button); } } private void initEvents() { for (Button butEnum: Button.values()) { JButton button = buttons.get(butEnum); button.addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent evt) { switch (butEnum) { case WIREFRAME: wireframeButtonClicked(evt); break; case BACKGROUND: backgroundButtonClicked(evt); break; } } }); } } private void wireframeButtonClicked(MouseEvent evt) { boolean on = buttons.get(Button.WIREFRAME).isSelected(); for (DrawableMesh dm: canvas.getScene().getDrawables()) { if (on) { dm.setRenderMode(GL2.GL_FILL); buttons.get(Button.WIREFRAME).setSelected(false); } else { dm.setRenderMode(GL2.GL_LINE); buttons.get(Button.WIREFRAME).setSelected(true); } } canvas.renderScene(); } private void backgroundButtonClicked(MouseEvent evt) { boolean on = buttons.get(Button.BACKGROUND).isSelected(); if (on) { canvas.getSceneRenderer().setDarkBackground(); buttons.get(Button.BACKGROUND).setSelected(false); } else { canvas.getSceneRenderer().setBrightBackground(); buttons.get(Button.BACKGROUND).setSelected(true); } canvas.renderScene(); } }