From cdd33bb7a61ed7460c666d03ea6113efe97ea1c9 Mon Sep 17 00:00:00 2001 From: benfry Date: Tue, 11 Nov 2003 22:10:39 +0000 Subject: [PATCH] getting things back under control --- app/PdeEditor.java | 2 ++ app/PdeEditorHeader.java | 3 ++- app/PdeEditorStatus.java | 55 +++++++++++++++++----------------------- build/macosx/run.sh | 2 +- 4 files changed, 28 insertions(+), 34 deletions(-) diff --git a/app/PdeEditor.java b/app/PdeEditor.java index 702d27e5f..fb948b294 100644 --- a/app/PdeEditor.java +++ b/app/PdeEditor.java @@ -1488,6 +1488,7 @@ public class PdeEditor extends JFrame protected void skNew2() { try { + System.out.println("skNew2()"); // does all the plumbing to create a new project // then calls handleOpen to load it up @@ -1508,6 +1509,7 @@ public class PdeEditor extends JFrame sketchDir = new File(sketchParentDir, sketchName); } else { + System.out.println("this is the thing"); String sketchParentDir = PdePreferences.get("sketchbook.path"); int index = 0; diff --git a/app/PdeEditorHeader.java b/app/PdeEditorHeader.java index 5a58aafb0..10e928372 100644 --- a/app/PdeEditorHeader.java +++ b/app/PdeEditorHeader.java @@ -30,7 +30,8 @@ import java.io.*; import javax.swing.*; -public class PdeEditorHeader extends JPanel { +//public class PdeEditorHeader extends JPanel { +public class PdeEditorHeader extends JComponent { static final String SKETCH_TITLER = "sketch"; static Color primaryColor; diff --git a/app/PdeEditorStatus.java b/app/PdeEditorStatus.java index 6f2658522..5ed5afb18 100644 --- a/app/PdeEditorStatus.java +++ b/app/PdeEditorStatus.java @@ -75,24 +75,16 @@ public class PdeEditorStatus extends JPanel implements ActionListener { if (bgcolor == null) { bgcolor = new Color[4]; - bgcolor[0] = PdePreferences.getColor("editor.status.notice.bgcolor"); - //new Color(102, 102, 102)); - bgcolor[1] = PdePreferences.getColor("editor.status.error.bgcolor"); - //new Color(102, 26, 0)); - bgcolor[2] = PdePreferences.getColor("editor.status.prompt.bgcolor"); - //new Color(204, 153, 0)); - bgcolor[3] = PdePreferences.getColor("editor.status.prompt.bgcolor"); - //new Color(204, 153, 0)); + bgcolor[0] = PdePreferences.getColor("status.notice.bgcolor"); + bgcolor[1] = PdePreferences.getColor("status.error.bgcolor"); + bgcolor[2] = PdePreferences.getColor("status.prompt.bgcolor"); + bgcolor[3] = PdePreferences.getColor("status.prompt.bgcolor"); fgcolor = new Color[4]; - fgcolor[0] = PdePreferences.getColor("editor.status.notice.fgcolor"); - //new Color(255, 255, 255)); - fgcolor[1] = PdePreferences.getColor("editor.status.error.fgcolor"); - //new Color(255, 255, 255)); - fgcolor[2] = PdePreferences.getColor("editor.status.prompt.fgcolor"); - //new Color(0, 0, 0)); - fgcolor[3] = PdePreferences.getColor("editor.status.prompt.fgcolor"); - //new Color(0, 0, 0)); + fgcolor[0] = PdePreferences.getColor("status.notice.fgcolor"); + fgcolor[1] = PdePreferences.getColor("status.error.fgcolor"); + fgcolor[2] = PdePreferences.getColor("status.prompt.fgcolor"); + fgcolor[3] = PdePreferences.getColor("status.prompt.fgcolor"); } } @@ -100,14 +92,16 @@ public class PdeEditorStatus extends JPanel implements ActionListener { public void empty() { mode = NOTICE; message = NO_MESSAGE; - update(); + //update(); + repaint(); } public void notice(String message) { mode = NOTICE; this.message = message; - update(); + //update(); + repaint(); } public void unnotice(String unmessage) { @@ -118,7 +112,8 @@ public class PdeEditorStatus extends JPanel implements ActionListener { public void error(String message) { mode = ERROR; this.message = message; - update(); + //update(); + repaint(); } @@ -135,7 +130,8 @@ public class PdeEditorStatus extends JPanel implements ActionListener { cancelButton.setVisible(true); yesButton.requestFocus(); - update(); + //update(); + repaint(); /* Point upperLeft = new Point(getLocation()); @@ -343,7 +339,8 @@ public class PdeEditorStatus extends JPanel implements ActionListener { editField.selectAll(); editField.requestFocus(); - update(); + repaint(); + //update(); } public void unedit() { @@ -354,7 +351,7 @@ public class PdeEditorStatus extends JPanel implements ActionListener { } -#ifdef SWINGSUCKS + /* public void update() { Graphics g = this.getGraphics(); try { @@ -366,20 +363,15 @@ public class PdeEditorStatus extends JPanel implements ActionListener { public void update(Graphics g) { paint(g); } -#else - public void update() { repaint(); } -#endif + */ -#ifndef SWINGSUCKS - public void paintComponent(Graphics screen) -#else - public void paint(Graphics screen) -#endif - { + public void paintComponent(Graphics screen) { //if (screen == null) return; if (yesButton == null) setup(); + System.out.println("status.paintComponent"); + Dimension size = getSize(); if ((size.width != sizeW) || (size.height != sizeH)) { // component has been resized @@ -429,7 +421,6 @@ public class PdeEditorStatus extends JPanel implements ActionListener { protected void setup() { if (yesButton == null) { - yesButton = new JButton(PdePreferences.PROMPT_YES); noButton = new JButton(PdePreferences.PROMPT_NO); cancelButton = new JButton(PdePreferences.PROMPT_CANCEL); diff --git a/build/macosx/run.sh b/build/macosx/run.sh index 31d02e2bc..3a3591f4c 100755 --- a/build/macosx/run.sh +++ b/build/macosx/run.sh @@ -15,5 +15,5 @@ CLASSPATH=/System/Library/Java/Extensions/QTJava.zip:lib:lib/build:lib/pde.jar:l export CLASSPATH #cd work && /System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Commands/java -Dcom.apple.macos.useScreenMenuBar=true PdeBase + cd work && java -Dapple.laf.useScreenMenuBar=true PdeBase -#cd work && java PdeBase