MCPcopy Index your code
hub / github.com/processing/processing / init

Method init

app/src/processing/app/tools/CreateFont.java:85–297  ·  view source on GitHub ↗
(Base base)

Source from the content-addressed store, hash-verified

83
84
85 public void init(Base base) {
86 this.base = base;
87
88 Container paine = getContentPane();
89 paine.setLayout(new BorderLayout()); //10, 10));
90
91 JPanel pain = new JPanel();
92 pain.setBorder(new EmptyBorder(13, 13, 13, 13));
93 paine.add(pain, BorderLayout.CENTER);
94
95 pain.setLayout(new BoxLayout(pain, BoxLayout.Y_AXIS));
96
97 String labelText = Language.text("create_font.label");
98
99 JTextArea textarea = new JTextArea(labelText);
100 textarea.setBorder(new EmptyBorder(10, 10, 20, 10));
101 textarea.setBackground(null);
102 textarea.setEditable(false);
103 textarea.setHighlighter(null);
104 textarea.setFont(new Font("Dialog", Font.PLAIN, 12));
105 pain.add(textarea);
106
107 // don't care about families starting with . or #
108 // also ignore dialog, dialoginput, monospaced, serif, sansserif
109
110 // getFontList is deprecated in 1.4, so this has to be used
111 //long t = System.currentTimeMillis();
112 GraphicsEnvironment ge =
113 GraphicsEnvironment.getLocalGraphicsEnvironment();
114 Font[] fonts = ge.getAllFonts();
115 //System.out.println("font startup took " + (System.currentTimeMillis() - t) + " ms");
116
117 /*
118 if (false) {
119 ArrayList<Font> fontList = new ArrayList<Font>();
120 File folderList = new File("/Users/fry/coconut/sys/fonts/web");
121 for (File folder : folderList.listFiles()) {
122 if (folder.isDirectory()) {
123 File[] items = folder.listFiles(new FilenameFilter() {
124 public boolean accept(File dir, String name) {
125 if (name.charAt(0) == '.') return false;
126 return (name.toLowerCase().endsWith(".ttf") ||
127 name.toLowerCase().endsWith(".otf"));
128 }
129 });
130 for (File fontFile : items) {
131 try {
132 FileInputStream fis = new FileInputStream(fontFile);
133 BufferedInputStream input = new BufferedInputStream(fis);
134 Font font = Font.createFont(Font.TRUETYPE_FONT, input);
135 input.close();
136 fontList.add(font);
137
138 } catch (Exception e) {
139 System.out.println("Ignoring " + fontFile.getName());
140 }
141 }
142 }

Callers

nothing calls this directly

Calls 14

textMethod · 0.95
setIconMethod · 0.95
setBorderMethod · 0.80
setEditableMethod · 0.80
arraycopyMethod · 0.80
addDocumentListenerMethod · 0.80
setResizableMethod · 0.65
setLayoutMethod · 0.45
addMethod · 0.45
putMethod · 0.45
printStackTraceMethod · 0.45

Tested by

no test coverage detected