mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
merging changes over from processing-007X branch
This commit is contained in:
@@ -2,10 +2,11 @@
|
||||
|
||||
/*
|
||||
PdeCompiler - default compiler class that connects to jikes
|
||||
Part of the Processing project - http://Proce55ing.net
|
||||
Part of the Processing project - http://processing.org
|
||||
|
||||
Except where noted, code is written by Ben Fry and
|
||||
Copyright (c) 2001-03 Massachusetts Institute of Technology
|
||||
Copyright (c) 2001-03
|
||||
Ben Fry, Massachusetts Institute of Technology and
|
||||
Casey Reas, Interaction Design Institute Ivrea
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -328,7 +329,7 @@ public class PdeCompiler implements PdeMessageConsumer {
|
||||
int importCount = 0;
|
||||
|
||||
String pieces[] =
|
||||
BApplet.splitStrings(path, File.pathSeparatorChar);
|
||||
BApplet.split(path, File.pathSeparatorChar);
|
||||
|
||||
for (int i = 0; i < pieces.length; i++) {
|
||||
//System.out.println("checking piece " + pieces[i]);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
PdeCompilerJavac - compiler interface to kjc.. someday this will go away
|
||||
Part of the Processing project - http://Proce55ing.net
|
||||
Part of the Processing project - http://processing.org
|
||||
|
||||
Except where noted, code is written by Ben Fry and
|
||||
Copyright (c) 2001-03 Massachusetts Institute of Technology
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
PdeEditorButtons - run/stop/etc buttons for the ide
|
||||
Part of the Processing project - http://Proce55ing.net
|
||||
Part of the Processing project - http://processing.org
|
||||
|
||||
Except where noted, code is written by Ben Fry and
|
||||
Copyright (c) 2001-03 Massachusetts Institute of Technology
|
||||
|
||||
@@ -45,6 +45,9 @@ public class PdeEditorConsole extends JScrollPane {
|
||||
|
||||
boolean cerror;
|
||||
|
||||
//int maxCharCount;
|
||||
int maxLineCount;
|
||||
|
||||
static PrintStream systemOut;
|
||||
static PrintStream systemErr;
|
||||
|
||||
@@ -192,13 +195,41 @@ public class PdeEditorConsole extends JScrollPane {
|
||||
|
||||
private void appendText(String text, boolean err) {
|
||||
try {
|
||||
// check how many lines have been used so far
|
||||
// if too many, shave off a few lines from the beginning
|
||||
Element element = consoleDoc.getDefaultRootElement();
|
||||
int lineCount = element.getElementCount();
|
||||
int overage = lineCount - maxLineCount;
|
||||
if (overage > 0) {
|
||||
// if 1200 lines, and 1000 lines is max,
|
||||
// find the position of the end of the 200th line
|
||||
Element lineElement = element.getElement(overage);
|
||||
int endOffset = lineElement.getEndOffset();
|
||||
// remove to the end of the 200th line
|
||||
consoleDoc.remove(0, endOffset);
|
||||
}
|
||||
|
||||
// add the text to the end of the console,
|
||||
consoleDoc.insertString(consoleDoc.getLength(), text,
|
||||
err ? errStyle : stdStyle);
|
||||
|
||||
// always move to the end of the text as it's added [fry]
|
||||
// always move to the end of the text as it's added
|
||||
consoleTextPane.setCaretPosition(consoleDoc.getLength());
|
||||
|
||||
} catch (Exception e) { }
|
||||
} catch (BadLocationException e) {
|
||||
// ignore the error otherwise this will cause an infinite loop
|
||||
// maybe not a good idea in the long run?
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void clear() {
|
||||
try {
|
||||
consoleDoc.remove(0, consoleDoc.getLength());
|
||||
} catch (BadLocationException e) {
|
||||
// ignore the error otherwise this will cause an infinite loop
|
||||
// maybe not a good idea in the long run?
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -103,6 +103,9 @@ public class PdeEditorFind extends JFrame implements ActionListener {
|
||||
}
|
||||
pain.add(buttons);
|
||||
|
||||
// 0069 TEMPORARILY DISABLED!
|
||||
replaceAllButton.setEnabled(false);
|
||||
|
||||
// to fix ugliness.. normally macosx java 1.3 puts an
|
||||
// ugly white border around this object, so turn it off.
|
||||
if (PdeBase.platform == PdeBase.MACOSX) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
PdeEditorStatus - panel containing status messages
|
||||
Part of the Processing project - http://Proce55ing.net
|
||||
Part of the Processing project - http://processing.org
|
||||
|
||||
Except where noted, code is written by Ben Fry and
|
||||
Copyright (c) 2001-03 Massachusetts Institute of Technology
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
PdeException - an exception with a line number attached
|
||||
Part of the Processing project - http://Proce55ing.net
|
||||
Part of the Processing project - http://processing.org
|
||||
|
||||
Except where noted, code is written by Ben Fry and
|
||||
Copyright (c) 2001-03 Massachusetts Institute of Technology
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
/*
|
||||
PdeFontBuilder - gui interface to font creation heaven/hell
|
||||
Part of the Processing project - http://Proce55ing.net
|
||||
Part of the Processing project - http://processing.org
|
||||
|
||||
Except where noted, code is written by Ben Fry and
|
||||
Copyright (c) 2001-03 Massachusetts Institute of Technology
|
||||
@@ -63,9 +63,18 @@ public class PdeFontBuilder extends JFrame {
|
||||
public PdeFontBuilder(File targetFolder) {
|
||||
super("Create Font");
|
||||
|
||||
this.targetFolder = targetFolder;
|
||||
Container paine = getContentPane();
|
||||
paine.setLayout(new BorderLayout()); //10, 10));
|
||||
|
||||
//Dimension d = new Dimension(5, 5);
|
||||
//paine.add(new Box.Filler(d, d, d), BorderLayout.WEST);
|
||||
|
||||
JPanel pain = new JPanel();
|
||||
//pain.setBorder(BorderFactory.createLineBorder(Color.black));
|
||||
//pain.setBorder(new EmptyBorder(10, 20, 20, 20));
|
||||
pain.setBorder(new EmptyBorder(13, 13, 13, 13));
|
||||
paine.add(pain, BorderLayout.CENTER);
|
||||
|
||||
Container pain = getContentPane();
|
||||
pain.setLayout(new BoxLayout(pain, BoxLayout.Y_AXIS));
|
||||
|
||||
String labelText =
|
||||
@@ -75,7 +84,10 @@ public class PdeFontBuilder extends JFrame {
|
||||
|
||||
//JLabel label = new JLabel(labelText);
|
||||
JTextArea textarea = new JTextArea(labelText);
|
||||
textarea.setBorder(new EmptyBorder(10, 20, 10, 20));
|
||||
textarea.setBorder(new EmptyBorder(10, 10, 20, 10));
|
||||
textarea.setBackground(null);
|
||||
textarea.setEditable(false);
|
||||
textarea.setHighlighter(null);
|
||||
textarea.setFont(new Font("Dialog", Font.PLAIN, 12));
|
||||
pain.add(textarea);
|
||||
//pain.add(label);
|
||||
@@ -104,26 +116,34 @@ public class PdeFontBuilder extends JFrame {
|
||||
// don't care about families starting with . or #
|
||||
// also ignore dialog, dialoginput, monospaced, serif, sansserif
|
||||
|
||||
#ifdef JDK13
|
||||
// getFontList is deprecated in 1.4, so this has to be used
|
||||
GraphicsEnvironment ge =
|
||||
GraphicsEnvironment.getLocalGraphicsEnvironment();
|
||||
|
||||
//Font fonts[] = ge.getAllFonts();
|
||||
String flist[] = ge.getAvailableFontFamilyNames();
|
||||
#else
|
||||
//fontSelector = new JComboBox();
|
||||
String flist[] = Toolkit.getDefaultToolkit().getFontList();
|
||||
#endif
|
||||
Font fonts[] = ge.getAllFonts();
|
||||
String flist[] = new String[fonts.length];
|
||||
|
||||
int index = 0;
|
||||
//String flist[] = ge.getAvailableFontFamilyNames();
|
||||
//fontSelector = new JComboBox();
|
||||
// old jdk11 version
|
||||
//String flist[] = Toolkit.getDefaultToolkit().getFontList();
|
||||
|
||||
/*
|
||||
for (int i = 0; i < flist.length; i++) {
|
||||
if ((flist[i].indexOf('.') == 0) || (flist[i].indexOf('#') == 0) ||
|
||||
(flist[i].equals("Dialog")) || (flist[i].equals("DialogInput")) ||
|
||||
(flist[i].equals("Serif")) || (flist[i].equals("SansSerif")) ||
|
||||
(flist[i].equals("Monospaced"))) continue;
|
||||
flist[index++] = flist[i];
|
||||
//flist[index++] = flist[i];
|
||||
Font f = new Font(flist[i], Font.PLAIN, 1);
|
||||
flist[index++] = f.getPSName();
|
||||
}
|
||||
*/
|
||||
int index = 0;
|
||||
for (int i = 0; i < fonts.length; i++) {
|
||||
flist[index++] = fonts[i].getPSName();
|
||||
}
|
||||
|
||||
list = new String[index];
|
||||
System.arraycopy(flist, 0, list, 0, index);
|
||||
|
||||
@@ -163,6 +183,7 @@ public class PdeFontBuilder extends JFrame {
|
||||
});
|
||||
|
||||
fontSelector.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
|
||||
fontSelector.setVisibleRowCount(12);
|
||||
JScrollPane fontScroller = new JScrollPane(fontSelector);
|
||||
pain.add(fontScroller);
|
||||
//fontSelector.setFont(new Font("SansSerif", Font.PLAIN, 10));
|
||||
@@ -174,6 +195,10 @@ public class PdeFontBuilder extends JFrame {
|
||||
});
|
||||
*/
|
||||
|
||||
Dimension d1 = new Dimension(13, 13);
|
||||
//paine.add(new Box.Filler(d, d, d), BorderLayout.WEST);
|
||||
pain.add(new Box.Filler(d1, d1, d1));
|
||||
|
||||
// see http://rinkworks.com/words/pangrams.shtml
|
||||
sample = new JTextArea("The quick brown fox blah blah.") {
|
||||
//"Forsaking monastic tradition, twelve jovial friars gave up their vocation for a questionable existence on the flying trapeze.") {
|
||||
@@ -219,6 +244,9 @@ public class PdeFontBuilder extends JFrame {
|
||||
panel.add(styleSelector);
|
||||
*/
|
||||
|
||||
Dimension d2 = new Dimension(6, 6);
|
||||
pain.add(new Box.Filler(d2, d2, d2));
|
||||
|
||||
JPanel panel = new JPanel();
|
||||
panel.add(new JLabel("Size:"));
|
||||
sizeSelector = new JTextField("48 ");
|
||||
@@ -238,9 +266,7 @@ public class PdeFontBuilder extends JFrame {
|
||||
smoothBox = new JCheckBox("Smooth");
|
||||
smoothBox.addActionListener(new ActionListener() {
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
//System.out.println(e);
|
||||
smooth = smoothBox.isSelected();
|
||||
//System.out.println(smooth);
|
||||
}
|
||||
});
|
||||
smoothBox.setSelected(smooth);
|
||||
@@ -290,6 +316,11 @@ public class PdeFontBuilder extends JFrame {
|
||||
|
||||
setLocation((screen.width - size.width) / 2,
|
||||
(screen.height - size.height) / 2);
|
||||
}
|
||||
|
||||
|
||||
public void show(File targetFolder) {
|
||||
this.targetFolder = targetFolder;
|
||||
show();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user