Normand Briere
2019-07-19 e79247ef52a0bbb3864d46bb1e2c716005b3ecf3
Move XYZ panel + icons.
5 files modified
12 files added
170 ■■■■ changed files
BoundaryRep.java 2 ●●● patch | view | raw | blame | history
GroupEditor.java 74 ●●●●● patch | view | raw | blame | history
ObjEditor.java 90 ●●●● patch | view | raw | blame | history
Object3D.java 2 ●●● patch | view | raw | blame | history
cFileSystemModel.java 2 ●●● patch | view | raw | blame | history
icons/XYZ.png patch | view | raw | blame | history
icons/XYZ100.png patch | view | raw | blame | history
icons/XYZ70.png patch | view | raw | blame | history
icons/info.png patch | view | raw | blame | history
icons/material.gfd patch | view | raw | blame | history
icons/material.png patch | view | raw | blame | history
icons/material600.png patch | view | raw | blame | history
icons/material760.png patch | view | raw | blame | history
icons/openwindow-200.png patch | view | raw | blame | history
icons/openwindow.png patch | view | raw | blame | history
icons/primitives.png patch | view | raw | blame | history
icons/primitives512.png patch | view | raw | blame | history
BoundaryRep.java
....@@ -4001,7 +4001,7 @@
40014001 NormalGenerator ng;
40024002
40034003 if (crease)
4004
- ng = new NormalGenerator(Math.PI/6); // default is 44 degrees (or Math.PI/3); // /4);
4004
+ ng = new NormalGenerator(Math.PI/4); // default is 44 degrees (or Math.PI/3); // /4);
40054005 else
40064006 ng = new NormalGenerator(Math.PI); // (Math.PI / 3); // /4);
40074007
GroupEditor.java
....@@ -206,8 +206,8 @@
206206 // pasteExpandItem = menu.add(new MenuItem("Paste expand"));
207207 // pasteExpandItem.addActionListener(this);
208208 menu.add("-");
209
- clearItem = menu.add(new MenuItem("Clear"));
210
- clearItem.addActionListener(this);
209
+ deleteItem = menu.add(new MenuItem("Delete"));
210
+ deleteItem.addActionListener(this);
211211
212212 if (Globals.ADVANCED)
213213 {
....@@ -433,7 +433,7 @@
433433 genNormalsMESHItem.addActionListener(this);
434434 if (Globals.ADVANCED)
435435 {
436
- genNormalsMINEItem = menu.add(new MenuItem("My Normals"));
436
+ genNormalsMINEItem = menu.add(new MenuItem("Stitch Normals"));
437437 genNormalsMINEItem.addActionListener(this);
438438 }
439439 stripifyItem = menu.add(new MenuItem("Stripify"));
....@@ -685,27 +685,28 @@
685685
686686 //oe.toolbarPanel.add(new JSeparator(SwingConstants.VERTICAL));
687687
688
- oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
689
- twoButton.setToolTipText("Show center view only");
690
- twoButton.addActionListener(this);
691
- this.fullscreenLayout = twoButton;
692
-
693688 oe.toolbarPanel.add(fourButton = new cButton("-||", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
694689 fourButton.addActionListener(this);
695690 fourButton.setToolTipText("Show left panel only");
691
+
692
+ oe.toolbarPanel.add(twoButton = new cButton("|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
693
+ twoButton.setToolTipText("Show right view only");
694
+ twoButton.addActionListener(this);
695
+ this.fullscreenLayout = twoButton;
696
+
696697 oe.toolbarPanel.add(sixButton = new cButton("-|-|", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
697
- sixButton.setToolTipText("2-column layout left");
698
+ sixButton.setToolTipText("Show left and right");
698699 sixButton.addActionListener(this);
699
- oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
700
- threeButton.setToolTipText("2-column layout right");
701
- threeButton.addActionListener(this);
702
- oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
703
- sevenButton.setToolTipText("3-column layout");
704
- sevenButton.addActionListener(this);
700
+// oe.toolbarPanel.add(threeButton = new cButton("|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
701
+// threeButton.setToolTipText("2-column layout right");
702
+// threeButton.addActionListener(this);
703
+// oe.toolbarPanel.add(sevenButton = new cButton("-|-|-", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
704
+// sevenButton.setToolTipText("3-column layout");
705
+// sevenButton.addActionListener(this);
705706 //
706707
707
- oe.toolbarPanel.add(rootButton = GetButton("icons/write.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
708
- rootButton.setToolTipText("Edit selection in new tab");
708
+ oe.toolbarPanel.add(rootButton = GetButton("icons/openwindow.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
709
+ rootButton.setToolTipText("Open selection in new tab");
709710 rootButton.addActionListener(this);
710711
711712 oe.toolbarPanel.add(closeButton = GetButton("icons/close-icon.png", !Grafreed.NIMBUSLAF)); //, oe.aConstraints);
....@@ -871,7 +872,7 @@
871872 dgr.addDragGestureListener(this);
872873 }catch(Exception e) {}
873874 */
874
- radio.layout = sevenButton;
875
+ radio.layout = sixButton; // sevenButton;
875876 oe.toolbarPanel.add(radioPanel); //, oe.aConstraints);
876877 }
877878
....@@ -1013,7 +1014,7 @@
10131014 }
10141015
10151016 radioButton.SetObject(obj);
1016
- radioButton.layout = sevenButton;
1017
+ radioButton.layout = sixButton; // sevenButton;
10171018 radioButton.SetCamera(cameraView.renderCamera, false);
10181019 radioButton.addActionListener(this);
10191020 radioPanel.add(radioButton);
....@@ -1692,6 +1693,16 @@
16921693 listUI.remove(i);
16931694 }
16941695 }
1696
+ }
1697
+
1698
+ private void EditElement(Object3D elem, boolean newWindow)
1699
+ {
1700
+ // if (!(elem instanceof Composite))
1701
+ // newWindow = false;
1702
+ listUI.add(elem);
1703
+ elem.openEditWindow(this, newWindow); //, false);
1704
+ System.out.println("edit : " + elem);
1705
+ elem.editWindow.refreshContents(true); // ? new
16951706 }
16961707
16971708 /**
....@@ -2658,7 +2669,7 @@
26582669 {
26592670 StepAll();
26602671 } else
2661
- if (source == clearItem) // || event.getSource() == clearButton)
2672
+ if (source == deleteItem) // || event.getSource() == clearButton)
26622673 {
26632674 //int indices[] = jList.getSelectedIndices();
26642675 //for (int i = indices.length - 1; i >= 0; i--)
....@@ -3553,10 +3564,10 @@
35533564 radio.layout.doClick();
35543565
35553566 ClearUnpinned();
3556
- Grafreed.Assert(group != null);
3557
- Grafreed.Assert(group.selection != null);
3558
- SetPinStates(group.selection.size() > 0);
3559
- if (group.selection.size() == 1)
3567
+ //Grafreed.Assert(group != null);
3568
+ //Grafreed.Assert(group.selection != null);
3569
+ SetPinStates(group.selection == null || group.selection.size() > 0);
3570
+ if (group.selection == null || group.selection.size() == 1)
35603571 EditSelection(false);
35613572 keepparent = group.parent;
35623573 // PARENT = NULL or not???
....@@ -4627,6 +4638,12 @@
46274638
46284639 void EditSelection(boolean newWindow)
46294640 {
4641
+ if (group.selection == null)
4642
+ {
4643
+ EditElement(group, newWindow); // ? new
4644
+ return;
4645
+ }
4646
+
46304647 // aConstraints.gridy = 0;
46314648 for (int i=0; i<group.selection.size(); i++)
46324649 {
....@@ -4637,12 +4654,7 @@
46374654 Object3D elem = (Object3D)group.selection.elementAt(i);
46384655 if(elem != group || !newWindow)
46394656 {
4640
- // if (!(elem instanceof Composite))
4641
- // newWindow = false;
4642
- listUI.add(elem);
4643
- elem.openEditWindow(this, newWindow); //, false);
4644
- System.out.println("edit : " + elem);
4645
- elem.editWindow.refreshContents(true); // ? new
4657
+ EditElement(elem, newWindow); // ? new
46464658 }
46474659 }
46484660 }
....@@ -5695,7 +5707,7 @@
56955707 private MenuItem pasteLinkItem;
56965708 private MenuItem pasteCloneItem;
56975709 private MenuItem pasteExpandItem;
5698
- private MenuItem clearItem;
5710
+ private MenuItem deleteItem;
56995711 private MenuItem clearAllItem;
57005712 private MenuItem genUVItem;
57015713 private MenuItem genNormalsMESHItem;
ObjEditor.java
....@@ -44,61 +44,47 @@
4444
4545 cButton GetButton(String name, boolean border)
4646 {
47
- try
48
- {
49
- ImageIcon icon = GetIcon(name);
50
- return new cButton(icon, border);
51
- }
52
- catch (Exception e)
53
- {
54
- return new cButton(name, border);
55
- }
47
+ ImageIcon icon = GetIcon(name);
48
+ return new cButton(icon, border);
5649 }
5750
5851 cToggleButton GetToggleButton(String name, boolean border)
5952 {
60
- try
61
- {
62
- ImageIcon icon = GetIcon(name);
63
- return new cToggleButton(icon, border);
64
- }
65
- catch (Exception e)
66
- {
67
- return new cToggleButton(name, border);
68
- }
53
+ ImageIcon icon = GetIcon(name);
54
+ return new cToggleButton(icon, border);
6955 }
7056
7157 cCheckBox GetCheckBox(String name, boolean border)
7258 {
59
+ ImageIcon icon = GetIcon(name);
60
+ return new cCheckBox(icon, border);
61
+ }
62
+
63
+ private ImageIcon GetIcon(String name)
64
+ {
7365 try
7466 {
75
- ImageIcon icon = GetIcon(name);
76
- return new cCheckBox(icon, border);
67
+ BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name));
68
+
69
+ if (image.getWidth() != 24 && image.getHeight() != 24)
70
+ {
71
+ BufferedImage resized = new BufferedImage(24, 24, image.getType());
72
+ Graphics2D g = resized.createGraphics();
73
+ g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
74
+ //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
75
+ g.drawImage(image, 0, 0, 24, 24, 0, 0, image.getWidth(), image.getHeight(), null);
76
+ g.dispose();
77
+
78
+ image = resized;
79
+ }
80
+
81
+ javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image);
82
+ return icon;
7783 }
7884 catch (Exception e)
7985 {
80
- return new cCheckBox(name, border);
86
+ return null;
8187 }
82
- }
83
-
84
- private ImageIcon GetIcon(String name) throws IOException
85
- {
86
- BufferedImage image = javax.imageio.ImageIO.read(getClass().getClassLoader().getResourceAsStream(name));
87
-
88
- if (image.getWidth() != 24 && image.getHeight() != 24)
89
- {
90
- BufferedImage resized = new BufferedImage(24, 24, image.getType());
91
- Graphics2D g = resized.createGraphics();
92
- g.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
93
- //g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
94
- g.drawImage(image, 0, 0, 24, 24, 0, 0, image.getWidth(), image.getHeight(), null);
95
- g.dispose();
96
-
97
- image = resized;
98
- }
99
-
100
- javax.swing.ImageIcon icon = new javax.swing.ImageIcon(image);
101
- return icon;
10288 }
10389
10490 // SCRIPT
....@@ -437,11 +423,12 @@
437423
438424 toolbarPanel = new JPanel();
439425 toolbarPanel.setName("Toolbar");
426
+
440427 treePanel = new cGridBag();
441428 treePanel.setName("Tree");
442429
443430 editPanel = new cGridBag().setVertical(true);
444
- editPanel.setName("Edit");
431
+ //editPanel.setName("Edit");
445432
446433 ctrlPanel = new cGridBag().setVertical(false); // new GridBagLayout());
447434
....@@ -450,10 +437,10 @@
450437 editPanel.add(ctrlPanel);
451438
452439 toolboxPanel = new cGridBag().setVertical(false);
453
- toolboxPanel.setName("Toolbox");
440
+ //toolboxPanel.setName("Toolbox");
454441
455442 materialPanel = new cGridBag().setVertical(true);
456
- materialPanel.setName("Material");
443
+ //materialPanel.setName("Material");
457444
458445 /*JTextPane*/
459446 infoarea = createTextPane();
....@@ -461,6 +448,7 @@
461448
462449 infoarea.setEditable(true);
463450 SetText();
451
+
464452 // infoarea.setFont(infoarea.getFont().deriveFont(10, 14f));
465453 // infoarea.setOpaque(false);
466454 // //infoarea.setForeground(textcolor);
....@@ -468,7 +456,7 @@
468456 // TEXTAREA infoarea.setWrapStyleWord(true);
469457 infoPanel = new JScrollPane(infoarea, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER); //AS_NEEDED);
470458 infoPanel.setPreferredSize(new Dimension(1, 1));
471
- infoPanel.setName("Info");
459
+ //infoPanel.setName("Info");
472460 //infoPanel.setLayout(new BorderLayout());
473461 //infoPanel.add(createTextPane());
474462
....@@ -1492,6 +1480,7 @@
14921480 XYZPanel.addComponent(/*BorderLayout.SOUTH,*/sideView); // Scroll);
14931481 XYZPanel.addComponent(/*BorderLayout.CENTER,*/frontView); // Scroll);
14941482 XYZPanel.addComponent(/*BorderLayout.NORTH,*/topView); // Scroll);
1483
+ //XYZPanel.setName("XYZ");
14951484
14961485 /*
14971486 gridPanel = new JPanel(); //new BorderLayout());
....@@ -1529,16 +1518,23 @@
15291518 //JScrollPane tmp = new JScrollPane(ctrlPanel, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
15301519 //tmp.setName("Edit");
15311520 objectPanel.add(materialPanel);
1521
+ objectPanel.setIconAt(0, GetIcon("icons/material.png"));
15321522 // JPanel north = new JPanel(new BorderLayout());
15331523 // north.setName("Edit");
15341524 // north.add(ctrlPanel, BorderLayout.NORTH);
15351525 // objectPanel.add(north);
15361526 objectPanel.add(editPanel);
1527
+ objectPanel.setIconAt(1, GetIcon("icons/write.png"));
15371528
15381529 //if (Globals.ADVANCED)
15391530 objectPanel.add(infoPanel);
1531
+ objectPanel.setIconAt(2, GetIcon("icons/info.png"));
1532
+
1533
+ objectPanel.add(XYZPanel);
1534
+ objectPanel.setIconAt(3, GetIcon("icons/XYZ.png"));
15401535
15411536 objectPanel.add(toolboxPanel);
1537
+ objectPanel.setIconAt(4, GetIcon("icons/primitives.png"));
15421538
15431539 /*
15441540 aConstraints.gridx = 0;
....@@ -1559,7 +1555,7 @@
15591555 scrollpane.addMouseWheelListener(this); // Default not fast enough
15601556
15611557 /*JTabbedPane*/ scenePanel = new cGridBag();
1562
- scenePanel.preferredWidth = 6;
1558
+ scenePanel.preferredWidth = 5;
15631559
15641560 JTabbedPane tabbedPane = new JTabbedPane();
15651561 tabbedPane.add(scrollpane);
....@@ -1637,7 +1633,7 @@
16371633 bigThree = new cGridBag();
16381634 bigThree.addComponent(scenePanel);
16391635 bigThree.addComponent(centralPanel);
1640
- bigThree.addComponent(XYZPanel);
1636
+ //bigThree.addComponent(XYZPanel);
16411637
16421638 // // SIDE EFFECT!!!
16431639 // aConstraints.gridx = 0;
Object3D.java
....@@ -3117,7 +3117,7 @@
31173117 {
31183118 if (bRep != null)
31193119 {
3120
- bRep.GenerateNormalsMINE();
3120
+ bRep.MergeNormals(); //.GenerateNormalsMINE();
31213121 Touch();
31223122 }
31233123 }
cFileSystemModel.java
....@@ -118,7 +118,7 @@
118118 // Small icons
119119 String valueTruncated = valueString.substring(0, valueString.length()-4);
120120
121
- System.out.println(valueTruncated);
121
+ //System.out.println("valueTruncated = " + valueTruncated);
122122
123123 javax.swing.ImageIcon rendererIcon = icons.get(valueTruncated);
124124
icons/XYZ.png
Binary files differ
icons/XYZ100.png
Binary files differ
icons/XYZ70.png
Binary files differ
icons/info.png
Binary files differ
icons/material.gfd
Binary files differ
icons/material.png
Binary files differ
icons/material600.png
Binary files differ
icons/material760.png
Binary files differ
icons/openwindow-200.png
Binary files differ
icons/openwindow.png
Binary files differ
icons/primitives.png
Binary files differ
icons/primitives512.png
Binary files differ