bprocessor-commit Mailing List for B-processor (Page 38)
Status: Pre-Alpha
Brought to you by:
henryml
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(12) |
Jul
(117) |
Aug
(151) |
Sep
(157) |
Oct
(81) |
Nov
(117) |
Dec
(119) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(183) |
Feb
(130) |
Mar
(117) |
Apr
(61) |
May
(82) |
Jun
(45) |
Jul
(149) |
Aug
(173) |
Sep
(199) |
Oct
(165) |
Nov
(107) |
Dec
(137) |
2007 |
Jan
(124) |
Feb
(58) |
Mar
(123) |
Apr
(80) |
May
(130) |
Jun
(64) |
Jul
(31) |
Aug
(42) |
Sep
(114) |
Oct
(167) |
Nov
(239) |
Dec
(200) |
2008 |
Jan
(43) |
Feb
(43) |
Mar
(4) |
Apr
(9) |
May
(5) |
Jun
(1) |
Jul
(3) |
Aug
(3) |
Sep
(13) |
Oct
(9) |
Nov
(12) |
Dec
|
2009 |
Jan
|
Feb
(20) |
Mar
(7) |
Apr
(12) |
May
(34) |
Jun
(72) |
Jul
|
Aug
(3) |
Sep
(31) |
Oct
(2) |
Nov
(8) |
Dec
(4) |
2010 |
Jan
(5) |
Feb
(32) |
Mar
(8) |
Apr
(7) |
May
(36) |
Jun
|
Jul
(11) |
Aug
(15) |
Sep
(7) |
Oct
(2) |
Nov
(13) |
Dec
(80) |
2011 |
Jan
|
Feb
|
Mar
(8) |
Apr
(12) |
May
(32) |
Jun
(9) |
Jul
(5) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
(8) |
2012 |
Jan
|
Feb
|
Mar
(3) |
Apr
(5) |
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(22) |
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Michael L. <he...@us...> - 2007-11-21 09:21:17
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18875/src/net/sourceforge/bprocessor/gl Modified Files: Editor.java Log Message: multi/single choice selecting in space-assignment tool Index: Editor.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/Editor.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Editor.java 20 Nov 2007 14:56:46 -0000 1.5 --- Editor.java 21 Nov 2007 09:21:17 -0000 1.6 *************** *** 28,31 **** --- 28,33 ---- import java.awt.event.MouseListener; import java.awt.event.ActionListener; + import java.net.URL; + import java.util.List; import javax.media.opengl.GLCanvas; *************** *** 35,38 **** --- 37,41 ---- import javax.swing.Box; + import javax.swing.ImageIcon; import javax.swing.JColorChooser; import javax.swing.JComboBox; *************** *** 45,48 **** --- 48,52 ---- import javax.swing.JMenuItem; import javax.swing.JPopupMenu; + import javax.swing.JToggleButton; import javax.swing.SwingConstants; import javax.swing.SwingUtilities; *************** *** 57,60 **** --- 61,69 ---- /** The logger */ private static Logger log = Logger.getLogger(Editor.class); + + /** + * + */ + private static boolean multi; /** GL canvas */ *************** *** 69,73 **** /** the length parameter */ private LengthField lengthField; ! /** The label and combobox for the reality factor */ private FactorBox factor; --- 78,85 ---- /** the length parameter */ private LengthField lengthField; ! ! private Box controlarea; ! private JComponent controlpanel; ! /** The label and combobox for the reality factor */ private FactorBox factor; *************** *** 79,82 **** --- 91,123 ---- private JPanel jp; + + /** + * Change value of multi + * @param value new value + */ + public static void setMulti(boolean value) { + multi = value; + } + + /** + * Returns the value of multi + * @return value of multi + */ + public static boolean isMulti() { + return multi; + } + + private void setControlPanel(JComponent panel) { + if (controlpanel != null) { + controlarea.remove(controlpanel); + controlpanel = null; + } + if (panel != null) { + controlarea.add(panel); + controlpanel = panel; + } + StatusBar.instance().content().revalidate(); + } + private JComponent createSeparator(int height) { JSeparator separator = new JSeparator(SwingConstants.VERTICAL); *************** *** 96,99 **** --- 137,158 ---- } + + private JComponent createControlPanel(List<JComponent> controls) { + Box panel = Box.createHorizontalBox(); + for (JComponent current : controls) { + panel.add(current); + panel.add(Box.createHorizontalStrut(5)); + } + return panel; + } + + private JComponent createButton(String name) { + ClassLoader cl = Thread.currentThread().getContextClassLoader(); + URL url = cl.getResource(name); + ImageIcon im = new ImageIcon(url); + JToggleButton button = new JToggleButton(im); + return button; + } + private JComponent createLengthPanel() { Box lengthpanel = Box.createVerticalBox(); *************** *** 101,104 **** --- 160,166 ---- Box lengtharea = Box.createHorizontalBox(); lengtharea.add(Box.createHorizontalGlue()); + controlarea = Box.createHorizontalBox(); + + lengtharea.add(controlarea); lengtharea.add(new JLabel("Length:")); lengtharea.add(Box.createHorizontalStrut(3)); *************** *** 179,182 **** --- 241,248 ---- tool = ToolFactory.getFactory(this).getDefault(); setTip(tool.initialTip()); + tool.prepare(); + List<JComponent> controls = tool.controls(); + JComponent panel = createControlPanel(controls); + setControlPanel(panel); view = new View(this); *************** *** 322,325 **** --- 388,394 ---- setTip(tool.initialTip()); tool.prepare(); + List<JComponent> controls = tool.controls(); + JComponent panel = createControlPanel(controls); + setControlPanel(panel); } else { log.error("[changeMode] tool was null"); |
From: Michael L. <he...@us...> - 2007-11-21 09:21:17
|
Update of /cvsroot/bprocessor/gl/src/gfx In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18875/src/gfx Added Files: multiicon.gif Log Message: multi/single choice selecting in space-assignment tool --- NEW FILE: multiicon.gif --- (This appears to be a binary file; contents omitted.) |
From: rimestad <rim...@us...> - 2007-11-20 18:25:13
|
Update of /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22900/src/net/sourceforge/bprocessor/gl/view Modified Files: GLPreviewPanel.java Log Message: quick fix of rotation Index: GLPreviewPanel.java =================================================================== RCS file: /cvsroot/bprocessor//gl/src/net/sourceforge/bprocessor/gl/view/GLPreviewPanel.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** GLPreviewPanel.java 20 Nov 2007 08:40:19 -0000 1.4 --- GLPreviewPanel.java 20 Nov 2007 18:25:08 -0000 1.5 *************** *** 153,157 **** --- 153,159 ---- gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); gl.glRenderMode(GL.GL_RENDER); + gl.glTranslated(camera.getCenter()[0], camera.getCenter()[1], camera.getCenter()[2]); gl.glRotated(5, 0, 0, 1); + gl.glTranslated(-camera.getCenter()[0], -camera.getCenter()[1], -camera.getCenter()[2]); gl.glColor3fv(View.lineColor, 0); gl.glLineWidth(1.0f); |
From: Michael L. <he...@us...> - 2007-11-20 14:56:50
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3826/src/net/sourceforge/bprocessor/gui Modified Files: StatusBar.java Log Message: refactored statusbar Index: StatusBar.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/StatusBar.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** StatusBar.java 20 Nov 2007 13:07:49 -0000 1.6 --- StatusBar.java 20 Nov 2007 14:56:49 -0000 1.7 *************** *** 80,85 **** JTextField field = new JTextField(); Dimension preferred = field.getPreferredSize(); ! Dimension maximum = new Dimension(120, preferred.height); ! field.setMaximumSize(maximum); lengtharea.add(field); lengthpanel.add(lengtharea); --- 80,84 ---- JTextField field = new JTextField(); Dimension preferred = field.getPreferredSize(); ! field.setMaximumSize(preferred); lengtharea.add(field); lengthpanel.add(lengtharea); *************** *** 109,114 **** content = Box.createHorizontalBox(); add(content, BorderLayout.CENTER); ! content.add(Box.createRigidArea(new Dimension(5, 20))); ! createContent(); } } --- 108,112 ---- content = Box.createHorizontalBox(); add(content, BorderLayout.CENTER); ! content.add(Box.createRigidArea(new Dimension(5, 32))); } } |
From: Michael L. <he...@us...> - 2007-11-20 14:56:43
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv3817/src/net/sourceforge/bprocessor/gl Modified Files: Editor.java Log Message: refactored statusbar Index: Editor.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/Editor.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Editor.java 19 Nov 2007 17:57:32 -0000 1.4 --- Editor.java 20 Nov 2007 14:56:46 -0000 1.5 *************** *** 18,21 **** --- 18,22 ---- import net.sourceforge.bprocessor.gui.GUI; import net.sourceforge.bprocessor.gui.PreviewPanel; + import net.sourceforge.bprocessor.gui.StatusBar; import java.awt.Color; *************** *** 23,27 **** import java.awt.Dimension; import java.awt.BorderLayout; - import java.awt.Font; import java.awt.event.ActionEvent; import java.awt.event.MouseEvent; --- 24,27 ---- *************** *** 34,41 **** import javax.media.opengl.GLException; ! ! import javax.swing.BorderFactory; import javax.swing.JColorChooser; import javax.swing.JComboBox; import javax.swing.JSeparator; import javax.swing.JTextField; --- 34,41 ---- import javax.media.opengl.GLException; ! import javax.swing.Box; import javax.swing.JColorChooser; import javax.swing.JComboBox; + import javax.swing.JComponent; import javax.swing.JSeparator; import javax.swing.JTextField; *************** *** 45,48 **** --- 45,49 ---- import javax.swing.JMenuItem; import javax.swing.JPopupMenu; + import javax.swing.SwingConstants; import javax.swing.SwingUtilities; import javax.swing.ToolTipManager; *************** *** 71,85 **** /** The label and combobox for the reality factor */ private FactorBox factor; ! ! private JPanel lengthPanel; private JLabel tipLabel; ! private JPanel tipPanel; ! private JPanel bottomPanel; - private JPanel jp; /** * Constuctor --- 72,142 ---- /** The label and combobox for the reality factor */ private FactorBox factor; ! ! private Box factorPanel; private JLabel tipLabel; ! private JPanel jp; ! private JComponent createSeparator(int height) { ! JSeparator separator = new JSeparator(SwingConstants.VERTICAL); ! separator.setMaximumSize(new Dimension(2, height)); ! return separator; ! } ! ! private JComponent createTipPanel() { ! Box tippanel = Box.createVerticalBox(); ! tippanel.add(Box.createRigidArea(new Dimension(360, 0))); ! Box labelarea = Box.createHorizontalBox(); ! tipLabel = new JLabel("Tip"); ! labelarea.add(tipLabel); ! labelarea.add(Box.createHorizontalGlue()); ! tippanel.add(labelarea); ! return tippanel; ! } ! ! private JComponent createLengthPanel() { ! Box lengthpanel = Box.createVerticalBox(); ! lengthpanel.add(Box.createRigidArea(new Dimension(180, 0))); ! Box lengtharea = Box.createHorizontalBox(); ! lengtharea.add(Box.createHorizontalGlue()); ! lengtharea.add(new JLabel("Length:")); ! lengtharea.add(Box.createHorizontalStrut(3)); ! lengthField = new LengthField(); ! Dimension preferred = lengthField.getPreferredSize(); ! lengthField.setMaximumSize(preferred); ! lengtharea.add(lengthField); ! lengthpanel.add(lengtharea); ! return lengthpanel; ! } ! ! private JComponent createScalePanel() { ! Box panel = Box.createVerticalBox(); ! panel.add(Box.createRigidArea(new Dimension(200, 0))); ! Box labelarea = Box.createHorizontalBox(); ! factorPanel = Box.createHorizontalBox(); ! labelarea.add(factorPanel); ! labelarea.add(Box.createHorizontalGlue()); ! panel.add(labelarea); ! panel.setMaximumSize(new Dimension(200, 32)); ! return panel; ! } + private void createStatusBar() { + Box content = StatusBar.instance().content(); + content.add(createTipPanel()); + content.add(Box.createHorizontalGlue()); + content.add(Box.createHorizontalStrut(7)); + content.add(createSeparator(18)); + content.add(Box.createHorizontalStrut(7)); + content.add(createLengthPanel()); + content.add(Box.createHorizontalStrut(7)); + content.add(createSeparator(18)); + content.add(Box.createHorizontalStrut(7)); + content.add(createScalePanel()); + content.add(Box.createHorizontalStrut(20)); + } + /** * Constuctor *************** *** 111,146 **** } ! GUI.getInstance().incrementPB(); ! ! { ! lengthPanel = new JPanel(); ! lengthPanel.setLayout(new BorderLayout()); ! lengthPanel.add(new JLabel("Length: "), BorderLayout.WEST); ! lengthField = new LengthField(); ! lengthPanel.add(lengthField, BorderLayout.CENTER); ! } factor = new FactorBox(); ! { ! tipPanel = new JPanel(); ! tipPanel.setLayout(new BorderLayout()); ! tipPanel.add(new JLabel("Tip: "), BorderLayout.WEST); ! tipLabel = new JLabel("Hello World!"); ! Font basicFont = tipLabel.getFont(); ! tipLabel.setFont(new Font(basicFont.getName(), Font.PLAIN, basicFont.getSize())); ! tipPanel.add(tipLabel, BorderLayout.CENTER); ! } ! ! { ! bottomPanel = new JPanel(); ! bottomPanel.setLayout(new BorderLayout()); ! bottomPanel.setBorder(BorderFactory.createEtchedBorder()); ! bottomPanel.add(lengthPanel, BorderLayout.NORTH); ! bottomPanel.add(new JSeparator(), BorderLayout.CENTER); ! bottomPanel.add(tipPanel, BorderLayout.SOUTH); ! } ! ! jp.add(bottomPanel, BorderLayout.SOUTH); GUI.getInstance().incrementPB(); --- 168,177 ---- } ! GUI.getInstance().incrementPB(); factor = new FactorBox(); + factor.setMaximumSize(factor.getPreferredSize()); ! createStatusBar(); GUI.getInstance().incrementPB(); *************** *** 386,391 **** */ public void disableFactor() { ! lengthPanel.remove(factor); ! lengthPanel.revalidate(); } --- 417,424 ---- */ public void disableFactor() { ! factorPanel.remove(factor); ! StatusBar.instance().content().revalidate(); ! // lengthPanel.remove(factor); ! // lengthPanel.revalidate(); } *************** *** 394,399 **** */ public void enableFactor() { ! lengthPanel.add(factor, BorderLayout.EAST); ! lengthPanel.revalidate(); } --- 427,434 ---- */ public void enableFactor() { ! factorPanel.add(factor); ! StatusBar.instance().content().revalidate(); ! // lengthPanel.add(factor, BorderLayout.EAST); ! // lengthPanel.revalidate(); } *************** *** 423,427 **** public FactorBox() { super(); ! label = new JLabel("Scale factor:"); this.add(label); items = new String[]{"1:1", "1:2", "1:5", "1:10", "1:20", "1:50", --- 458,462 ---- public FactorBox() { super(); ! label = new JLabel("Scale:"); this.add(label); items = new String[]{"1:1", "1:2", "1:5", "1:10", "1:20", "1:50", *************** *** 468,472 **** */ public LengthField() { ! super(15); } --- 503,507 ---- */ public LengthField() { ! super(7); } |
From: Michael L. <he...@us...> - 2007-11-20 13:07:48
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24942/src/net/sourceforge/bprocessor/gui Modified Files: StatusBar.java Log Message: get content Index: StatusBar.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/StatusBar.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** StatusBar.java 20 Nov 2007 12:57:11 -0000 1.5 --- StatusBar.java 20 Nov 2007 13:07:49 -0000 1.6 *************** *** 36,39 **** --- 36,47 ---- } + /** + * Returns the box containing the content of the statusbar + * @return content + */ + public Box content() { + return content; + } + private JComponent createSeparator(int height) { JSeparator separator = new JSeparator(SwingConstants.VERTICAL); |
From: Michael L. <he...@us...> - 2007-11-20 12:57:08
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21047/src/net/sourceforge/bprocessor/gui Modified Files: StatusBar.java Log Message: removed stylecheck errors Index: StatusBar.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/StatusBar.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** StatusBar.java 20 Nov 2007 12:55:50 -0000 1.4 --- StatusBar.java 20 Nov 2007 12:57:11 -0000 1.5 *************** *** 9,16 **** import java.awt.BorderLayout; - import java.awt.Color; import java.awt.Dimension; - - import javax.swing.BorderFactory; import javax.swing.Box; import javax.swing.JComponent; --- 9,13 ---- *************** *** 19,26 **** import javax.swing.JSeparator; import javax.swing.JTextField; - import javax.swing.JToolBar; import javax.swing.SwingConstants; - import javax.swing.border.Border; - /** * Status bar --- 16,20 ---- |
From: Michael L. <he...@us...> - 2007-11-20 12:55:55
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv20266/src/net/sourceforge/bprocessor/gui Modified Files: StatusBar.java Log Message: Testing placement of tip/length/scale Index: StatusBar.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/StatusBar.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** StatusBar.java 20 Nov 2007 08:01:11 -0000 1.3 --- StatusBar.java 20 Nov 2007 12:55:50 -0000 1.4 *************** *** 9,20 **** --- 9,25 ---- import java.awt.BorderLayout; + import java.awt.Color; import java.awt.Dimension; + import javax.swing.BorderFactory; import javax.swing.Box; + import javax.swing.JComponent; import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JSeparator; + import javax.swing.JTextField; import javax.swing.JToolBar; import javax.swing.SwingConstants; + import javax.swing.border.Border; /** *************** *** 37,40 **** --- 42,103 ---- } + private JComponent createSeparator(int height) { + JSeparator separator = new JSeparator(SwingConstants.VERTICAL); + separator.setMaximumSize(new Dimension(2, height)); + return separator; + } + + private JComponent createTipPanel() { + Box tippanel = Box.createVerticalBox(); + tippanel.add(Box.createRigidArea(new Dimension(360, 0))); + Box labelarea = Box.createHorizontalBox(); + labelarea.add(new JLabel("Tip")); + labelarea.add(Box.createHorizontalGlue()); + tippanel.add(labelarea); + return tippanel; + } + + private JComponent createScalePanel() { + Box panel = Box.createVerticalBox(); + panel.add(Box.createRigidArea(new Dimension(60, 0))); + Box labelarea = Box.createHorizontalBox(); + labelarea.add(new JLabel("Scale")); + labelarea.add(Box.createHorizontalGlue()); + panel.add(labelarea); + panel.setMaximumSize(new Dimension(60, 20)); + return panel; + } + + + private JComponent createLengthPanel() { + Box lengthpanel = Box.createVerticalBox(); + lengthpanel.add(Box.createRigidArea(new Dimension(180, 0))); + Box lengtharea = Box.createHorizontalBox(); + lengtharea.add(new JLabel("Length:")); + lengtharea.add(Box.createHorizontalStrut(3)); + JTextField field = new JTextField(); + Dimension preferred = field.getPreferredSize(); + Dimension maximum = new Dimension(120, preferred.height); + field.setMaximumSize(maximum); + lengtharea.add(field); + lengthpanel.add(lengtharea); + return lengthpanel; + } + + private void createContent() { + content.add(createTipPanel()); + content.add(Box.createHorizontalGlue()); + content.add(Box.createHorizontalStrut(7)); + content.add(createSeparator(18)); + content.add(Box.createHorizontalStrut(7)); + content.add(createLengthPanel()); + content.add(Box.createHorizontalGlue()); + content.add(Box.createHorizontalStrut(7)); + content.add(createSeparator(18)); + content.add(Box.createHorizontalStrut(7)); + content.add(createScalePanel()); + content.add(Box.createHorizontalStrut(20)); + } + /** * Constructs a status bar *************** *** 44,56 **** content = Box.createHorizontalBox(); add(content, BorderLayout.CENTER); ! content.add(Box.createRigidArea(new Dimension(5, 18))); ! Box tippanel = Box.createVerticalBox(); ! tippanel.add(Box.createRigidArea(new Dimension(120, 0))); ! Box labelarea = Box.createHorizontalBox(); ! labelarea.add(new JLabel("This space intentionally left blank")); ! labelarea.add(Box.createHorizontalGlue()); ! tippanel.add(labelarea); ! content.add(tippanel); ! content.add(new JSeparator(SwingConstants.VERTICAL)); } } --- 107,112 ---- content = Box.createHorizontalBox(); add(content, BorderLayout.CENTER); ! content.add(Box.createRigidArea(new Dimension(5, 20))); ! createContent(); } } |
From: rimestad <rim...@us...> - 2007-11-20 08:40:16
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18138/src/net/sourceforge/bprocessor/gl/view Modified Files: GLPreviewPanel.java Log Message: build fix Index: GLPreviewPanel.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/GLPreviewPanel.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** GLPreviewPanel.java 20 Nov 2007 08:37:02 -0000 1.3 --- GLPreviewPanel.java 20 Nov 2007 08:40:19 -0000 1.4 *************** *** 59,67 **** this.camera = new Camera("Preview", new double[]{0, 0, 0}, new double[]{10, 10, 10}, new double[]{0, 0, 1}, Camera.PERSPECTIVE); ! Timer t = new Timer(150, new AbstractAction(){ ! public void actionPerformed(java.awt.event.ActionEvent e) { ! repaint(); ! }; ! }); t.setRepeats(true); t.start(); --- 59,68 ---- this.camera = new Camera("Preview", new double[]{0, 0, 0}, new double[]{10, 10, 10}, new double[]{0, 0, 1}, Camera.PERSPECTIVE); ! Timer t = new Timer(150, ! new AbstractAction() { ! public void actionPerformed(java.awt.event.ActionEvent e) { ! repaint(); ! }; ! }); //FIXME: Dount let the timer run forever t.setRepeats(true); t.start(); |
From: rimestad <rim...@us...> - 2007-11-20 08:36:59
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16647/src/net/sourceforge/bprocessor/gl/view Modified Files: GLPreviewPanel.java Log Message: added timer on GLPreviewPanel... may hurt performance so better sollution should be found Index: GLPreviewPanel.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/GLPreviewPanel.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** GLPreviewPanel.java 19 Nov 2007 17:57:32 -0000 1.2 --- GLPreviewPanel.java 20 Nov 2007 08:37:02 -0000 1.3 *************** *** 19,23 **** --- 19,25 ---- import javax.media.opengl.GLEventListener; import javax.media.opengl.glu.GLU; + import javax.swing.AbstractAction; import javax.swing.BorderFactory; + import javax.swing.Timer; import net.sourceforge.bprocessor.gui.PreviewPanel; *************** *** 57,61 **** this.camera = new Camera("Preview", new double[]{0, 0, 0}, new double[]{10, 10, 10}, new double[]{0, 0, 1}, Camera.PERSPECTIVE); ! repaint(); } --- 59,69 ---- this.camera = new Camera("Preview", new double[]{0, 0, 0}, new double[]{10, 10, 10}, new double[]{0, 0, 1}, Camera.PERSPECTIVE); ! Timer t = new Timer(150, new AbstractAction(){ ! public void actionPerformed(java.awt.event.ActionEvent e) { ! repaint(); ! }; ! }); ! t.setRepeats(true); ! t.start(); } *************** *** 91,96 **** this.aspect = (double)getWidth() / (double)getHeight(); - double w = gld.getWidth(); - double h = gld.getHeight(); gl.glClearColor(1, 1, 1, 0); gl.glViewport(0, 0, getWidth(), getHeight()); --- 99,102 ---- *************** *** 146,150 **** gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); gl.glRenderMode(GL.GL_RENDER); ! gl.glRotated(5, 0 , 0, 1); gl.glColor3fv(View.lineColor, 0); gl.glLineWidth(1.0f); --- 152,156 ---- gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); gl.glRenderMode(GL.GL_RENDER); ! gl.glRotated(5, 0, 0, 1); gl.glColor3fv(View.lineColor, 0); gl.glLineWidth(1.0f); *************** *** 158,162 **** public void displayChanged(GLAutoDrawable gld, boolean arg1, boolean arg2) { // TODO Auto-generated method stub - } --- 164,167 ---- |
From: rimestad <rim...@us...> - 2007-11-20 08:36:06
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16448/src/net/sourceforge/bprocessor/gui/attrview Modified Files: GenericPanel.java MaterialAttribute.java Log Message: added a separate attribute handling for Components and expanded on the material attribute Index: GenericPanel.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/GenericPanel.java,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** GenericPanel.java 9 Nov 2007 09:45:29 -0000 1.47 --- GenericPanel.java 20 Nov 2007 08:36:08 -0000 1.48 *************** *** 8,11 **** --- 8,12 ---- import java.awt.BorderLayout; + import java.awt.Color; import java.awt.Dimension; import java.awt.event.ItemEvent; *************** *** 27,33 **** import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.Camera; import net.sourceforge.bprocessor.model.Description; import net.sourceforge.bprocessor.model.Entity; - import net.sourceforge.bprocessor.model.Material; import net.sourceforge.bprocessor.model.Operation; import net.sourceforge.bprocessor.model.Parametric; --- 28,34 ---- import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.Camera; + import net.sourceforge.bprocessor.model.Component; import net.sourceforge.bprocessor.model.Description; import net.sourceforge.bprocessor.model.Entity; import net.sourceforge.bprocessor.model.Operation; import net.sourceforge.bprocessor.model.Parametric; *************** *** 140,144 **** } ! private void handleMaterial(Attribute attribute, JComponent where) { MaterialAttribute ma = new MaterialAttribute(attribute); ma.addMaterialAttributeListener(new GenericListener()); --- 141,145 ---- } ! private void handleColor(Attribute attribute, JComponent where) { MaterialAttribute ma = new MaterialAttribute(attribute); ma.addMaterialAttributeListener(new GenericListener()); *************** *** 198,201 **** --- 199,208 ---- } + private void handleComponent(Attribute attribute, JComponent where) { + GenericAttribute generic = new PreviewAttribute(attribute); + genAttributes.add(generic); + where.add(new AttributeRow(generic)); + } + private void generateContent(List what, JComponent where) { Iterator iter = what.iterator(); *************** *** 208,215 **** } else if (a.getValue() instanceof Description) { handleDescription(a, where); ! } else if (a.getValue() instanceof Material) { ! handleMaterial(a, where); } else if (a.getValue() instanceof Boolean) { handleBoolean(a, where); } else if (a.getThe2ndValue() instanceof Structure) { handleClassification(a, where); --- 215,224 ---- } else if (a.getValue() instanceof Description) { handleDescription(a, where); ! } else if (a.getValue() instanceof Color) { ! handleColor(a, where); } else if (a.getValue() instanceof Boolean) { handleBoolean(a, where); + } else if (a.getValue() instanceof Component) { + handleComponent(a, where); } else if (a.getThe2ndValue() instanceof Structure) { handleClassification(a, where); Index: MaterialAttribute.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview/MaterialAttribute.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MaterialAttribute.java 15 May 2006 09:19:53 -0000 1.4 --- MaterialAttribute.java 20 Nov 2007 08:36:08 -0000 1.5 *************** *** 21,31 **** import javax.swing.JComponent; import javax.swing.JPanel; - import javax.swing.JTextField; import javax.swing.border.Border; import net.sourceforge.bprocessor.gui.GUI; import net.sourceforge.bprocessor.model.Attribute; - import net.sourceforge.bprocessor.model.Material; - import net.sourceforge.bprocessor.model.Project; /** --- 21,28 ---- *************** *** 43,52 **** private JComponent component; - /** The editor, when this EditableAttribute is being edited */ - private JTextField editor; - - - - /** * Constructor for MaterialAttribute --- 40,43 ---- *************** *** 115,123 **** private JComponent createValueLabel(Attribute a) { JPanel valueLabel = new JPanel(); ! float[] frontColor = ((Material) a.getValue()).getColor(); valueLabel.setOpaque(true); Border blackline = BorderFactory.createLineBorder(Color.black); valueLabel.setBorder(blackline); ! valueLabel.setBackground(makeAWTColor(frontColor)); return valueLabel; } --- 106,114 ---- private JComponent createValueLabel(Attribute a) { JPanel valueLabel = new JPanel(); ! Color color = (Color) a.getValue(); valueLabel.setOpaque(true); Border blackline = BorderFactory.createLineBorder(Color.black); valueLabel.setBorder(blackline); ! valueLabel.setBackground(color); return valueLabel; } *************** *** 136,145 **** */ public void startEditing() { ! Color frontColor = JColorChooser.showDialog(GUI.getInstance(), ! "Surface Color", ! makeAWTColor(((Material) attribute.getValue()).getColor())); ! Material material = new Material("temp", frontColor.getRGBColorComponents(null)); ! Project.getInstance().add(material); ! attribute.setValue(material); valueChanged(); } --- 127,136 ---- */ public void startEditing() { ! Color color = JColorChooser.showDialog(GUI.getInstance(), ! "Color chooser", ! (Color) attribute.getValue()); ! if (color != null) { ! attribute.setValue(color); ! } valueChanged(); } *************** *** 150,160 **** */ public void stopEditing() { ! if (editor != null && attribute.isEditable()) { ! Object val = attribute.getValue(); ! if (val instanceof String) { ! attribute.setValue(editor.getText()); ! } ! component.remove(editor); ! editor = null; component.add(createValueLabel(attribute)); component.revalidate(); --- 141,145 ---- */ public void stopEditing() { ! if (attribute.isEditable()) { component.add(createValueLabel(attribute)); component.revalidate(); *************** *** 168,197 **** */ public void cancelEditing() { - if (editor != null) { - component.remove(editor); - editor = null; - component.add(createValueLabel(attribute)); - component.revalidate(); - } } - - /** - * Get AWT color for material - * @param material The material - * @return The AWT color - */ - private Color getMaterialColor(Material material) { - float[] rgb = material.getColor(); - return new Color(rgb[0], rgb[1], rgb[2]); - } - - /** - * Make AWT color from the components - * @param rgb Array of floats - * @return AWT Color - */ - private Color makeAWTColor(float[] rgb) { - return new Color(rgb[0], rgb[1], rgb[2]); - } /** --- 153,157 ---- |
From: Michael L. <he...@us...> - 2007-11-20 08:01:12
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4329/src/net/sourceforge/bprocessor/gui Modified Files: StatusBar.java Log Message: status bar Index: StatusBar.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/StatusBar.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** StatusBar.java 19 Nov 2007 14:50:31 -0000 1.2 --- StatusBar.java 20 Nov 2007 08:01:11 -0000 1.3 *************** *** 9,16 **** --- 9,20 ---- import java.awt.BorderLayout; + import java.awt.Dimension; + import javax.swing.Box; import javax.swing.JLabel; import javax.swing.JPanel; + import javax.swing.JSeparator; import javax.swing.JToolBar; + import javax.swing.SwingConstants; /** *************** *** 20,24 **** private static StatusBar instance; ! private JToolBar toolbar; /** --- 24,28 ---- private static StatusBar instance; ! private Box content; /** *************** *** 38,45 **** public StatusBar() { setLayout(new BorderLayout()); ! toolbar = new JToolBar(); ! toolbar.setFloatable(false); ! add(toolbar, BorderLayout.CENTER); ! toolbar.add(new JLabel("This space intentionally left blank")); } } --- 42,56 ---- public StatusBar() { setLayout(new BorderLayout()); ! content = Box.createHorizontalBox(); ! add(content, BorderLayout.CENTER); ! content.add(Box.createRigidArea(new Dimension(5, 18))); ! Box tippanel = Box.createVerticalBox(); ! tippanel.add(Box.createRigidArea(new Dimension(120, 0))); ! Box labelarea = Box.createHorizontalBox(); ! labelarea.add(new JLabel("This space intentionally left blank")); ! labelarea.add(Box.createHorizontalGlue()); ! tippanel.add(labelarea); ! content.add(tippanel); ! content.add(new JSeparator(SwingConstants.VERTICAL)); } } |
From: Michael L. <he...@us...> - 2007-11-19 19:56:13
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13420/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java ToolFactory.java Log Message: fixed a few bugs Index: ToolFactory.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/ToolFactory.java,v retrieving revision 1.92 retrieving revision 1.93 diff -C2 -d -r1.92 -r1.93 *** ToolFactory.java 18 Nov 2007 21:30:17 -0000 1.92 --- ToolFactory.java 19 Nov 2007 19:56:05 -0000 1.93 *************** *** 25,28 **** --- 25,31 ---- import java.awt.event.ActionEvent; import java.awt.event.KeyEvent; + import java.awt.event.MouseEvent; + import java.awt.event.MouseListener; + import javax.swing.AbstractAction; import javax.swing.Action; *************** *** 360,363 **** --- 363,397 ---- ToolAction action = new ToolAction(editor, key, iconname); JToggleButton button = Toolbar.getInstance().registerAction(action); + for (MouseListener current : button.getMouseListeners()) { + button.removeMouseListener(current); + } + button.addMouseListener(new MouseListener() { + + public void mouseClicked(MouseEvent arg0) { + // TODO Auto-generated method stub + + } + + public void mouseEntered(MouseEvent arg0) { + // TODO Auto-generated method stub + + } + + public void mouseExited(MouseEvent arg0) { + // TODO Auto-generated method stub + + } + + public void mousePressed(MouseEvent event) { + JToggleButton button = (JToggleButton) event.getComponent(); + button.doClick(); + } + + public void mouseReleased(MouseEvent arg0) { + // TODO Auto-generated method stub + + } + + }); button.setToolTipText(tooltip); group.add(button); Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.138 retrieving revision 1.139 diff -C2 -d -r1.138 -r1.139 *** AbstractTool.java 18 Nov 2007 21:30:17 -0000 1.138 --- AbstractTool.java 19 Nov 2007 19:56:05 -0000 1.139 *************** *** 358,365 **** */ public void keyReleased(KeyEvent e) { ! if (e.getKeyCode() == KeyEvent.VK_CONTROL || e.getKeyCode() == KeyEvent.VK_SPACE) { setActiveStrategy(null); } ! if (e.getKeyCode() == KeyEvent.VK_META || e.getKeyCode() == KeyEvent.VK_ALT) { metaPressed = false; editor.setCursor(cursor); --- 358,367 ---- */ public void keyReleased(KeyEvent e) { ! if (e.getKeyCode() == KeyEvent.VK_META ! || e.getKeyCode() == KeyEvent.VK_CONTROL ! || e.getKeyCode() == KeyEvent.VK_SPACE) { setActiveStrategy(null); } ! if (e.getKeyCode() == KeyEvent.VK_ALT) { metaPressed = false; editor.setCursor(cursor); |
From: rimestad <rim...@us...> - 2007-11-19 17:57:29
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31362/src/net/sourceforge/bprocessor/gl Modified Files: Editor.java Log Message: fixed compile error (that is moved glcanvas creation to GLPreviewPanel) Index: Editor.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/Editor.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Editor.java 19 Nov 2007 17:50:17 -0000 1.3 --- Editor.java 19 Nov 2007 17:57:32 -0000 1.4 *************** *** 245,252 **** GUI.getInstance().incrementPB(); ! ! PreviewPanel pp = new GLPreviewPanel(new GLCanvas(glCap)); ! GUI.getInstance().setPreviewPanel(pp); ! GUI.getInstance().incrementPB(); SwingUtilities.invokeLater ( --- 245,253 ---- GUI.getInstance().incrementPB(); ! { ! PreviewPanel pp = new GLPreviewPanel(); ! GUI.getInstance().setPreviewPanel(pp); ! GUI.getInstance().incrementPB(); ! } SwingUtilities.invokeLater ( |
From: rimestad <rim...@us...> - 2007-11-19 17:57:29
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv31362/src/net/sourceforge/bprocessor/gl/view Modified Files: GLPreviewPanel.java Log Message: fixed compile error (that is moved glcanvas creation to GLPreviewPanel) Index: GLPreviewPanel.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/GLPreviewPanel.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** GLPreviewPanel.java 19 Nov 2007 17:50:17 -0000 1.1 --- GLPreviewPanel.java 19 Nov 2007 17:57:32 -0000 1.2 *************** *** 16,19 **** --- 16,20 ---- import javax.media.opengl.GLAutoDrawable; import javax.media.opengl.GLCanvas; + import javax.media.opengl.GLCapabilities; import javax.media.opengl.GLEventListener; import javax.media.opengl.glu.GLU; *************** *** 35,48 **** private GL gl; private GLU glu; /** * Default constructor - * @param glCanvas The glcanvas */ ! public GLPreviewPanel(GLCanvas glCanvas) { super(); this.setLayout(new BorderLayout()); ! this.glCanvas = glCanvas; this.add(glCanvas, BorderLayout.CENTER); this.glCanvas.addGLEventListener(this); this.setMinimumSize(new Dimension(150, 200)); this.setPreferredSize(new Dimension(150, 200)); --- 36,53 ---- private GL gl; private GLU glu; + /** * Default constructor */ ! public GLPreviewPanel() { super(); this.setLayout(new BorderLayout()); ! GLCapabilities glCap = new GLCapabilities(); ! glCap.setDoubleBuffered(true); ! glCap.setHardwareAccelerated(true); ! this.glCanvas = new GLCanvas(glCap); this.add(glCanvas, BorderLayout.CENTER); this.glCanvas.addGLEventListener(this); + this.setMinimumSize(new Dimension(150, 200)); this.setPreferredSize(new Dimension(150, 200)); |
From: rimestad <rim...@us...> - 2007-11-19 17:54:27
|
Update of /cvsroot/bprocessor/bprocessor/library In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28548/library Modified Files: lib.bpl Log Message: removed faulty lib and added a new Index: lib.bpl =================================================================== RCS file: /cvsroot/bprocessor/bprocessor/library/lib.bpl,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** lib.bpl 12 Nov 2007 19:18:02 -0000 1.1 --- lib.bpl 19 Nov 2007 17:51:34 -0000 1.2 *************** *** 1,28625 **** <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <Library> ! <libObj useableLevels="127" name="666210 Hommage toilet.obj" locked="false" author="n/a" version="n/a"> ! <space union="true" transparent="false" name="666210 Hommage toilet.obj" type="0" id="17"> <description/> <Classification>unassigned</Classification> ! <space union="false" transparent="true" name="Void" type="1" progid="1" id="18"> <description/> <Classification>unassigned</Classification> </space> [...141246 lines suppressed...] ! <vertex z="4.04881073" x="0.34531834" y="0.81223846" progid="3145" id="18435"/> ! <vertex z="4.04881073" x="0.34531834" y="0.00974693" progid="3146" id="18436"/> ! <vertex z="4.04881073" x="0.34531834" y="-0.81218262" progid="3147" id="18437"/> ! <vertex z="4.09879456" x="0.31021788" y="0.85384277" progid="3148" id="18438"/> ! <vertex z="4.09879456" x="0.31021788" y="0.4267429" progid="3149" id="18439"/> ! <vertex z="4.09879456" x="0.31021788" y="-4.0797E-4" progid="3150" id="18440"/> ! <vertex z="4.09879456" x="0.31021788" y="-0.85486267" progid="3151" id="18441"/> ! <vertex z="4.09879456" x="0.31021788" y="-1.2821666" progid="3152" id="18442"/> ! <vertex z="4.04881073" x="0.39433403" y="1.69500656" progid="3153" id="18443"/> ! <vertex z="4.04881073" x="1.47013687" y="1.69500656" progid="3154" id="18444"/> ! <vertex z="4.04881073" x="0.94011452" y="1.69500656" progid="3155" id="18445"/> ! <vertex z="4.09879456" x="1.49252213" y="1.75799225" progid="3156" id="18446"/> ! <vertex z="4.09879456" x="1.20320847" y="1.75799225" progid="3157" id="18447"/> ! <vertex z="4.09879456" x="0.91826416" y="1.75799225" progid="3158" id="18448"/> ! <vertex z="4.04881073" x="1.60309525" y="1.64371384" progid="3159" id="18449"/> ! <vertex z="4.04881073" x="1.66619949" y="1.50149948" progid="3160" id="18450"/> ! <vertex z="4.09879456" x="1.6965155" y="1.55852646" progid="3161" id="18451"/> ! <vertex z="4.04881073" x="1.66619949" y="1.25347092" progid="3162" id="18452"/> </space> </libObj> |
From: rimestad <rim...@us...> - 2007-11-19 17:50:28
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28523/src/net/sourceforge/bprocessor/gui Modified Files: GUI.java Added Files: PreviewPanel.java Log Message: Created a preview Panel --- NEW FILE: PreviewPanel.java --- //--------------------------------------------------------------------------------- // $Id: PreviewPanel.java,v 1.1 2007/11/19 17:50:29 rimestad Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gui; import javax.swing.JPanel; import net.sourceforge.bprocessor.model.Geometric; /** * A abstract class for a preview panel to use with the GUI */ public abstract class PreviewPanel extends JPanel { /** * Constructor */ public PreviewPanel() { super(); } /** {@inheritDoc} */ public abstract void repaint(); /** * Change the geometric previewed * @param geometric the geometric */ public abstract void preview(Geometric geometric); } Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.81 retrieving revision 1.82 diff -C2 -d -r1.81 -r1.82 *** GUI.java 19 Nov 2007 14:26:19 -0000 1.81 --- GUI.java 19 Nov 2007 17:50:29 -0000 1.82 *************** *** 129,132 **** --- 129,134 ---- private Timer alertTimer; + private PreviewPanel previewPanel; + /** * Constructor for GUI *************** *** 795,797 **** --- 797,814 ---- } } + + /** + * Set the used preview panel in the GUI + * @param panel the preview panel + */ + public void setPreviewPanel(PreviewPanel panel) { + this.previewPanel = panel; + } + + /** + * @return the previewPanel + */ + public PreviewPanel getPreviewPanel() { + return previewPanel; + } } |
From: rimestad <rim...@us...> - 2007-11-19 17:50:28
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/attrview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28523/src/net/sourceforge/bprocessor/gui/attrview Added Files: PreviewAttribute.java Log Message: Created a preview Panel --- NEW FILE: PreviewAttribute.java --- //--------------------------------------------------------------------------------- // $Id: PreviewAttribute.java,v 1.1 2007/11/19 17:50:29 rimestad Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gui.attrview; import java.awt.Color; import java.awt.Dimension; import javax.swing.BoxLayout; import net.sourceforge.bprocessor.gui.GUI; import net.sourceforge.bprocessor.gui.PreviewPanel; import net.sourceforge.bprocessor.model.Attribute; import net.sourceforge.bprocessor.model.Component; /** * A attribute for a preview */ public class PreviewAttribute extends GenericAttribute { private Attribute attribute; /** * Constructor * @param attribute the attribute for the panel */ public PreviewAttribute(Attribute attribute) { super(BoxLayout.PAGE_AXIS); this.setPreferredSize(new Dimension(150, 200)); this.setBackground(Color.white); this.attribute = attribute; PreviewPanel panel = GUI.getInstance().getPreviewPanel(); panel.preview(((Component)attribute.getValue()).getSpace()); this.add(panel); } /** {@inheritDoc} */ @Override public Attribute attribute() { return attribute; } /** {@inheritDoc} */ @Override public void cancelEditing() { } /** {@inheritDoc} */ @Override public void startEditing() { } /** {@inheritdoc} */ @Override public void stopEditing() { } } |
From: rimestad <rim...@us...> - 2007-11-19 17:50:23
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28510/src/net/sourceforge/bprocessor/model Modified Files: Component.java Log Message: Created a preview Panel Index: Component.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Component.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Component.java 19 Nov 2007 10:51:41 -0000 1.3 --- Component.java 19 Nov 2007 17:50:21 -0000 1.4 *************** *** 119,123 **** List<Attribute> att = new LinkedList<Attribute>(); att.add(new Attribute("name", getName())); ! att.add(new Attribute("levels", new Selector<String>(getLevelStrings()))); att.add(new Attribute("geometry", getSpace())); att.add(new Attribute("Locked", isLocked())); --- 119,126 ---- List<Attribute> att = new LinkedList<Attribute>(); att.add(new Attribute("name", getName())); ! att.add(new Attribute("Project", worksAtLevel(Space.PROJECT_LEVEL))); ! att.add(new Attribute("Space", worksAtLevel(Space.SPACE_LEVEL))); ! att.add(new Attribute("Element", worksAtLevel(Space.ELEMENT_LEVEL))); ! att.add(new Attribute("Part", worksAtLevel(Space.PART_LEVEL))); att.add(new Attribute("geometry", getSpace())); att.add(new Attribute("Locked", isLocked())); *************** *** 129,145 **** att.add(new Attribute("Author", getAuthor())); att.add(new Attribute("Version", getVersion())); return att; } ! ! private List<String> getLevelStrings() { ! List<String> strings = new LinkedList<String>(); ! int lvl = Space.SPACE_LEVEL; ! for (int i = 0; i < Space.PART_LEVEL; i++) { ! if ((useableLevels & (1 >> i)) == (1 >> i)) { ! strings.add(Space.levelToString(lvl)); ! } ! lvl++; } ! return strings; } --- 132,145 ---- att.add(new Attribute("Author", getAuthor())); att.add(new Attribute("Version", getVersion())); + att.add(new Attribute("Preview", this)); return att; } ! ! private boolean worksAtLevel(int spaceLevel) { ! int lvl = 1 >> (spaceLevel - Space.PROJECT_LEVEL); ! if ((getUseLevel() & lvl) == lvl) { ! return true; } ! return false; } |
From: rimestad <rim...@us...> - 2007-11-19 17:50:23
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28489/src/net/sourceforge/bprocessor/gl/view Modified Files: Display.java Added Files: GLPreviewPanel.java Log Message: Created a preview Panel --- NEW FILE: GLPreviewPanel.java --- //--------------------------------------------------------------------------------- // $Id: GLPreviewPanel.java,v 1.1 2007/11/19 17:50:17 rimestad Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gl.view; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; import java.util.LinkedList; import javax.media.opengl.DebugGL; import javax.media.opengl.GL; import javax.media.opengl.GLAutoDrawable; import javax.media.opengl.GLCanvas; import javax.media.opengl.GLEventListener; import javax.media.opengl.glu.GLU; import javax.swing.BorderFactory; import net.sourceforge.bprocessor.gui.PreviewPanel; import net.sourceforge.bprocessor.model.Camera; import net.sourceforge.bprocessor.model.Geometric; /** * A gl preview panel */ public class GLPreviewPanel extends PreviewPanel implements GLEventListener { private GLCanvas glCanvas; private Camera camera; private Geometric geometric; private double aspect; private int displayList; private GL gl; private GLU glu; /** * Default constructor * @param glCanvas The glcanvas */ public GLPreviewPanel(GLCanvas glCanvas) { super(); this.setLayout(new BorderLayout()); this.glCanvas = glCanvas; this.add(glCanvas, BorderLayout.CENTER); this.glCanvas.addGLEventListener(this); this.setMinimumSize(new Dimension(150, 200)); this.setPreferredSize(new Dimension(150, 200)); this.setMaximumSize(new Dimension(150, 200)); this.setBackground(Color.white); this.setBorder(BorderFactory.createLineBorder(Color.black)); this.camera = new Camera("Preview", new double[]{0, 0, 0}, new double[]{10, 10, 10}, new double[]{0, 0, 1}, Camera.PERSPECTIVE); repaint(); } /** {@inheritDoc} */ @Override public void preview(Geometric geometric) { this.geometric = geometric; LinkedList<Geometric> cams = new LinkedList<Geometric>(); cams.add(geometric); this.camera = new Camera("Preview", new double[]{0, 0, 0}, new double[]{100, 100, 100}, new double[]{0, 0, 1}, Camera.PERSPECTIVE); camera.zoomOn(cams, (double)150 / (double)200); repaint(); } /** {@inheritDoc} */ @Override public void repaint() { if (glCanvas != null) { glCanvas.repaint(); } } ////////////////////////////////////////////// // GLEventListener methods ////////////////////////////////////////////// /** {@inheritDoc} */ public void init(GLAutoDrawable gld) { gl = gld.getGL(); glu = new GLU(); //ENABLE FOR DEBUG gld.setGL(new DebugGL(gld.getGL())); this.aspect = (double)getWidth() / (double)getHeight(); double w = gld.getWidth(); double h = gld.getHeight(); gl.glClearColor(1, 1, 1, 0); gl.glViewport(0, 0, getWidth(), getHeight()); gl.glLineStipple(4, (short)0xAAAA); gl.glEnable(GL.GL_LIGHT0); //Tell if both sides of the model should be lighted gl.glLightModeli(GL.GL_LIGHT_MODEL_TWO_SIDE, 0); gl.glLightfv(GL.GL_LIGHT0, GL.GL_AMBIENT, new float[] {0.3f, 0.3f, 0.3f, 1.0f}, 0); gl.glLightfv(GL.GL_LIGHT0, GL.GL_DIFFUSE, new float[] {0.7f, 0.7f, 0.7f, 1.0f}, 0); gl.glLightfv(GL.GL_LIGHT0, GL.GL_POSITION, new float[] {0.0f, 0.0f, 0.0f, 1.0f}, 0); gl.glEnable(GL.GL_LINE_SMOOTH); gl.glEnable(GL.GL_POINT_SMOOTH); gl.glEnable(GL.GL_BLEND); gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA); gl.glDepthMask(true); gl.glDepthFunc(GL.GL_LEQUAL); gl.glEnable(GL.GL_COLOR_MATERIAL); gl.glColorMaterial(GL.GL_FRONT_AND_BACK, GL.GL_AMBIENT_AND_DIFFUSE); gl.glEnable(GL.GL_DEPTH_TEST); gl.glMatrixMode(GL.GL_PROJECTION); gl.glLoadIdentity(); double tal = Math.tan(Math.toRadians(camera.getFocalwidth() / 2)); gl.glFrustum(-tal, tal, -tal / aspect, tal / aspect, 1, camera.dist() * 2); gl.glMatrixMode(GL.GL_MODELVIEW); gl.glLoadIdentity(); new GLU().gluLookAt(camera.getCamera()[0], camera.getCamera()[1], camera.getCamera()[2], camera.getCenter()[0], camera.getCenter()[1], camera.getCenter()[2], camera.getRoll()[0], camera.getRoll()[1], camera.getRoll()[2]); compileGeometric(gld); } private void compileGeometric(GLAutoDrawable gld) { GL gl = gld.getGL(); Display.construction(true); Display.edgesEnabled(false); Display.mode(View.LIGHTING_MODE); Display.transparency(true); Display.target(null); if (this.displayList == 0) { this.displayList = gl.glGenLists(1); } gl.glNewList(this.displayList, GL.GL_COMPILE); Display.draw(gld.getGL(), glu, this.camera, this.geometric); gl.glEndList(); } /** {@inheritDoc} */ public void display(GLAutoDrawable gld) { gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); gl.glRenderMode(GL.GL_RENDER); gl.glRotated(5, 0 , 0, 1); gl.glColor3fv(View.lineColor, 0); gl.glLineWidth(1.0f); gl.glPushMatrix(); gl.glCallList(this.displayList); gl.glPopMatrix(); gld.swapBuffers(); } /** {@inheritDoc} */ public void displayChanged(GLAutoDrawable gld, boolean arg1, boolean arg2) { // TODO Auto-generated method stub } /** {@inheritDoc} */ public void reshape(GLAutoDrawable gld, int x, int y, int width, int height) { gld.getGL().glViewport(x, y, width, height); } } Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** Display.java 19 Nov 2007 11:07:58 -0000 1.59 --- Display.java 19 Nov 2007 17:50:17 -0000 1.60 *************** *** 1189,1193 **** /** ! * * @param gld gld * @param gl gl --- 1189,1219 ---- /** ! * Draw the given geometric ! * @param gl gl the gl context ! * @param glu the glu ! * @param camera the camera ! * @param geometric The geometric ! */ ! public static void draw(GL gl, GLU glu, Camera camera, Geometric geometric) { ! Display.gl = gl; ! Display.glu = glu; ! Display.initialize(); ! Display.selecting(false); ! Display.project = Project.getInstance(); ! Display.camera = camera; ! Display.active = Project.getInstance().world(); ! if (geometric instanceof Space) { ! Display.draw((Space)geometric, true); ! } else if (geometric instanceof Surface) { ! Display.draw((Surface)geometric, true); ! } else if (geometric instanceof Edge) { ! Display.draw((Edge)geometric); ! } else if (geometric instanceof Vertex) { ! Display.draw((Vertex)geometric); ! } ! } ! ! /** ! * Draw the project and the selection * @param gld gld * @param gl gl |
From: rimestad <rim...@us...> - 2007-11-19 17:50:14
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv28489/src/net/sourceforge/bprocessor/gl Modified Files: Editor.java Log Message: Created a preview Panel Index: Editor.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/Editor.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Editor.java 19 Nov 2007 13:43:54 -0000 1.2 --- Editor.java 19 Nov 2007 17:50:17 -0000 1.3 *************** *** 9,12 **** --- 9,13 ---- import net.sourceforge.bprocessor.gl.tool.Tool; import net.sourceforge.bprocessor.gl.tool.ToolFactory; + import net.sourceforge.bprocessor.gl.view.GLPreviewPanel; import net.sourceforge.bprocessor.gl.view.View; import net.sourceforge.bprocessor.gl.view.ViewToolbarFactory; *************** *** 16,19 **** --- 17,21 ---- import net.sourceforge.bprocessor.model.Selection; import net.sourceforge.bprocessor.gui.GUI; + import net.sourceforge.bprocessor.gui.PreviewPanel; import java.awt.Color; *************** *** 242,245 **** --- 244,253 ---- repaint(); GUI.getInstance().incrementPB(); + + + PreviewPanel pp = new GLPreviewPanel(new GLCanvas(glCap)); + GUI.getInstance().setPreviewPanel(pp); + GUI.getInstance().incrementPB(); + SwingUtilities.invokeLater ( new Runnable() { |
From: Michael L. <he...@us...> - 2007-11-19 14:50:28
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22509/src/net/sourceforge/bprocessor/gui Modified Files: StatusBar.java Log Message: A string added to status-bar Index: StatusBar.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/StatusBar.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** StatusBar.java 19 Nov 2007 14:26:19 -0000 1.1 --- StatusBar.java 19 Nov 2007 14:50:31 -0000 1.2 *************** *** 8,11 **** --- 8,14 ---- package net.sourceforge.bprocessor.gui; + import java.awt.BorderLayout; + + import javax.swing.JLabel; import javax.swing.JPanel; import javax.swing.JToolBar; *************** *** 34,40 **** */ public StatusBar() { toolbar = new JToolBar(); toolbar.setFloatable(false); ! add(toolbar); } } --- 37,45 ---- */ public StatusBar() { + setLayout(new BorderLayout()); toolbar = new JToolBar(); toolbar.setFloatable(false); ! add(toolbar, BorderLayout.CENTER); ! toolbar.add(new JLabel("This space intentionally left blank")); } } |
From: Michael L. <he...@us...> - 2007-11-19 14:26:31
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv14542/src/net/sourceforge/bprocessor/gui Modified Files: GUI.java Added Files: StatusBar.java Log Message: status bar added --- NEW FILE: StatusBar.java --- //--------------------------------------------------------------------------------- // $Id: StatusBar.java,v 1.1 2007/11/19 14:26:19 henryml Exp $ // // Copyright (c) 2005 The BProcessor Team (http://bprocessor.sourceforge.net) // Released under the Lesser GNU Public License v2.1 //--------------------------------------------------------------------------------- package net.sourceforge.bprocessor.gui; import javax.swing.JPanel; import javax.swing.JToolBar; /** * Status bar */ public class StatusBar extends JPanel { private static StatusBar instance; private JToolBar toolbar; /** * Returns the status bar singleton * @return status bar */ public static StatusBar instance() { if (instance == null) { instance = new StatusBar(); } return instance; } /** * Constructs a status bar */ public StatusBar() { toolbar = new JToolBar(); toolbar.setFloatable(false); add(toolbar); } } Index: GUI.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/GUI.java,v retrieving revision 1.80 retrieving revision 1.81 diff -C2 -d -r1.80 -r1.81 *** GUI.java 6 Nov 2007 18:27:31 -0000 1.80 --- GUI.java 19 Nov 2007 14:26:19 -0000 1.81 *************** *** 675,679 **** getContentPane().add(Toolbar.getInstance(), BorderLayout.NORTH); getContentPane().add(splitPaneLeftRight, BorderLayout.CENTER); ! makeTree(); --- 675,679 ---- getContentPane().add(Toolbar.getInstance(), BorderLayout.NORTH); getContentPane().add(splitPaneLeftRight, BorderLayout.CENTER); ! getContentPane().add(StatusBar.instance(), BorderLayout.SOUTH); makeTree(); |
From: Michael L. <he...@us...> - 2007-11-19 13:43:51
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29748/src/net/sourceforge/bprocessor/gl Modified Files: Editor.java Log Message: Small changes Index: Editor.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/Editor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** Editor.java 18 Nov 2007 20:32:48 -0000 1.1 --- Editor.java 19 Nov 2007 13:43:54 -0000 1.2 *************** *** 73,76 **** --- 73,82 ---- private JLabel tipLabel; + + private JPanel tipPanel; + + private JPanel bottomPanel; + + private JPanel jp; /** *************** *** 78,122 **** */ public Editor() { - GLCapabilities glCap = new GLCapabilities(); - glCap.setDoubleBuffered(true); - glCap.setHardwareAccelerated(true); - ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false); - glc = new GLCanvas(glCap); - log.info("Using JOGL version official"); Selection.primary().addObserver(this); Project.getInstance().addStaticObserver(this); GUI.getInstance().incrementPB(); ! JPanel jp = new JPanel(); ! jp.setLayout(new BorderLayout()); ! jp.add(glc, BorderLayout.CENTER); ! jp.setMinimumSize(new Dimension(320, 240)); ! jp.setPreferredSize(new Dimension(640, 480)); GUI.getInstance().incrementPB(); ! lengthPanel = new JPanel(); ! lengthPanel.setLayout(new BorderLayout()); ! lengthPanel.add(new JLabel("Length: "), BorderLayout.WEST); ! lengthField = new LengthField(); ! lengthPanel.add(lengthField, BorderLayout.CENTER); factor = new FactorBox(); - //lengthPanel.add(factor, BorderLayout.EAST); ! JPanel tipPanel = new JPanel(); ! tipPanel.setLayout(new BorderLayout()); ! tipPanel.add(new JLabel("Tip: "), BorderLayout.WEST); ! tipLabel = new JLabel("Hello World!"); ! Font basicFont = tipLabel.getFont(); ! tipLabel.setFont(new Font(basicFont.getName(), Font.PLAIN, basicFont.getSize())); ! tipPanel.add(tipLabel, BorderLayout.CENTER); - JPanel bottomPanel = new JPanel(); - bottomPanel.setLayout(new BorderLayout()); - bottomPanel.setBorder(BorderFactory.createEtchedBorder()); - bottomPanel.add(lengthPanel, BorderLayout.NORTH); - bottomPanel.add(new JSeparator(), BorderLayout.CENTER); - bottomPanel.add(tipPanel, BorderLayout.SOUTH); jp.add(bottomPanel, BorderLayout.SOUTH); GUI.getInstance().incrementPB(); --- 84,145 ---- */ public Editor() { Selection.primary().addObserver(this); Project.getInstance().addStaticObserver(this); + ToolTipManager.sharedInstance().setLightWeightPopupEnabled(false); + + + { + GLCapabilities glCap = new GLCapabilities(); + + glCap.setDoubleBuffered(true); + glCap.setHardwareAccelerated(true); + glc = new GLCanvas(glCap); + glc.setAutoSwapBufferMode(false); + } + GUI.getInstance().incrementPB(); ! { ! jp = new JPanel(); ! jp.setLayout(new BorderLayout()); ! jp.add(glc, BorderLayout.CENTER); ! jp.setMinimumSize(new Dimension(320, 240)); ! jp.setPreferredSize(new Dimension(640, 480)); ! } ! GUI.getInstance().incrementPB(); ! { ! lengthPanel = new JPanel(); ! lengthPanel.setLayout(new BorderLayout()); ! lengthPanel.add(new JLabel("Length: "), BorderLayout.WEST); ! lengthField = new LengthField(); ! lengthPanel.add(lengthField, BorderLayout.CENTER); ! } ! factor = new FactorBox(); ! { ! tipPanel = new JPanel(); ! tipPanel.setLayout(new BorderLayout()); ! tipPanel.add(new JLabel("Tip: "), BorderLayout.WEST); ! tipLabel = new JLabel("Hello World!"); ! Font basicFont = tipLabel.getFont(); ! tipLabel.setFont(new Font(basicFont.getName(), Font.PLAIN, basicFont.getSize())); ! tipPanel.add(tipLabel, BorderLayout.CENTER); ! } ! ! { ! bottomPanel = new JPanel(); ! bottomPanel.setLayout(new BorderLayout()); ! bottomPanel.setBorder(BorderFactory.createEtchedBorder()); ! bottomPanel.add(lengthPanel, BorderLayout.NORTH); ! bottomPanel.add(new JSeparator(), BorderLayout.CENTER); ! bottomPanel.add(tipPanel, BorderLayout.SOUTH); ! } jp.add(bottomPanel, BorderLayout.SOUTH); + GUI.getInstance().incrementPB(); *************** *** 125,128 **** --- 148,152 ---- view = new View(this); + (new ViewToolbarFactory()).registerToolbar(this); glc.addGLEventListener(view); *************** *** 137,225 **** GUI.getInstance().incrementPB(); ! JMenu colorMenu = new JMenu("GL Colors"); ! ActionListener colorMenuListener = new ActionListener() { ! public void actionPerformed(ActionEvent e) { ! if (e.getActionCommand().equals("Grid Color")) { ! Color newColor = JColorChooser.showDialog(GUI.getInstance(), ! "Grid Color", ! new Color(View.getGridColor()[0], ! View.getGridColor()[1], ! View.getGridColor()[2])); ! if (newColor != null) { ! View.setGridColor(newColor.getRGBComponents(null)); ! } ! } else if (e.getActionCommand().equals("Line Color")) { ! Color newColor = JColorChooser.showDialog(GUI.getInstance(), ! "Line Color", ! new Color(View.getLineColor()[0], ! View.getLineColor()[1], ! View.getLineColor()[2])); ! if (newColor != null) { ! View.setLineColor(newColor.getRGBComponents(null)); ! } ! } else if (e.getActionCommand().equals("Constructor Line Color")) { ! Color newColor = JColorChooser.showDialog(GUI.getInstance(), ! "Constructor Line Color", ! new Color(View.getConstructorColor()[0], ! View.getConstructorColor()[1], ! View.getConstructorColor()[2])); ! if (newColor != null) { ! View.setConstructorColor(newColor.getRGBComponents(null)); ! } ! } else if (e.getActionCommand().equals("Background Color")) { ! Color newColor = JColorChooser.showDialog(GUI.getInstance(), ! "Background Color", ! new Color(View.getBgColor()[0], ! View.getBgColor()[1], ! View.getBgColor()[2])); ! if (newColor != null) { ! View.setBGColor(newColor.getRGBComponents(null)); ! } ! } else if (e.getActionCommand().equals("None Color")) { ! Color newColor = JColorChooser.showDialog(GUI.getInstance(), ! "None Color", ! new Color(View.getNoneColor()[0], ! View.getNoneColor()[1], ! View.getNoneColor()[2])); ! if (newColor != null) { ! View.setNoneColor(newColor.getRGBComponents(null)); } - } else if (e.getActionCommand().equals("Default")) { - View.setBGColor(View.BACKGROUND_COLOR); - View.setGridColor(View.GRID_COLOR); - View.setLineColor(View.STD_LINE_COLOR); - View.setNoneColor(View.NONE_COLOR); - View.setConstructorColor(View.CONSTRUCTOR_COLOR); } ! ! } ! ! }; ! JMenuItem gridItem = new JMenuItem("Grid Color"); ! gridItem.addActionListener(colorMenuListener); ! JMenuItem lineItem = new JMenuItem("Line Color"); ! lineItem.addActionListener(colorMenuListener); ! JMenuItem constructorItem = new JMenuItem("Constructor Line Color"); ! constructorItem.addActionListener(colorMenuListener); ! JMenuItem bgItem = new JMenuItem("Background Color"); ! bgItem.addActionListener(colorMenuListener); ! JMenuItem noneItem = new JMenuItem("None Color"); ! noneItem.addActionListener(colorMenuListener); ! JMenuItem defaultItem = new JMenuItem("Default"); ! defaultItem.addActionListener(colorMenuListener); ! GUI.getInstance().incrementPB(); ! ! colorMenu.add(gridItem); ! colorMenu.add(lineItem); ! colorMenu.add(constructorItem); ! colorMenu.add(bgItem); ! colorMenu.add(noneItem); ! colorMenu.add(defaultItem); ! GUI.getInstance().incrementPB(); ! ! GUI.getInstance().addMenu(colorMenu); GUI.getInstance().incrementPB(); - - glc.setAutoSwapBufferMode(false); repaint(); GUI.getInstance().incrementPB(); --- 161,243 ---- GUI.getInstance().incrementPB(); ! { ! JMenu colorMenu = new JMenu("GL Colors"); ! ActionListener colorMenuListener = new ActionListener() { ! public void actionPerformed(ActionEvent e) { ! if (e.getActionCommand().equals("Grid Color")) { ! Color newColor = JColorChooser.showDialog(GUI.getInstance(), ! "Grid Color", ! new Color(View.getGridColor()[0], ! View.getGridColor()[1], ! View.getGridColor()[2])); ! if (newColor != null) { ! View.setGridColor(newColor.getRGBComponents(null)); ! } ! } else if (e.getActionCommand().equals("Line Color")) { ! Color newColor = JColorChooser.showDialog(GUI.getInstance(), ! "Line Color", ! new Color(View.getLineColor()[0], ! View.getLineColor()[1], ! View.getLineColor()[2])); ! if (newColor != null) { ! View.setLineColor(newColor.getRGBComponents(null)); ! } ! } else if (e.getActionCommand().equals("Constructor Line Color")) { ! Color newColor = JColorChooser.showDialog(GUI.getInstance(), ! "Constructor Line Color", ! new Color(View.getConstructorColor()[0], ! View.getConstructorColor()[1], ! View.getConstructorColor()[2])); ! if (newColor != null) { ! View.setConstructorColor(newColor.getRGBComponents(null)); ! } ! } else if (e.getActionCommand().equals("Background Color")) { ! Color newColor = JColorChooser.showDialog(GUI.getInstance(), ! "Background Color", ! new Color(View.getBgColor()[0], ! View.getBgColor()[1], ! View.getBgColor()[2])); ! if (newColor != null) { ! View.setBGColor(newColor.getRGBComponents(null)); ! } ! } else if (e.getActionCommand().equals("None Color")) { ! Color newColor = JColorChooser.showDialog(GUI.getInstance(), ! "None Color", ! new Color(View.getNoneColor()[0], ! View.getNoneColor()[1], ! View.getNoneColor()[2])); ! if (newColor != null) { ! View.setNoneColor(newColor.getRGBComponents(null)); ! } ! } else if (e.getActionCommand().equals("Default")) { ! View.setBGColor(View.BACKGROUND_COLOR); ! View.setGridColor(View.GRID_COLOR); ! View.setLineColor(View.STD_LINE_COLOR); ! View.setNoneColor(View.NONE_COLOR); ! View.setConstructorColor(View.CONSTRUCTOR_COLOR); } } ! }; ! JMenuItem gridItem = new JMenuItem("Grid Color"); ! gridItem.addActionListener(colorMenuListener); ! JMenuItem lineItem = new JMenuItem("Line Color"); ! lineItem.addActionListener(colorMenuListener); ! JMenuItem constructorItem = new JMenuItem("Constructor Line Color"); ! constructorItem.addActionListener(colorMenuListener); ! JMenuItem bgItem = new JMenuItem("Background Color"); ! bgItem.addActionListener(colorMenuListener); ! JMenuItem noneItem = new JMenuItem("None Color"); ! noneItem.addActionListener(colorMenuListener); ! JMenuItem defaultItem = new JMenuItem("Default"); ! defaultItem.addActionListener(colorMenuListener); ! colorMenu.add(gridItem); ! colorMenu.add(lineItem); ! colorMenu.add(constructorItem); ! colorMenu.add(bgItem); ! colorMenu.add(noneItem); ! colorMenu.add(defaultItem); ! GUI.getInstance().addMenu(colorMenu); ! } GUI.getInstance().incrementPB(); repaint(); GUI.getInstance().incrementPB(); |
From: Michael L. <he...@us...> - 2007-11-19 11:07:55
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv533/src/net/sourceforge/bprocessor/gl/view Modified Files: Display.java Log Message: Instances selectable Index: Display.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/view/Display.java,v retrieving revision 1.58 retrieving revision 1.59 diff -C2 -d -r1.58 -r1.59 *** Display.java 15 Nov 2007 13:07:41 -0000 1.58 --- Display.java 19 Nov 2007 11:07:58 -0000 1.59 *************** *** 95,99 **** new HashMap<Geometric, Integer>(); ! private static final boolean USEDL = true; /** --- 95,99 ---- new HashMap<Geometric, Integer>(); ! private static final boolean USEDL = false; /** *************** *** 549,562 **** } glu.gluTessEndPolygon(tesselator); - /* - List<Vertex> vertices = surface.getVertices(); - int index = 0; - if (surface.getNormals() != null) { - for (Vertex v : surface.getNormals()) { - Vertex v0 = vertices.get(index); - draw(new Edge(v0.add(v), v0)); - index++; - } - }*/ } --- 549,552 ---- *************** *** 844,853 **** } boolean selActivated = false; ! if (selecting() && active == space.getProto()) { push(space); selActivated = true; selecting = false; } ! drawSpace(space.getProto(), inside || active == space.getProto()); if (selActivated) { selecting = true; --- 834,843 ---- } boolean selActivated = false; ! if (selecting()) { push(space); selActivated = true; selecting = false; } ! drawSpace(space.getProto(), inside); if (selActivated) { selecting = true; |