rem
stringlengths
0
477k
add
stringlengths
0
313k
context
stringlengths
6
599k
thumbRect.width = getMinimumThumbSize().width; thumbRect.height = trackRect.height;
thumbRect.x = trackRect.x; thumbRect.y = trackRect.y; if (scrollbar.getOrientation() == HORIZONTAL) { thumbRect.width = getMinimumThumbSize().width; thumbRect.height = trackRect.height; } else { thumbRect.width = trackRect.width; thumbRect.height = getMinimumThumbSize().height; } return thumbRect;
protected Rectangle getThumbBounds() { int max = scrollbar.getMaximum(); int min = scrollbar.getMinimum(); int value = scrollbar.getValue(); int extent = scrollbar.getVisibleAmount(); // System.err.println(this + ".getThumbBounds()"); if (max == min) { thumbRect.x = trackRect.x; thumbRect.y = trackRect.y; if (scrollbar.getOrientation() == HORIZONTAL) { thumbRect.width = getMinimumThumbSize().width; thumbRect.height = trackRect.height; } else { thumbRect.width = trackRect.width; thumbRect.height = getMinimumThumbSize().height; } return thumbRect; } if (scrollbar.getOrientation() == HORIZONTAL) { thumbRect.x = trackRect.x; thumbRect.x += (value - min) * trackRect.width / (max - min); thumbRect.y = trackRect.y; thumbRect.width = Math.max(extent * trackRect.width / (max - min), getMinimumThumbSize().width); thumbRect.height = trackRect.height; } else { thumbRect.x = trackRect.x; thumbRect.y = trackRect.y + value * trackRect.height / (max - min); thumbRect.width = trackRect.width; thumbRect.height = Math.max(extent * trackRect.height / (max - min), getMinimumThumbSize().height); } return thumbRect; }
else { thumbRect.width = trackRect.width; thumbRect.height = getMinimumThumbSize().height; } return thumbRect; }
protected Rectangle getThumbBounds() { int max = scrollbar.getMaximum(); int min = scrollbar.getMinimum(); int value = scrollbar.getValue(); int extent = scrollbar.getVisibleAmount(); // System.err.println(this + ".getThumbBounds()"); if (max == min) { thumbRect.x = trackRect.x; thumbRect.y = trackRect.y; if (scrollbar.getOrientation() == HORIZONTAL) { thumbRect.width = getMinimumThumbSize().width; thumbRect.height = trackRect.height; } else { thumbRect.width = trackRect.width; thumbRect.height = getMinimumThumbSize().height; } return thumbRect; } if (scrollbar.getOrientation() == HORIZONTAL) { thumbRect.x = trackRect.x; thumbRect.x += (value - min) * trackRect.width / (max - min); thumbRect.y = trackRect.y; thumbRect.width = Math.max(extent * trackRect.width / (max - min), getMinimumThumbSize().width); thumbRect.height = trackRect.height; } else { thumbRect.x = trackRect.x; thumbRect.y = trackRect.y + value * trackRect.height / (max - min); thumbRect.width = trackRect.width; thumbRect.height = Math.max(extent * trackRect.height / (max - min), getMinimumThumbSize().height); } return thumbRect; }
scrollTimer = new Timer(50, null); scrollTimer.setRepeats(true);
scrollTimer = new Timer(300, null);
public void installUI(JComponent c) { super.installUI(c); if (c instanceof JScrollBar) { scrollbar = (JScrollBar) c; trackRect = new Rectangle(); thumbRect = new Rectangle(); scrollTimer = new Timer(50, null); scrollTimer.setRepeats(true); installComponents(); installDefaults(); configureScrollBarColors(); installListeners(); calculatePreferredSize(); } }
updateImage(dirty);
updateImage(r);
public void updateDirty() { // update the image updateImage(dirty); // update dirty to show that we have already painted that region of the // screen so do not do it again. dirty.setBounds(dirty.x,dirty.height,dirty.width,(int)(tArea.getHeight() - dirty.height)); }
Element el = view.getElement();
public float getSpan(GlyphView view, int p0, int p1, TabExpander te, float x) { Element el = view.getElement(); Font font = view.getFont(); FontMetrics fm = Toolkit.getDefaultToolkit().getFontMetrics(font); Segment txt = view.getText(p0, p1); int span = Utilities.getTabbedTextWidth(txt, fm, (int) x, te, p0); return span; }
int width = fm.charsWidth(txt.array, txt.offset, txt.count);
Rectangle bounds = a instanceof Rectangle ? (Rectangle) a : a.getBounds(); TabExpander expander = view.getTabExpander(); int width = Utilities.getTabbedTextWidth(txt, fm, bounds.x, expander, view.getStartOffset());
public Shape modelToView(GlyphView view, int pos, Position.Bias b, Shape a) throws BadLocationException { Element el = view.getElement(); Font font = view.getFont(); FontMetrics fm = view.getContainer().getFontMetrics(font); Segment txt = view.getText(el.getStartOffset(), pos); int width = fm.charsWidth(txt.array, txt.offset, txt.count); int height = fm.getHeight(); Rectangle bounds = a.getBounds(); Rectangle result = new Rectangle(bounds.x + width, bounds.y, bounds.x + width, height); return result; }
Rectangle bounds = a.getBounds();
public Shape modelToView(GlyphView view, int pos, Position.Bias b, Shape a) throws BadLocationException { Element el = view.getElement(); Font font = view.getFont(); FontMetrics fm = view.getContainer().getFontMetrics(font); Segment txt = view.getText(el.getStartOffset(), pos); int width = fm.charsWidth(txt.array, txt.offset, txt.count); int height = fm.getHeight(); Rectangle bounds = a.getBounds(); Rectangle result = new Rectangle(bounds.x + width, bounds.y, bounds.x + width, height); return result; }
bounds.x + width, height);
0, height);
public Shape modelToView(GlyphView view, int pos, Position.Bias b, Shape a) throws BadLocationException { Element el = view.getElement(); Font font = view.getFont(); FontMetrics fm = view.getContainer().getFontMetrics(font); Segment txt = view.getText(el.getStartOffset(), pos); int width = fm.charsWidth(txt.array, txt.offset, txt.count); int height = fm.getHeight(); Rectangle bounds = a.getBounds(); Rectangle result = new Rectangle(bounds.x + width, bounds.y, bounds.x + width, height); return result; }
if (view.isSuperscript()) Utilities.drawTabbedText(txt, bounds.x, bounds.y + ascent - height / 2, g, tabEx, txt.offset); else if (view.isSubscript()) Utilities.drawTabbedText(txt, bounds.x, bounds.y + ascent + height / 2, g, tabEx, txt.offset); else
public void paint(GlyphView view, Graphics g, Shape a, int p0, int p1) { Color oldColor = g.getColor(); int height = (int) getHeight(view); Segment txt = view.getText(p0, p1); Rectangle bounds = a.getBounds(); TabExpander tabEx = null; View parent = view.getParent(); if (parent instanceof TabExpander) tabEx = (TabExpander) parent; int width = Utilities.getTabbedTextWidth(txt, g.getFontMetrics(), bounds.x, tabEx, txt.offset); // Fill the background of the text run. Color background = view.getBackground(); if (background != null) { g.setColor(background); g.fillRect(bounds.x, bounds.y, width, height); } // Draw the actual text. g.setColor(view.getForeground()); g.setFont(view.getFont()); int ascent = g.getFontMetrics().getAscent(); if (view.isSuperscript()) // TODO: Adjust font for superscripting. Utilities.drawTabbedText(txt, bounds.x, bounds.y + ascent - height / 2, g, tabEx, txt.offset); else if (view.isSubscript()) // TODO: Adjust font for subscripting. Utilities.drawTabbedText(txt, bounds.x, bounds.y + ascent + height / 2, g, tabEx, txt.offset); else Utilities.drawTabbedText(txt, bounds.x, bounds.y + ascent, g, tabEx, txt.offset); if (view.isStrikeThrough()) { int strikeHeight = (int) (getAscent(view) / 2); g.drawLine(bounds.x, bounds.y + strikeHeight, bounds.height + width, bounds.y + strikeHeight); } if (view.isUnderline()) { int lineHeight = (int) getAscent(view); g.drawLine(bounds.x, bounds.y + lineHeight, bounds.height + width, bounds.y + lineHeight); } g.setColor(oldColor); }
g.drawLine(bounds.x, bounds.y + strikeHeight, bounds.height + width,
g.drawLine(bounds.x, bounds.y + strikeHeight, bounds.x + width,
public void paint(GlyphView view, Graphics g, Shape a, int p0, int p1) { Color oldColor = g.getColor(); int height = (int) getHeight(view); Segment txt = view.getText(p0, p1); Rectangle bounds = a.getBounds(); TabExpander tabEx = null; View parent = view.getParent(); if (parent instanceof TabExpander) tabEx = (TabExpander) parent; int width = Utilities.getTabbedTextWidth(txt, g.getFontMetrics(), bounds.x, tabEx, txt.offset); // Fill the background of the text run. Color background = view.getBackground(); if (background != null) { g.setColor(background); g.fillRect(bounds.x, bounds.y, width, height); } // Draw the actual text. g.setColor(view.getForeground()); g.setFont(view.getFont()); int ascent = g.getFontMetrics().getAscent(); if (view.isSuperscript()) // TODO: Adjust font for superscripting. Utilities.drawTabbedText(txt, bounds.x, bounds.y + ascent - height / 2, g, tabEx, txt.offset); else if (view.isSubscript()) // TODO: Adjust font for subscripting. Utilities.drawTabbedText(txt, bounds.x, bounds.y + ascent + height / 2, g, tabEx, txt.offset); else Utilities.drawTabbedText(txt, bounds.x, bounds.y + ascent, g, tabEx, txt.offset); if (view.isStrikeThrough()) { int strikeHeight = (int) (getAscent(view) / 2); g.drawLine(bounds.x, bounds.y + strikeHeight, bounds.height + width, bounds.y + strikeHeight); } if (view.isUnderline()) { int lineHeight = (int) getAscent(view); g.drawLine(bounds.x, bounds.y + lineHeight, bounds.height + width, bounds.y + lineHeight); } g.setColor(oldColor); }
g.drawLine(bounds.x, bounds.y + lineHeight, bounds.height + width,
g.drawLine(bounds.x, bounds.y + lineHeight, bounds.x + width,
public void paint(GlyphView view, Graphics g, Shape a, int p0, int p1) { Color oldColor = g.getColor(); int height = (int) getHeight(view); Segment txt = view.getText(p0, p1); Rectangle bounds = a.getBounds(); TabExpander tabEx = null; View parent = view.getParent(); if (parent instanceof TabExpander) tabEx = (TabExpander) parent; int width = Utilities.getTabbedTextWidth(txt, g.getFontMetrics(), bounds.x, tabEx, txt.offset); // Fill the background of the text run. Color background = view.getBackground(); if (background != null) { g.setColor(background); g.fillRect(bounds.x, bounds.y, width, height); } // Draw the actual text. g.setColor(view.getForeground()); g.setFont(view.getFont()); int ascent = g.getFontMetrics().getAscent(); if (view.isSuperscript()) // TODO: Adjust font for superscripting. Utilities.drawTabbedText(txt, bounds.x, bounds.y + ascent - height / 2, g, tabEx, txt.offset); else if (view.isSubscript()) // TODO: Adjust font for subscripting. Utilities.drawTabbedText(txt, bounds.x, bounds.y + ascent + height / 2, g, tabEx, txt.offset); else Utilities.drawTabbedText(txt, bounds.x, bounds.y + ascent, g, tabEx, txt.offset); if (view.isStrikeThrough()) { int strikeHeight = (int) (getAscent(view) / 2); g.drawLine(bounds.x, bounds.y + strikeHeight, bounds.height + width, bounds.y + strikeHeight); } if (view.isUnderline()) { int lineHeight = (int) getAscent(view); g.drawLine(bounds.x, bounds.y + lineHeight, bounds.height + width, bounds.y + lineHeight); } g.setColor(oldColor); }
GlyphPainter painter = getGlyphPainter();
public View breakView(int axis, int p0, float pos, float len) { if (axis == Y_AXIS) return this; checkPainter(); GlyphPainter painter = getGlyphPainter(); // Try to find a suitable line break. BreakIterator lineBreaker = BreakIterator.getLineInstance(); Segment txt = new Segment(); try { int start = getStartOffset(); int length = getEndOffset() - start; getDocument().getText(start, length, txt); } catch (BadLocationException ex) { AssertionError err = new AssertionError("BadLocationException must not " + "be thrown here."); err.initCause(ex); throw err; } int breakLocation = Utilities.getBreakLocation(txt, getContainer().getFontMetrics(getFont()), (int) pos, (int) (pos + len), getTabExpander(), p0); View brokenView = createFragment(p0, breakLocation); return brokenView; }
BreakIterator lineBreaker = BreakIterator.getLineInstance();
public View breakView(int axis, int p0, float pos, float len) { if (axis == Y_AXIS) return this; checkPainter(); GlyphPainter painter = getGlyphPainter(); // Try to find a suitable line break. BreakIterator lineBreaker = BreakIterator.getLineInstance(); Segment txt = new Segment(); try { int start = getStartOffset(); int length = getEndOffset() - start; getDocument().getText(start, length, txt); } catch (BadLocationException ex) { AssertionError err = new AssertionError("BadLocationException must not " + "be thrown here."); err.initCause(ex); throw err; } int breakLocation = Utilities.getBreakLocation(txt, getContainer().getFontMetrics(getFont()), (int) pos, (int) (pos + len), getTabExpander(), p0); View brokenView = createFragment(p0, breakLocation); return brokenView; }
checkPainter();
public float getAlignment(int axis) { float align; if (axis == Y_AXIS) { checkPainter(); GlyphPainter painter = getGlyphPainter(); float height = painter.getHeight(this); float descent = painter.getDescent(this); align = (height - descent) / height; } else align = super.getAlignment(axis); return align; }
align = (height - descent) / height;
float ascent = painter.getAscent(this); if (isSuperscript()) align = 1.0F; else if (isSubscript()) align = height > 0 ? (height - (descent + (ascent / 2))) / height : 0; else align = height > 0 ? (height - descent) / height : 0;
public float getAlignment(int axis) { float align; if (axis == Y_AXIS) { checkPainter(); GlyphPainter painter = getGlyphPainter(); float height = painter.getHeight(this); float descent = painter.getDescent(this); align = (height - descent) / height; } else align = super.getAlignment(axis); return align; }
Element el = getElement(); AttributeSet atts = el.getAttributes(); String family = StyleConstants.getFontFamily(atts); int size = StyleConstants.getFontSize(atts); int style = Font.PLAIN; if (StyleConstants.isBold(atts)) style |= Font.BOLD; if (StyleConstants.isItalic(atts)) style |= Font.ITALIC; Font font = new Font(family, style, size);
Document doc = getDocument(); Font font = null; if (doc instanceof StyledDocument) { StyledDocument styledDoc = (StyledDocument) doc; font = styledDoc.getFont(getAttributes()); } else { Container c = getContainer(); if (c != null) font = c.getFont(); }
public Font getFont() { Element el = getElement(); AttributeSet atts = el.getAttributes(); String family = StyleConstants.getFontFamily(atts); int size = StyleConstants.getFontSize(atts); int style = Font.PLAIN; if (StyleConstants.isBold(atts)) style |= Font.BOLD; if (StyleConstants.isItalic(atts)) style |= Font.ITALIC; Font font = new Font(family, style, size); return font; }
if (axis == X_AXIS)
switch (axis)
public float getPreferredSpan(int axis) { float span = 0; checkPainter(); GlyphPainter painter = getGlyphPainter(); if (axis == X_AXIS) { Element el = getElement(); TabExpander tabEx = null; View parent = getParent(); if (parent instanceof TabExpander) tabEx = (TabExpander) parent; span = painter.getSpan(this, getStartOffset(), getEndOffset(), tabEx, 0.F); } else span = painter.getHeight(this); return span; }
Element el = getElement();
case X_AXIS:
public float getPreferredSpan(int axis) { float span = 0; checkPainter(); GlyphPainter painter = getGlyphPainter(); if (axis == X_AXIS) { Element el = getElement(); TabExpander tabEx = null; View parent = getParent(); if (parent instanceof TabExpander) tabEx = (TabExpander) parent; span = painter.getSpan(this, getStartOffset(), getEndOffset(), tabEx, 0.F); } else span = painter.getHeight(this); return span; }
else span = painter.getHeight(this);
public float getPreferredSpan(int axis) { float span = 0; checkPainter(); GlyphPainter painter = getGlyphPainter(); if (axis == X_AXIS) { Element el = getElement(); TabExpander tabEx = null; View parent = getParent(); if (parent instanceof TabExpander) tabEx = (TabExpander) parent; span = painter.getSpan(this, getStartOffset(), getEndOffset(), tabEx, 0.F); } else span = painter.getHeight(this); return span; }
Element el = getElement();
public void paint(Graphics g, Shape a) { Element el = getElement(); checkPainter(); getGlyphPainter().paint(this, g, a, getStartOffset(), getEndOffset()); }
getGlyphPainter().paint(this, g, a, getStartOffset(), getEndOffset());
int p0 = getStartOffset(); int p1 = getEndOffset(); Container c = getContainer(); if (c instanceof JTextComponent) { JTextComponent tc = (JTextComponent) c; Highlighter h = tc.getHighlighter(); if (h instanceof LayeredHighlighter) { LayeredHighlighter lh = (LayeredHighlighter) h; lh.paintLayeredHighlights(g, p0, p1, a, tc, this); } } getGlyphPainter().paint(this, g, a, p0, p1);
public void paint(Graphics g, Shape a) { Element el = getElement(); checkPainter(); getGlyphPainter().paint(this, g, a, getStartOffset(), getEndOffset()); }
{ return 12; }
{ return 13; }
public int getIconHeight() { return 12; }
{ return 12; }
{ return 13; }
public int getIconWidth() { return 12; }
{ g.translate(x, y); Color saved = g.getColor(); g.setColor(Color.BLACK); g.fillPolygon(new Polygon(new int[] { 3, 9, 3 }, new int[] { 2, 6, 10 }, 3)); g.setColor(saved); g.translate(-x, -y); }
{ Color saved = g.getColor(); g.setColor(Color.BLACK); g.drawLine(3 + x, 5 + y, 3 + x, 9 + y); g.drawLine(4 + x, 5 + y, 4 + x, 9 + y); g.drawLine(5 + x, 7 + y, 9 + x, 3 + y); g.drawLine(5 + x, 8 + y, 9 + x, 4 + y); g.setColor(saved); }
public void paintIcon(Component c, Graphics g, int x, int y) { g.translate(x, y); Color saved = g.getColor(); g.setColor(Color.BLACK); g.fillPolygon(new Polygon(new int[] { 3, 9, 3 }, new int[] { 2, 6, 10 }, 3)); g.setColor(saved); g.translate(-x, -y); }
BufferedReader br = new BufferedReader(new InputStreamReader(in, "8859_1"));
BufferedReader br = new BufferedReader(new InputStreamReader(in, "UTF-8"));
public void read(InputStream in) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(in, "8859_1")); read_main_section(getMainAttributes(), br); read_individual_sections(getEntries(), br); }
PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(out, "8859_1"))); write_main_section(getMainAttributes(), pw); pw.println(); write_individual_sections(getEntries(), pw); if (pw.checkError()) { throw new JarException("Error while writing manifest"); }
BufferedOutputStream bos = out instanceof BufferedOutputStream ? (BufferedOutputStream) out : new BufferedOutputStream(out, 4096); write_main_section(getMainAttributes(), bos); bos.write(CRLF); write_individual_sections(getEntries(), bos); bos.flush();
public void write(OutputStream out) throws IOException { PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(out, "8859_1"))); write_main_section(getMainAttributes(), pw); pw.println(); write_individual_sections(getEntries(), pw); if (pw.checkError()) { throw new JarException("Error while writing manifest"); } }
private static void write_attribute_entry(Map.Entry entry, PrintWriter pw) throws JarException
private static void write_attribute_entry(Map.Entry entry, OutputStream out) throws IOException
private static void write_attribute_entry(Map.Entry entry, PrintWriter pw) throws JarException { String name = entry.getKey().toString(); String value = entry.getValue().toString(); if (name.equalsIgnoreCase("Name")) { throw new JarException("Attributes cannot be called 'Name'"); } if (name.startsWith("From")) { throw new JarException("Header cannot start with the four letters 'From'" + name); } write_header(name, value, pw); }
write_header(name, value, pw);
write_header(name, value, out);
private static void write_attribute_entry(Map.Entry entry, PrintWriter pw) throws JarException { String name = entry.getKey().toString(); String value = entry.getValue().toString(); if (name.equalsIgnoreCase("Name")) { throw new JarException("Attributes cannot be called 'Name'"); } if (name.startsWith("From")) { throw new JarException("Header cannot start with the four letters 'From'" + name); } write_header(name, value, pw); }
private static void write_entry_attributes(Attributes attr, PrintWriter pw) throws JarException
private static void write_entry_attributes(Attributes attr, OutputStream out) throws IOException
private static void write_entry_attributes(Attributes attr, PrintWriter pw) throws JarException { Iterator it = attr.entrySet().iterator(); while (it.hasNext()) { Map.Entry entry = (Map.Entry) it.next(); write_attribute_entry(entry, pw); } }
write_attribute_entry(entry, pw);
write_attribute_entry(entry, out);
private static void write_entry_attributes(Attributes attr, PrintWriter pw) throws JarException { Iterator it = attr.entrySet().iterator(); while (it.hasNext()) { Map.Entry entry = (Map.Entry) it.next(); write_attribute_entry(entry, pw); } }
private static void write_header(String name, String value, PrintWriter pw) { pw.print(name + ": ");
private static void write_header(String name, String value, OutputStream out) throws IOException { String target = name + ": "; byte[] b = target.getBytes("UTF-8"); if (b.length > 72) throw new IOException("Attribute's name already longer than 70 bytes");
private static void write_header(String name, String value, PrintWriter pw) { pw.print(name + ": "); int last = 68 - name.length(); if (last > value.length()) { pw.println(value); } else { pw.println(value.substring(0, last)); } while (last < value.length()) { pw.print(" "); int end = (last + 69); if (end > value.length()) { pw.println(value.substring(last)); } else { pw.println(value.substring(last, end)); } last = end; } }
int last = 68 - name.length(); if (last > value.length())
if (b.length == 72)
private static void write_header(String name, String value, PrintWriter pw) { pw.print(name + ": "); int last = 68 - name.length(); if (last > value.length()) { pw.println(value); } else { pw.println(value.substring(0, last)); } while (last < value.length()) { pw.print(" "); int end = (last + 69); if (end > value.length()) { pw.println(value.substring(last)); } else { pw.println(value.substring(last, end)); } last = end; } }
pw.println(value);
out.write(b); out.write(CRLF); target = " " + value;
private static void write_header(String name, String value, PrintWriter pw) { pw.print(name + ": "); int last = 68 - name.length(); if (last > value.length()) { pw.println(value); } else { pw.println(value.substring(0, last)); } while (last < value.length()) { pw.print(" "); int end = (last + 69); if (end > value.length()) { pw.println(value.substring(last)); } else { pw.println(value.substring(last, end)); } last = end; } }
pw.println(value.substring(0, last));
b = target.getBytes("UTF-8"); if (b.length < 73) { out.write(b); break; } n = 72; while (true) { b = target.substring(0, n).getBytes("UTF-8"); if (b.length < 73) break; n--; if (n < 1) throw new IOException("Header is unbreakable and longer than 72 bytes"); } out.write(b); out.write(CRLF); target = " " + target.substring(n);
private static void write_header(String name, String value, PrintWriter pw) { pw.print(name + ": "); int last = 68 - name.length(); if (last > value.length()) { pw.println(value); } else { pw.println(value.substring(0, last)); } while (last < value.length()) { pw.print(" "); int end = (last + 69); if (end > value.length()) { pw.println(value.substring(last)); } else { pw.println(value.substring(last, end)); } last = end; } }
while (last < value.length()) { pw.print(" "); int end = (last + 69); if (end > value.length()) { pw.println(value.substring(last)); } else { pw.println(value.substring(last, end)); } last = end; }
out.write(CRLF);
private static void write_header(String name, String value, PrintWriter pw) { pw.print(name + ": "); int last = 68 - name.length(); if (last > value.length()) { pw.println(value); } else { pw.println(value.substring(0, last)); } while (last < value.length()) { pw.print(" "); int end = (last + 69); if (end > value.length()) { pw.println(value.substring(last)); } else { pw.println(value.substring(last, end)); } last = end; } }
private static void write_individual_sections(Map entries, PrintWriter pw) throws JarException
private static void write_individual_sections(Map entries, OutputStream out) throws IOException
private static void write_individual_sections(Map entries, PrintWriter pw) throws JarException { Iterator it = entries.entrySet().iterator(); while (it.hasNext()) { Map.Entry entry = (Map.Entry) it.next(); write_header("Name", entry.getKey().toString(), pw); write_entry_attributes((Attributes) entry.getValue(), pw); pw.println(); } }
write_header("Name", entry.getKey().toString(), pw); write_entry_attributes((Attributes) entry.getValue(), pw); pw.println();
write_header("Name", entry.getKey().toString(), out); write_entry_attributes((Attributes) entry.getValue(), out); out.write(CRLF);
private static void write_individual_sections(Map entries, PrintWriter pw) throws JarException { Iterator it = entries.entrySet().iterator(); while (it.hasNext()) { Map.Entry entry = (Map.Entry) it.next(); write_header("Name", entry.getKey().toString(), pw); write_entry_attributes((Attributes) entry.getValue(), pw); pw.println(); } }
private static void write_main_attributes(Attributes attr, PrintWriter pw) throws JarException
private static void write_main_attributes(Attributes attr, OutputStream out) throws IOException
private static void write_main_attributes(Attributes attr, PrintWriter pw) throws JarException { Iterator it = attr.entrySet().iterator(); while (it.hasNext()) { Map.Entry entry = (Map.Entry) it.next(); // Don't print the manifest version again if (!Attributes.Name.MANIFEST_VERSION.equals(entry.getKey())) { write_attribute_entry(entry, pw); } } }
{ write_attribute_entry(entry, pw); }
write_attribute_entry(entry, out);
private static void write_main_attributes(Attributes attr, PrintWriter pw) throws JarException { Iterator it = attr.entrySet().iterator(); while (it.hasNext()) { Map.Entry entry = (Map.Entry) it.next(); // Don't print the manifest version again if (!Attributes.Name.MANIFEST_VERSION.equals(entry.getKey())) { write_attribute_entry(entry, pw); } } }
private static void write_main_section(Attributes attr, PrintWriter pw) throws JarException
private static void write_main_section(Attributes attr, OutputStream out) throws IOException
private static void write_main_section(Attributes attr, PrintWriter pw) throws JarException { write_version_info(attr, pw); write_main_attributes(attr, pw); }
write_version_info(attr, pw); write_main_attributes(attr, pw);
write_version_info(attr, out); write_main_attributes(attr, out);
private static void write_main_section(Attributes attr, PrintWriter pw) throws JarException { write_version_info(attr, pw); write_main_attributes(attr, pw); }
private static void write_version_info(Attributes attr, PrintWriter pw)
private static void write_version_info(Attributes attr, OutputStream out) throws IOException
private static void write_version_info(Attributes attr, PrintWriter pw) { // First check if there is already a version attribute set String version = attr.getValue(Attributes.Name.MANIFEST_VERSION); if (version == null) { version = "1.0"; } write_header(Attributes.Name.MANIFEST_VERSION.toString(), version, pw); }
write_header(Attributes.Name.MANIFEST_VERSION.toString(), version, pw);
write_header(Attributes.Name.MANIFEST_VERSION.toString(), version, out);
private static void write_version_info(Attributes attr, PrintWriter pw) { // First check if there is already a version attribute set String version = attr.getValue(Attributes.Name.MANIFEST_VERSION); if (version == null) { version = "1.0"; } write_header(Attributes.Name.MANIFEST_VERSION.toString(), version, pw); }
bad.minor = Minor.Any;
public static UnknownEncoding extract(Any any) { try { EmptyExceptionHolder h = (EmptyExceptionHolder) any.extract_Streamable(); return (UnknownEncoding) h.value; } catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("UnknownEncoding expected"); bad.initCause(cex); throw bad; } }
public final boolean contains(Class cls) { return contains(cls.getName());
public final boolean contains(String className) { if (exceptions != null) { final int length = exceptions.length; for (int i = 0; i < length; i++) { final String name = exceptions[i].getClassName(); if (name.equals(className)) { return true; } } } return false;
public final boolean contains(Class cls) { return contains(cls.getName()); }
public PointerEvent(int buttons, int x, int y, boolean absolute) { this(buttons, x, y, 0, absolute);
public PointerEvent(int buttons, int x, int y, int z, boolean absolute) { this.buttons = buttons; this.x = x; this.y = y; this.z = z; this.absolute = absolute;
public PointerEvent(int buttons, int x, int y, boolean absolute) { this(buttons, x, y, 0, absolute); }
public void parse(Reader reader, HTMLEditorKit.ParserCallback a_callback,
public void parse(Reader reader, HTMLEditorKit.ParserCallback aCallback,
public void parse(Reader reader, HTMLEditorKit.ParserCallback a_callback, boolean ignoreCharSet ) throws IOException { callBack = a_callback; gnu.parse(reader); callBack.handleEndOfLineString(gnu.getEndOfLineSequence()); try { callBack.flush(); } catch (BadLocationException ex) { // Convert this into the supported type of exception. throw new IOException(ex.getMessage()); } }
callBack = a_callback;
callBack = aCallback;
public void parse(Reader reader, HTMLEditorKit.ParserCallback a_callback, boolean ignoreCharSet ) throws IOException { callBack = a_callback; gnu.parse(reader); callBack.handleEndOfLineString(gnu.getEndOfLineSequence()); try { callBack.flush(); } catch (BadLocationException ex) { // Convert this into the supported type of exception. throw new IOException(ex.getMessage()); } }
if (i == -1) { done = true; continue; }
public final byte[] readIncoming() throws IOException { boolean done = false; boolean negotiate = false; baosin.reset(); int j = -1; int i = 0; while(!done) { i = bin.read(); // We use the values instead of the static values IAC and EOR // because they are defined as bytes. // // The > if(i != 255 || j != 255) < is a hack for the double FF FF's // that are being returned. I do not know why this is like this and // can not find any documentation for it. It is also being returned // on my Client Access tcp dump as well so they are handling it. // // my5250 // 0000: 00 50 DA 44 C8 45 42 00 00 00 00 24 08 00 45 00 .P.D.EB....$..E. // 0010: 04 2A BC F9 00 00 40 06 D0 27 C1 A8 33 04 C1 A8 .*....@..'..3... // 0020: 33 58 00 17 04 18 6F A2 83 CB 00 1E D1 BA 50 18 3X....o.......P. // 0030: 20 00 8A 9A 00 00 03 FF FF 12 A0 00 00 04 00 00 ............... // --------------------------- || || ------------------------------------- // 0040: 03 04 40 04 11 00 20 01 07 00 00 00 18 00 00 10 ..@... ......... if(j == 255 && i == 255) { j = -1; continue; } else { baosin.write(i); // check for end of record EOR and IAC - FFEF if(j == 255 && i == 239) done = true; // This is to check for the TELNET TIMING MARK OPTION // rfc860 explains this in more detail. When we receive it // we will negotiate with the server by sending a WONT'T TIMING-MARK // This will let the server know that we processed the information // and are just waiting for the user to enter some data so keep the // socket alive. This is more or less a AYT (ARE YOU THERE) or not. if(i == 253 && j == 255) { done = true; negotiate = true; } j = i; } } // after the initial negotiation we might get other options such as // timing marks ?????????????? do we ???????????? look at telnet spec // yes we do. rfc860 explains about timing marks. if (negotiate) { // get the negotiation option baosin.write(bin.read()); vt.negotiate(baosin.toByteArray()); } if (dumpBytes) { dump(baosin.toByteArray()); } return baosin.toByteArray(); }
loadStream(abyte0, 0);
if (abyte0.length > 0) { loadStream(abyte0, 0); } else { done = true; vt.disconnect(); }
public final void run() { boolean done = false; me = Thread.currentThread(); // load the first response screen try { loadStream(abyte2, 0); } catch (IOException ioef) { System.out.println(" run() " + ioef.getMessage()); } while (!done) { try { byte[] abyte0 = readIncoming(); loadStream(abyte0, 0); } catch (SocketException se) {// System.out.println(" DataStreamProducer thread interrupted and stopping " + se.getMessage()); System.out.println(" DataStreamProducer thread interrupted and stopping "); done = true; } catch (IOException ioe) {// System.out.println(ioe.getMessage()); if (me.isInterrupted()) done = true; } catch (Exception ex) { System.out.println(ex.getMessage()); if (me.isInterrupted()) done = true; } } }
int elementIndex = rootElement.getElementIndex(offset);
int oldElementIndex, elementIndex = rootElement.getElementIndex(offset);
protected void insertUpdate(DefaultDocumentEvent event, AttributeSet attributes) { int offset = event.getOffset(); int end = offset + event.getLength(); int elementIndex = rootElement.getElementIndex(offset); Element firstElement = rootElement.getElement(elementIndex); // If we're inserting immediately after a newline we have to fix the // Element structure. if (offset > 0) { try { String s = getText(offset - 1, 1); if (s.equals("\n")) { int newEl2EndOffset = end; boolean replaceNext = false; if (rootElement.getElementCount() > elementIndex + 1) { replaceNext = true; newEl2EndOffset = rootElement.getElement(elementIndex + 1).getEndOffset(); } Element newEl1 = createLeafElement(rootElement, firstElement.getAttributes(), firstElement.getStartOffset(), offset); Element newEl2 = createLeafElement (rootElement, firstElement.getAttributes(), offset, newEl2EndOffset); if (replaceNext) rootElement.replace(elementIndex, 2, new Element[] { newEl1, newEl2 }); else rootElement.replace(elementIndex, 1, new Element[] { newEl1, newEl2 }); firstElement = newEl2; elementIndex ++; } } catch (BadLocationException ble) { // This shouldn't happen. AssertionError ae = new AssertionError(); ae.initCause(ble); throw ae; } } // added and removed are Element arrays used to add an ElementEdit // to the DocumentEvent if there were entire lines added or removed. Element[] removed = new Element[1]; Element[] added; try { String str = content.getString(0, content.length()); ArrayList elts = new ArrayList(); // Determine how many NEW lines were added by finding the newline // characters within the newly inserted text int j = firstElement.getStartOffset(); int i = str.indexOf('\n', offset); while (i != -1 && i <= end) { // For each new line, create a new element elts.add(createLeafElement(rootElement, SimpleAttributeSet.EMPTY, j, i + 1)); j = i + 1; if (j >= str.length()) break; i = str.indexOf('\n', j); } // If there were new lines added we have to add an ElementEdit to // the DocumentEvent and we have to call rootElement.replace to // insert the new lines if (elts.size() != 0) { // Set up the ElementEdit by filling the added and removed // arrays with the proper Elements added = new Element[elts.size()]; for (int k = 0; k < elts.size(); ++k) added[k] = (Element) elts.get(k); removed[0] = firstElement; // Now create and add the ElementEdit ElementEdit e = new ElementEdit(rootElement, elementIndex, removed, added); event.addEdit(e); // And call replace to actually make the changes ((BranchElement) rootElement).replace(elementIndex, 1, added); } } catch (BadLocationException e) { // This shouldn't happen so we throw an AssertionError AssertionError ae = new AssertionError(); ae.initCause(e); throw ae; } super.insertUpdate(event, attributes); }
if (offset > 0)
if (offset > 0 && firstElement.getStartOffset() != offset)
protected void insertUpdate(DefaultDocumentEvent event, AttributeSet attributes) { int offset = event.getOffset(); int end = offset + event.getLength(); int elementIndex = rootElement.getElementIndex(offset); Element firstElement = rootElement.getElement(elementIndex); // If we're inserting immediately after a newline we have to fix the // Element structure. if (offset > 0) { try { String s = getText(offset - 1, 1); if (s.equals("\n")) { int newEl2EndOffset = end; boolean replaceNext = false; if (rootElement.getElementCount() > elementIndex + 1) { replaceNext = true; newEl2EndOffset = rootElement.getElement(elementIndex + 1).getEndOffset(); } Element newEl1 = createLeafElement(rootElement, firstElement.getAttributes(), firstElement.getStartOffset(), offset); Element newEl2 = createLeafElement (rootElement, firstElement.getAttributes(), offset, newEl2EndOffset); if (replaceNext) rootElement.replace(elementIndex, 2, new Element[] { newEl1, newEl2 }); else rootElement.replace(elementIndex, 1, new Element[] { newEl1, newEl2 }); firstElement = newEl2; elementIndex ++; } } catch (BadLocationException ble) { // This shouldn't happen. AssertionError ae = new AssertionError(); ae.initCause(ble); throw ae; } } // added and removed are Element arrays used to add an ElementEdit // to the DocumentEvent if there were entire lines added or removed. Element[] removed = new Element[1]; Element[] added; try { String str = content.getString(0, content.length()); ArrayList elts = new ArrayList(); // Determine how many NEW lines were added by finding the newline // characters within the newly inserted text int j = firstElement.getStartOffset(); int i = str.indexOf('\n', offset); while (i != -1 && i <= end) { // For each new line, create a new element elts.add(createLeafElement(rootElement, SimpleAttributeSet.EMPTY, j, i + 1)); j = i + 1; if (j >= str.length()) break; i = str.indexOf('\n', j); } // If there were new lines added we have to add an ElementEdit to // the DocumentEvent and we have to call rootElement.replace to // insert the new lines if (elts.size() != 0) { // Set up the ElementEdit by filling the added and removed // arrays with the proper Elements added = new Element[elts.size()]; for (int k = 0; k < elts.size(); ++k) added[k] = (Element) elts.get(k); removed[0] = firstElement; // Now create and add the ElementEdit ElementEdit e = new ElementEdit(rootElement, elementIndex, removed, added); event.addEdit(e); // And call replace to actually make the changes ((BranchElement) rootElement).replace(elementIndex, 1, added); } } catch (BadLocationException e) { // This shouldn't happen so we throw an AssertionError AssertionError ae = new AssertionError(); ae.initCause(e); throw ae; } super.insertUpdate(event, attributes); }
String str = content.getString(0, content.length());
String str = content.getString(offset, eventLength);
protected void insertUpdate(DefaultDocumentEvent event, AttributeSet attributes) { int offset = event.getOffset(); int end = offset + event.getLength(); int elementIndex = rootElement.getElementIndex(offset); Element firstElement = rootElement.getElement(elementIndex); // If we're inserting immediately after a newline we have to fix the // Element structure. if (offset > 0) { try { String s = getText(offset - 1, 1); if (s.equals("\n")) { int newEl2EndOffset = end; boolean replaceNext = false; if (rootElement.getElementCount() > elementIndex + 1) { replaceNext = true; newEl2EndOffset = rootElement.getElement(elementIndex + 1).getEndOffset(); } Element newEl1 = createLeafElement(rootElement, firstElement.getAttributes(), firstElement.getStartOffset(), offset); Element newEl2 = createLeafElement (rootElement, firstElement.getAttributes(), offset, newEl2EndOffset); if (replaceNext) rootElement.replace(elementIndex, 2, new Element[] { newEl1, newEl2 }); else rootElement.replace(elementIndex, 1, new Element[] { newEl1, newEl2 }); firstElement = newEl2; elementIndex ++; } } catch (BadLocationException ble) { // This shouldn't happen. AssertionError ae = new AssertionError(); ae.initCause(ble); throw ae; } } // added and removed are Element arrays used to add an ElementEdit // to the DocumentEvent if there were entire lines added or removed. Element[] removed = new Element[1]; Element[] added; try { String str = content.getString(0, content.length()); ArrayList elts = new ArrayList(); // Determine how many NEW lines were added by finding the newline // characters within the newly inserted text int j = firstElement.getStartOffset(); int i = str.indexOf('\n', offset); while (i != -1 && i <= end) { // For each new line, create a new element elts.add(createLeafElement(rootElement, SimpleAttributeSet.EMPTY, j, i + 1)); j = i + 1; if (j >= str.length()) break; i = str.indexOf('\n', j); } // If there were new lines added we have to add an ElementEdit to // the DocumentEvent and we have to call rootElement.replace to // insert the new lines if (elts.size() != 0) { // Set up the ElementEdit by filling the added and removed // arrays with the proper Elements added = new Element[elts.size()]; for (int k = 0; k < elts.size(); ++k) added[k] = (Element) elts.get(k); removed[0] = firstElement; // Now create and add the ElementEdit ElementEdit e = new ElementEdit(rootElement, elementIndex, removed, added); event.addEdit(e); // And call replace to actually make the changes ((BranchElement) rootElement).replace(elementIndex, 1, added); } } catch (BadLocationException e) { // This shouldn't happen so we throw an AssertionError AssertionError ae = new AssertionError(); ae.initCause(e); throw ae; } super.insertUpdate(event, attributes); }
int i = str.indexOf('\n', offset); while (i != -1 && i <= end)
int i = str.indexOf('\n', 0); int contentLength = content.length(); while (i != -1 && i <= eventLength)
protected void insertUpdate(DefaultDocumentEvent event, AttributeSet attributes) { int offset = event.getOffset(); int end = offset + event.getLength(); int elementIndex = rootElement.getElementIndex(offset); Element firstElement = rootElement.getElement(elementIndex); // If we're inserting immediately after a newline we have to fix the // Element structure. if (offset > 0) { try { String s = getText(offset - 1, 1); if (s.equals("\n")) { int newEl2EndOffset = end; boolean replaceNext = false; if (rootElement.getElementCount() > elementIndex + 1) { replaceNext = true; newEl2EndOffset = rootElement.getElement(elementIndex + 1).getEndOffset(); } Element newEl1 = createLeafElement(rootElement, firstElement.getAttributes(), firstElement.getStartOffset(), offset); Element newEl2 = createLeafElement (rootElement, firstElement.getAttributes(), offset, newEl2EndOffset); if (replaceNext) rootElement.replace(elementIndex, 2, new Element[] { newEl1, newEl2 }); else rootElement.replace(elementIndex, 1, new Element[] { newEl1, newEl2 }); firstElement = newEl2; elementIndex ++; } } catch (BadLocationException ble) { // This shouldn't happen. AssertionError ae = new AssertionError(); ae.initCause(ble); throw ae; } } // added and removed are Element arrays used to add an ElementEdit // to the DocumentEvent if there were entire lines added or removed. Element[] removed = new Element[1]; Element[] added; try { String str = content.getString(0, content.length()); ArrayList elts = new ArrayList(); // Determine how many NEW lines were added by finding the newline // characters within the newly inserted text int j = firstElement.getStartOffset(); int i = str.indexOf('\n', offset); while (i != -1 && i <= end) { // For each new line, create a new element elts.add(createLeafElement(rootElement, SimpleAttributeSet.EMPTY, j, i + 1)); j = i + 1; if (j >= str.length()) break; i = str.indexOf('\n', j); } // If there were new lines added we have to add an ElementEdit to // the DocumentEvent and we have to call rootElement.replace to // insert the new lines if (elts.size() != 0) { // Set up the ElementEdit by filling the added and removed // arrays with the proper Elements added = new Element[elts.size()]; for (int k = 0; k < elts.size(); ++k) added[k] = (Element) elts.get(k); removed[0] = firstElement; // Now create and add the ElementEdit ElementEdit e = new ElementEdit(rootElement, elementIndex, removed, added); event.addEdit(e); // And call replace to actually make the changes ((BranchElement) rootElement).replace(elementIndex, 1, added); } } catch (BadLocationException e) { // This shouldn't happen so we throw an AssertionError AssertionError ae = new AssertionError(); ae.initCause(e); throw ae; } super.insertUpdate(event, attributes); }
j, i + 1)); j = i + 1; if (j >= str.length())
j, offset + i + 1)); j = offset + i + 1; if (j >= contentLength)
protected void insertUpdate(DefaultDocumentEvent event, AttributeSet attributes) { int offset = event.getOffset(); int end = offset + event.getLength(); int elementIndex = rootElement.getElementIndex(offset); Element firstElement = rootElement.getElement(elementIndex); // If we're inserting immediately after a newline we have to fix the // Element structure. if (offset > 0) { try { String s = getText(offset - 1, 1); if (s.equals("\n")) { int newEl2EndOffset = end; boolean replaceNext = false; if (rootElement.getElementCount() > elementIndex + 1) { replaceNext = true; newEl2EndOffset = rootElement.getElement(elementIndex + 1).getEndOffset(); } Element newEl1 = createLeafElement(rootElement, firstElement.getAttributes(), firstElement.getStartOffset(), offset); Element newEl2 = createLeafElement (rootElement, firstElement.getAttributes(), offset, newEl2EndOffset); if (replaceNext) rootElement.replace(elementIndex, 2, new Element[] { newEl1, newEl2 }); else rootElement.replace(elementIndex, 1, new Element[] { newEl1, newEl2 }); firstElement = newEl2; elementIndex ++; } } catch (BadLocationException ble) { // This shouldn't happen. AssertionError ae = new AssertionError(); ae.initCause(ble); throw ae; } } // added and removed are Element arrays used to add an ElementEdit // to the DocumentEvent if there were entire lines added or removed. Element[] removed = new Element[1]; Element[] added; try { String str = content.getString(0, content.length()); ArrayList elts = new ArrayList(); // Determine how many NEW lines were added by finding the newline // characters within the newly inserted text int j = firstElement.getStartOffset(); int i = str.indexOf('\n', offset); while (i != -1 && i <= end) { // For each new line, create a new element elts.add(createLeafElement(rootElement, SimpleAttributeSet.EMPTY, j, i + 1)); j = i + 1; if (j >= str.length()) break; i = str.indexOf('\n', j); } // If there were new lines added we have to add an ElementEdit to // the DocumentEvent and we have to call rootElement.replace to // insert the new lines if (elts.size() != 0) { // Set up the ElementEdit by filling the added and removed // arrays with the proper Elements added = new Element[elts.size()]; for (int k = 0; k < elts.size(); ++k) added[k] = (Element) elts.get(k); removed[0] = firstElement; // Now create and add the ElementEdit ElementEdit e = new ElementEdit(rootElement, elementIndex, removed, added); event.addEdit(e); // And call replace to actually make the changes ((BranchElement) rootElement).replace(elementIndex, 1, added); } } catch (BadLocationException e) { // This shouldn't happen so we throw an AssertionError AssertionError ae = new AssertionError(); ae.initCause(e); throw ae; } super.insertUpdate(event, attributes); }
i = str.indexOf('\n', j);
i = str.indexOf('\n', i + 1);
protected void insertUpdate(DefaultDocumentEvent event, AttributeSet attributes) { int offset = event.getOffset(); int end = offset + event.getLength(); int elementIndex = rootElement.getElementIndex(offset); Element firstElement = rootElement.getElement(elementIndex); // If we're inserting immediately after a newline we have to fix the // Element structure. if (offset > 0) { try { String s = getText(offset - 1, 1); if (s.equals("\n")) { int newEl2EndOffset = end; boolean replaceNext = false; if (rootElement.getElementCount() > elementIndex + 1) { replaceNext = true; newEl2EndOffset = rootElement.getElement(elementIndex + 1).getEndOffset(); } Element newEl1 = createLeafElement(rootElement, firstElement.getAttributes(), firstElement.getStartOffset(), offset); Element newEl2 = createLeafElement (rootElement, firstElement.getAttributes(), offset, newEl2EndOffset); if (replaceNext) rootElement.replace(elementIndex, 2, new Element[] { newEl1, newEl2 }); else rootElement.replace(elementIndex, 1, new Element[] { newEl1, newEl2 }); firstElement = newEl2; elementIndex ++; } } catch (BadLocationException ble) { // This shouldn't happen. AssertionError ae = new AssertionError(); ae.initCause(ble); throw ae; } } // added and removed are Element arrays used to add an ElementEdit // to the DocumentEvent if there were entire lines added or removed. Element[] removed = new Element[1]; Element[] added; try { String str = content.getString(0, content.length()); ArrayList elts = new ArrayList(); // Determine how many NEW lines were added by finding the newline // characters within the newly inserted text int j = firstElement.getStartOffset(); int i = str.indexOf('\n', offset); while (i != -1 && i <= end) { // For each new line, create a new element elts.add(createLeafElement(rootElement, SimpleAttributeSet.EMPTY, j, i + 1)); j = i + 1; if (j >= str.length()) break; i = str.indexOf('\n', j); } // If there were new lines added we have to add an ElementEdit to // the DocumentEvent and we have to call rootElement.replace to // insert the new lines if (elts.size() != 0) { // Set up the ElementEdit by filling the added and removed // arrays with the proper Elements added = new Element[elts.size()]; for (int k = 0; k < elts.size(); ++k) added[k] = (Element) elts.get(k); removed[0] = firstElement; // Now create and add the ElementEdit ElementEdit e = new ElementEdit(rootElement, elementIndex, removed, added); event.addEdit(e); // And call replace to actually make the changes ((BranchElement) rootElement).replace(elementIndex, 1, added); } } catch (BadLocationException e) { // This shouldn't happen so we throw an AssertionError AssertionError ae = new AssertionError(); ae.initCause(e); throw ae; } super.insertUpdate(event, attributes); }
for (int k = 0; k < elts.size(); ++k) added[k] = (Element) elts.get(k);
elts.toArray(added);
protected void insertUpdate(DefaultDocumentEvent event, AttributeSet attributes) { int offset = event.getOffset(); int end = offset + event.getLength(); int elementIndex = rootElement.getElementIndex(offset); Element firstElement = rootElement.getElement(elementIndex); // If we're inserting immediately after a newline we have to fix the // Element structure. if (offset > 0) { try { String s = getText(offset - 1, 1); if (s.equals("\n")) { int newEl2EndOffset = end; boolean replaceNext = false; if (rootElement.getElementCount() > elementIndex + 1) { replaceNext = true; newEl2EndOffset = rootElement.getElement(elementIndex + 1).getEndOffset(); } Element newEl1 = createLeafElement(rootElement, firstElement.getAttributes(), firstElement.getStartOffset(), offset); Element newEl2 = createLeafElement (rootElement, firstElement.getAttributes(), offset, newEl2EndOffset); if (replaceNext) rootElement.replace(elementIndex, 2, new Element[] { newEl1, newEl2 }); else rootElement.replace(elementIndex, 1, new Element[] { newEl1, newEl2 }); firstElement = newEl2; elementIndex ++; } } catch (BadLocationException ble) { // This shouldn't happen. AssertionError ae = new AssertionError(); ae.initCause(ble); throw ae; } } // added and removed are Element arrays used to add an ElementEdit // to the DocumentEvent if there were entire lines added or removed. Element[] removed = new Element[1]; Element[] added; try { String str = content.getString(0, content.length()); ArrayList elts = new ArrayList(); // Determine how many NEW lines were added by finding the newline // characters within the newly inserted text int j = firstElement.getStartOffset(); int i = str.indexOf('\n', offset); while (i != -1 && i <= end) { // For each new line, create a new element elts.add(createLeafElement(rootElement, SimpleAttributeSet.EMPTY, j, i + 1)); j = i + 1; if (j >= str.length()) break; i = str.indexOf('\n', j); } // If there were new lines added we have to add an ElementEdit to // the DocumentEvent and we have to call rootElement.replace to // insert the new lines if (elts.size() != 0) { // Set up the ElementEdit by filling the added and removed // arrays with the proper Elements added = new Element[elts.size()]; for (int k = 0; k < elts.size(); ++k) added[k] = (Element) elts.get(k); removed[0] = firstElement; // Now create and add the ElementEdit ElementEdit e = new ElementEdit(rootElement, elementIndex, removed, added); event.addEdit(e); // And call replace to actually make the changes ((BranchElement) rootElement).replace(elementIndex, 1, added); } } catch (BadLocationException e) { // This shouldn't happen so we throw an AssertionError AssertionError ae = new AssertionError(); ae.initCause(e); throw ae; } super.insertUpdate(event, attributes); }
return null;
StringBuilder b = new StringBuilder(); b.append("<["); b.append(minimum); b.append(','); b.append(preferred); b.append(','); b.append(maximum); b.append("]@"); b.append(alignment); b.append('>'); return b.toString();
public String toString() { return null; // TODO }
if (Character.isISOControl(kc) || keyProcessed) { return;
if ((isLinux) && !((Character.isLetter(kc)) && (e.getModifiers() == 0 || e.getModifiers() == Event.SHIFT_MASK))) { if (Character.isISOControl(kc) || keyProcessed) { return; }
private void processVTKeyTyped(KeyEvent e){ char kc = e.getKeyChar();// displayInfo(e,"Typed processed " + keyProcessed); if (Character.isISOControl(kc) || keyProcessed) { return; }// displayInfo(e,"Typed processed " + keyProcessed); String s = "";// if (isLinux) {// lastKeyStroke = keyMap.getKeyStrokeText(e,isAltGr);// System.out.println("last " + lastKeyStroke);// if (lastKeyStroke != null) {// s = lastKeyStroke;// System.out.println("last " + s);// }// else// s +=kc;// }// else s += kc; if (!vt.isConnected() ) return; screen.sendKeys(s); if (recording) recordBuffer.append(s); keyProcessed = true; e.consume(); }
"Table.gridColor", getControlShadow(),
"Table.gridColor", getControlDarkShadow(), "Table.selectionBackground", new ColorUIResource(204, 204, 255), "Table.selectionForeground", new ColorUIResource(0, 0, 0),
protected void initComponentDefaults(UIDefaults defaults) { super.initComponentDefaults(defaults); Object[] myDefaults = new Object[] { "Button.background", getControl(), "Button.border", MetalBorders.getButtonBorder(), "Button.darkShadow", getControlDarkShadow(), "Button.disabledText", getInactiveControlTextColor(), "Button.focus", getFocusColor(), "Button.font", getControlTextFont(), "Button.foreground", getControlTextColor(), "Button.highlight", getControlHighlight(), "Button.light", getControlHighlight(), "Button.margin", new Insets(2, 14, 2, 14), "Button.select", getControlShadow(), "Button.shadow", getControlShadow(), "CheckBox.background", getControl(), "CheckBox.border", MetalBorders.getButtonBorder(), "CheckBox.disabledText", getInactiveControlTextColor(), "CheckBox.focus", getFocusColor(), "CheckBox.font", new FontUIResource("Dialog", Font.BOLD, 12), "CheckBox.foreground", getControlTextColor(), "CheckBox.icon", new UIDefaults.ProxyLazyValue ("javax.swing.plaf.metal.MetalCheckBoxIcon"), "CheckBox.checkIcon", new UIDefaults.ProxyLazyValue ("javax.swing.plaf.metal.MetalCheckBoxIcon"), "Checkbox.select", getControlShadow(), "CheckBoxMenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), "CheckBoxMenuItem.acceleratorForeground", getAcceleratorForeground(), "CheckBoxMenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "CheckBoxMenuItem.background", getMenuBackground(), "CheckBoxMenuItem.borderPainted", new Boolean(true), "CheckBoxMenuItem.commandSound", "sounds/MenuItemCommand.wav", "CheckBoxMenuItem.checkIcon", MetalIconFactory.getCheckBoxMenuItemIcon(), "CheckBoxMenuItem.disabledForeground", getMenuDisabledForeground(), "CheckBoxMenuItem.font", new FontUIResource("Dialog", Font.BOLD, 12), "CheckBoxMenuItem.foreground", getMenuForeground(), "CheckBoxMenuItem.selectionBackground", getMenuSelectedBackground(), "CheckBoxMenuItem.selectionForeground", getMenuSelectedForeground(), "ColorChooser.background", getControl(), "ColorChooser.foreground", getControlTextColor(), "ColorChooser.rgbBlueMnemonic", new Integer(0), "ColorChooser.rgbGreenMnemonic", new Integer(0), "ColorChooser.rgbRedMnemonic", new Integer(0), "ColorChooser.swatchesDefaultRecentColor", getControl(), "ComboBox.background", getControl(), "ComboBox.buttonBackground", getControl(), "ComboBox.buttonDarkShadow", getControlDarkShadow(), "ComboBox.buttonHighlight", getControlHighlight(), "ComboBox.buttonShadow", getControlShadow(), "ComboBox.disabledBackground", getControl(), "ComboBox.disabledForeground", getInactiveSystemTextColor(), "ComboBox.font", new FontUIResource("Dialog", Font.BOLD, 12), "ComboBox.foreground", getControlTextColor(), "ComboBox.selectionBackground", getPrimaryControlShadow(), "ComboBox.selectionForeground", getControlTextColor(), "Desktop.background", getDesktopColor(), "DesktopIcon.background", getControl(), "DesktopIcon.foreground", getControlTextColor(), "DesktopIcon.width", new Integer(160), "EditorPane.background", getWindowBackground(), "EditorPane.caretForeground", getUserTextColor(), "EditorPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "EditorPane.foreground", getUserTextColor(), "EditorPane.inactiveForeground", getInactiveSystemTextColor(), "EditorPane.selectionBackground", getTextHighlightColor(), "EditorPane.selectionForeground", getHighlightedTextColor(), "FormattedTextField.background", getWindowBackground(), "FormattedTextField.caretForeground", getUserTextColor(), "FormattedTextField.font", new FontUIResource("Dialog", Font.PLAIN, 12), "FormattedTextField.foreground", getUserTextColor(), "FormattedTextField.inactiveBackground", getControl(), "FormattedTextField.inactiveForeground", getInactiveSystemTextColor(), "FormattedTextField.selectionBackground", getTextHighlightColor(), "FormattedTextField.selectionForeground", getHighlightedTextColor(), "InternalFrame.activeTitleBackground", getWindowTitleBackground(), "InternalFrame.activeTitleForeground", getWindowTitleForeground(), "InternalFrame.border", new MetalBorders.InternalFrameBorder(), "InternalFrame.borderColor", getControl(), "InternalFrame.borderDarkShadow", getControlDarkShadow(), "InternalFrame.borderHighlight", getControlHighlight(), "InternalFrame.borderLight", getControlHighlight(), "InternalFrame.borderShadow", getControlShadow(), "InternalFrame.icon", MetalIconFactory.getInternalFrameDefaultMenuIcon(), "InternalFrame.closeIcon", MetalIconFactory.getInternalFrameCloseIcon(16), "InternalFrame.inactiveTitleBackground", getWindowTitleInactiveBackground(), "InternalFrame.inactiveTitleForeground", getWindowTitleInactiveForeground(), "InternalFrame.maximizeIcon", MetalIconFactory.getInternalFrameMaximizeIcon(16), "InternalFrame.iconifyIcon", MetalIconFactory.getInternalFrameMinimizeIcon(16), "Label.background", getControl(), "Label.disabledForeground", getInactiveSystemTextColor(), "Label.disabledShadow", getControlShadow(), "Label.font", getControlTextFont(), "Label.foreground", getSystemTextColor(), "List.background", getWindowBackground(), "List.foreground", getUserTextColor(), "List.selectionBackground", getTextHighlightColor(), "List.selectionForeground", getHighlightedTextColor(), "Menu.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), "Menu.acceleratorForeground", getAcceleratorForeground(), "Menu.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "Menu.background", getMenuBackground(), "Menu.border", new MetalBorders.MenuItemBorder(), "Menu.borderPainted", Boolean.TRUE, "Menu.disabledForeground", getMenuDisabledForeground(), "Menu.font", getControlTextFont(), "Menu.foreground", getMenuForeground(), "Menu.selectionBackground", getMenuSelectedBackground(), "Menu.selectionForeground", getMenuSelectedForeground(), "MenuBar.background", getMenuBackground(), "MenuBar.border", new MetalBorders.MenuBarBorder(), "MenuBar.font", getControlTextFont(), "MenuBar.foreground", getMenuForeground(), "MenuBar.highlight", getControlHighlight(), "MenuBar.shadow", getControlShadow(), "MenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), "MenuItem.acceleratorForeground", getAcceleratorForeground(), "MenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "MenuItem.background", getMenuBackground(), "MenuItem.border", new MetalBorders.MenuItemBorder(), "MenuItem.disabledForeground", getMenuDisabledForeground(), "MenuItem.font", getControlTextFont(), "MenuItem.foreground", getMenuForeground(), "MenuItem.selectionBackground", getMenuSelectedBackground(), "MenuItem.selectionForeground", getMenuSelectedForeground(), "OptionPane.background", getControl(), "OptionPane.errorDialog.border.background", new ColorUIResource(153, 51, 51), "OptionPane.errorDialog.titlePane.background", new ColorUIResource(255, 153, 153), "OptionPane.errorDialog.titlePane.foreground", new ColorUIResource(51, 0, 0), "OptionPane.errorDialog.titlePane.shadow", new ColorUIResource(204, 102, 102), "OptionPane.foreground", getControlTextColor(), "OptionPane.messageForeground", getControlTextColor(), "OptionPane.questionDialog.border.background", new ColorUIResource(51, 102, 51), "OptionPane.questionDialog.titlePane.background", new ColorUIResource(153, 204, 153), "OptionPane.questionDialog.titlePane.foreground", new ColorUIResource(0, 51, 0), "OptionPane.questionDialog.titlePane.shadow", new ColorUIResource(102, 153, 102), "OptionPane.warningDialog.border.background", new ColorUIResource(153, 102, 51), "OptionPane.warningDialog.titlePane.background", new ColorUIResource(255, 204, 153), "OptionPane.warningDialog.titlePane.foreground", new ColorUIResource(102, 51, 0), "OptionPane.warningDialog.titlePane.shadow", new ColorUIResource(204, 153, 102), "Panel.background", getControl(), "Panel.foreground", getUserTextColor(), "PasswordField.background", getWindowBackground(), "PasswordField.caretForeground", getUserTextColor(), "PasswordField.foreground", getUserTextColor(), "PasswordField.inactiveBackground", getControl(), "PasswordField.inactiveForeground", getInactiveSystemTextColor(), "PasswordField.selectionBackground", getTextHighlightColor(), "PasswordField.selectionForeground", getHighlightedTextColor(), "PopupMenu.background", getMenuBackground(), "PopupMenu.border", new MetalBorders.PopupMenuBorder(), "PopupMenu.font", new FontUIResource("Dialog", Font.BOLD, 12), "PopupMenu.foreground", getMenuForeground(), "ProgressBar.background", getControl(), "ProgressBar.border", new BorderUIResource.LineBorderUIResource(getControlDarkShadow(), 1), "ProgressBar.font", new FontUIResource("Dialog", Font.BOLD, 12), "ProgressBar.foreground", getPrimaryControlShadow(), "ProgressBar.selectionBackground", getPrimaryControlDarkShadow(), "ProgressBar.selectionForeground", getControl(), "RadioButton.background", getControl(), "RadioButton.darkShadow", getControlDarkShadow(), "RadioButton.disabledText", getInactiveControlTextColor(), "RadioButton.icon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) { return MetalIconFactory.getRadioButtonIcon(); } }, "RadioButton.focus", MetalLookAndFeel.getFocusColor(), "RadioButton.font", MetalLookAndFeel.getControlTextFont(), "RadioButton.foreground", getControlTextColor(), "RadioButton.highlight", getControlHighlight(), "RadioButton.light", getControlHighlight(), "RadioButton.select", getControlShadow(), "RadioButton.shadow", getControlShadow(), "RadioButtonMenuItem.acceleratorFont", new Font("Dialog", Font.PLAIN, 10), "RadioButtonMenuItem.acceleratorForeground", getAcceleratorForeground(), "RadioButtonMenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "RadioButtonMenuItem.background", getMenuBackground(), "RadioButtonMenuItem.border", new MetalBorders.MenuItemBorder(), "RadioButtonMenuItem.borderPainted", Boolean.TRUE, "RadioButtonMenuItem.checkIcon", MetalIconFactory.getRadioButtonMenuItemIcon(), "RadioButtonMenuItem.disabledForeground", getMenuDisabledForeground(), "RadioButtonMenuItem.font", MetalLookAndFeel.getControlTextFont(), "RadioButtonMenuItem.foreground", getMenuForeground(), "RadioButtonMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "RadioButtonMenuItem.selectionBackground", MetalLookAndFeel.getMenuSelectedBackground(), "RadioButtonMenuItem.selectionForeground", MetalLookAndFeel.getMenuSelectedForeground(), "ScrollBar.background", getControl(), "ScrollBar.darkShadow", getControlDarkShadow(), "ScrollBar.foreground", getControl(), "ScrollBar.highlight", getControlHighlight(), "ScrollBar.shadow", getControlShadow(), "ScrollBar.thumb", getPrimaryControlShadow(), "ScrollBar.thumbDarkShadow", getControlDarkShadow(), "ScrollBar.thumbHighlight", getPrimaryControl(), "ScrollBar.thumbShadow", getPrimaryControlDarkShadow(), "ScrollBar.track", getControl(), "ScrollBar.trackHighlight", getControlDarkShadow(), "ScrollPane.background", getControl(), "ScrollPane.border", new MetalBorders.ScrollPaneBorder(), "ScrollPane.foreground", getControlTextColor(), "Separator.background", getSeparatorBackground(), "Separator.foreground", getSeparatorForeground(), "Separator.highlight", getControlHighlight(), "Separator.shadow", getControlShadow(), "Slider.background", getControl(), "Slider.focus", getFocusColor(), "Slider.focusInsets", new InsetsUIResource(0, 0, 0, 0), "Slider.foreground", getPrimaryControlShadow(), "Slider.highlight", getControlHighlight(), "Slider.horizontalThumbIcon", MetalIconFactory.getHorizontalSliderThumbIcon(), "Slider.majorTickLength", new Integer(6), "Slider.shadow", getControlShadow(), "Slider.trackWidth", new Integer(7), "Slider.verticalThumbIcon", MetalIconFactory.getVerticalSliderThumbIcon(), "Spinner.background", getControl(), "Spinner.font", new FontUIResource("Dialog", Font.BOLD, 12), "Spinner.foreground", getControl(), "SplitPane.background", getControl(), "SplitPane.darkShadow", getControlDarkShadow(), "SplitPane.dividerFocusColor", getPrimaryControl(), "SplitPane.highlight", getControlHighlight(), "SplitPane.shadow", getControlShadow(), "SplitPaneDivider.draggingColor", Color.DARK_GRAY, "TabbedPane.background", getControlShadow(), "TabbedPane.darkShadow", getControlDarkShadow(), "TabbedPane.focus", getPrimaryControlDarkShadow(), "TabbedPane.font", new FontUIResource("Dialog", Font.BOLD, 12), "TabbedPane.foreground", getControlTextColor(), "TabbedPane.highlight", getControlHighlight(), "TabbedPane.light", getControl(), "TabbedPane.selected", getControl(), "TabbedPane.selectHighlight", getControlHighlight(), "TabbedPane.selectedTabPadInsets", new InsetsUIResource(2, 2, 2, 1), "TabbedPane.shadow", getControlShadow(), "TabbedPane.tabAreaBackground", getControl(), "TabbedPane.tabAreaInsets", new InsetsUIResource(4, 2, 0, 6), "TabbedPane.tabInsets", new InsetsUIResource(0, 9, 1, 9), "Table.background", getWindowBackground(), "Table.focusCellBackground", getWindowBackground(), "Table.focusCellForeground", getControlTextColor(), "Table.foreground", getControlTextColor(), "Table.focusCellHighlightBorder", getControlShadow(), "Table.focusCellBackground", getWindowBackground(), "Table.gridColor", getControlShadow(), "TableHeader.background", getControl(), "TableHeader.foreground", getControlTextColor(), "TextArea.background", getWindowBackground(), "TextArea.caretForeground", getUserTextColor(), "TextArea.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TextArea.foreground", getUserTextColor(), "TextArea.inactiveForeground", getInactiveSystemTextColor(), "TextArea.selectionBackground", getTextHighlightColor(), "TextArea.selectionForeground", getHighlightedTextColor(), "TextField.background", getWindowBackground(), "TextField.border", MetalBorders.getTextFieldBorder(), "TextField.caretForeground", getUserTextColor(), "TextField.darkShadow", getControlDarkShadow(), "TextField.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TextField.foreground", getUserTextColor(), "TextField.highlight", getControlHighlight(), "TextField.inactiveBackground", getControl(), "TextField.inactiveForeground", getInactiveSystemTextColor(), "TextField.light", getControlHighlight(), "TextField.selectionBackground", getTextHighlightColor(), "TextField.selectionForeground", getHighlightedTextColor(), "TextField.shadow", getControlShadow(), "TextPane.background", getWindowBackground(), "TextPane.caretForeground", getUserTextColor(), "TextPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TextPane.foreground", getUserTextColor(), "TextPane.inactiveForeground", getInactiveSystemTextColor(), "TextPane.selectionBackground", getTextHighlightColor(), "TextPane.selectionForeground", getHighlightedTextColor(), "TitledBorder.font", new FontUIResource("Dialog", Font.BOLD, 12), "TitledBorder.titleColor", getSystemTextColor(), "ToggleButton.background", getControl(), "ToggleButton.border", MetalBorders.getButtonBorder(), "ToggleButton.darkShadow", getControlDarkShadow(), "ToggleButton.disabledText", getInactiveControlTextColor(), "ToggleButton.focus", new ColorUIResource(getFocusColor()), "ToggleButton.font", getControlTextFont(), "ToggleButton.foreground", getControlTextColor(), "ToggleButton.highlight", getControlHighlight(), "ToggleButton.light", getControlHighlight(), "ToggleButton.margin", new Insets(2, 14, 2, 14), "ToggleButton.select", getControlShadow(), "ToggleButton.shadow", getControlShadow(), "ToolBar.background", getMenuBackground(), "ToolBar.darkShadow", getControlDarkShadow(), "ToolBar.dockingBackground", getMenuBackground(), "ToolBar.dockingForeground", getPrimaryControlDarkShadow(), "ToolBar.floatingBackground", getMenuBackground(), "ToolBar.floatingForeground", getPrimaryControl(), "ToolBar.font", new FontUIResource("Dialog", Font.BOLD, 12), "ToolBar.foreground", getMenuForeground(), "ToolBar.highlight", getControlHighlight(), "ToolBar.light", getControlHighlight(), "ToolBar.shadow", getControlShadow(), "ToolTip.background", getPrimaryControl(), "ToolTip.backgroundInactive", getControl(), "ToolTip.border", new BorderUIResource.LineBorderUIResource(getPrimaryControlDarkShadow(), 1), "ToolTip.borderInactive", new BorderUIResource.LineBorderUIResource(getControlDarkShadow(), 1), "ToolTip.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ToolTip.foreground", getPrimaryControlInfo(), "ToolTip.foregroundInactive", getControlDarkShadow(), "Tree.background", getWindowBackground(), "Tree.closedIcon", MetalIconFactory.getTreeFolderIcon(), "Tree.collapsedIcon", MetalIconFactory.getTreeControlIcon(true), "Tree.expandedIcon", MetalIconFactory.getTreeControlIcon(false), "Tree.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Tree.foreground", getUserTextColor(), "Tree.hash", getPrimaryControl(), "Tree.leafIcon", MetalIconFactory.getTreeLeafIcon(), "Tree.leftChildIndent", new Integer(7), "Tree.line", getPrimaryControl(), "Tree.openIcon", MetalIconFactory.getTreeFolderIcon(), "Tree.rightChildIndent", new Integer(13), "Tree.rowHeight", new Integer(20), "Tree.scrollsOnExpand", Boolean.TRUE, "Tree.selectionBackground", getTextHighlightColor(), "Tree.selectionBorder", new BorderUIResource.LineBorderUIResource(new Color(102, 102, 153)), "Tree.selectionBorderColor", getFocusColor(), "Tree.selectionForeground", getHighlightedTextColor(), "Tree.textBackground", getWindowBackground(), "Tree.textForeground", getUserTextColor(), "Viewport.background", getControl(), "Viewport.foreground", getUserTextColor() }; defaults.putDefaults(myDefaults); }
"TextField.border", MetalBorders.getTextFieldBorder(),
"TextField.border", new BorderUIResource(MetalBorders.getTextFieldBorder()),
protected void initComponentDefaults(UIDefaults defaults) { super.initComponentDefaults(defaults); Object[] myDefaults = new Object[] { "Button.background", getControl(), "Button.border", MetalBorders.getButtonBorder(), "Button.darkShadow", getControlDarkShadow(), "Button.disabledText", getInactiveControlTextColor(), "Button.focus", getFocusColor(), "Button.font", getControlTextFont(), "Button.foreground", getControlTextColor(), "Button.highlight", getControlHighlight(), "Button.light", getControlHighlight(), "Button.margin", new Insets(2, 14, 2, 14), "Button.select", getControlShadow(), "Button.shadow", getControlShadow(), "CheckBox.background", getControl(), "CheckBox.border", MetalBorders.getButtonBorder(), "CheckBox.disabledText", getInactiveControlTextColor(), "CheckBox.focus", getFocusColor(), "CheckBox.font", new FontUIResource("Dialog", Font.BOLD, 12), "CheckBox.foreground", getControlTextColor(), "CheckBox.icon", new UIDefaults.ProxyLazyValue ("javax.swing.plaf.metal.MetalCheckBoxIcon"), "CheckBox.checkIcon", new UIDefaults.ProxyLazyValue ("javax.swing.plaf.metal.MetalCheckBoxIcon"), "Checkbox.select", getControlShadow(), "CheckBoxMenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), "CheckBoxMenuItem.acceleratorForeground", getAcceleratorForeground(), "CheckBoxMenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "CheckBoxMenuItem.background", getMenuBackground(), "CheckBoxMenuItem.borderPainted", new Boolean(true), "CheckBoxMenuItem.commandSound", "sounds/MenuItemCommand.wav", "CheckBoxMenuItem.checkIcon", MetalIconFactory.getCheckBoxMenuItemIcon(), "CheckBoxMenuItem.disabledForeground", getMenuDisabledForeground(), "CheckBoxMenuItem.font", new FontUIResource("Dialog", Font.BOLD, 12), "CheckBoxMenuItem.foreground", getMenuForeground(), "CheckBoxMenuItem.selectionBackground", getMenuSelectedBackground(), "CheckBoxMenuItem.selectionForeground", getMenuSelectedForeground(), "ColorChooser.background", getControl(), "ColorChooser.foreground", getControlTextColor(), "ColorChooser.rgbBlueMnemonic", new Integer(0), "ColorChooser.rgbGreenMnemonic", new Integer(0), "ColorChooser.rgbRedMnemonic", new Integer(0), "ColorChooser.swatchesDefaultRecentColor", getControl(), "ComboBox.background", getControl(), "ComboBox.buttonBackground", getControl(), "ComboBox.buttonDarkShadow", getControlDarkShadow(), "ComboBox.buttonHighlight", getControlHighlight(), "ComboBox.buttonShadow", getControlShadow(), "ComboBox.disabledBackground", getControl(), "ComboBox.disabledForeground", getInactiveSystemTextColor(), "ComboBox.font", new FontUIResource("Dialog", Font.BOLD, 12), "ComboBox.foreground", getControlTextColor(), "ComboBox.selectionBackground", getPrimaryControlShadow(), "ComboBox.selectionForeground", getControlTextColor(), "Desktop.background", getDesktopColor(), "DesktopIcon.background", getControl(), "DesktopIcon.foreground", getControlTextColor(), "DesktopIcon.width", new Integer(160), "EditorPane.background", getWindowBackground(), "EditorPane.caretForeground", getUserTextColor(), "EditorPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "EditorPane.foreground", getUserTextColor(), "EditorPane.inactiveForeground", getInactiveSystemTextColor(), "EditorPane.selectionBackground", getTextHighlightColor(), "EditorPane.selectionForeground", getHighlightedTextColor(), "FormattedTextField.background", getWindowBackground(), "FormattedTextField.caretForeground", getUserTextColor(), "FormattedTextField.font", new FontUIResource("Dialog", Font.PLAIN, 12), "FormattedTextField.foreground", getUserTextColor(), "FormattedTextField.inactiveBackground", getControl(), "FormattedTextField.inactiveForeground", getInactiveSystemTextColor(), "FormattedTextField.selectionBackground", getTextHighlightColor(), "FormattedTextField.selectionForeground", getHighlightedTextColor(), "InternalFrame.activeTitleBackground", getWindowTitleBackground(), "InternalFrame.activeTitleForeground", getWindowTitleForeground(), "InternalFrame.border", new MetalBorders.InternalFrameBorder(), "InternalFrame.borderColor", getControl(), "InternalFrame.borderDarkShadow", getControlDarkShadow(), "InternalFrame.borderHighlight", getControlHighlight(), "InternalFrame.borderLight", getControlHighlight(), "InternalFrame.borderShadow", getControlShadow(), "InternalFrame.icon", MetalIconFactory.getInternalFrameDefaultMenuIcon(), "InternalFrame.closeIcon", MetalIconFactory.getInternalFrameCloseIcon(16), "InternalFrame.inactiveTitleBackground", getWindowTitleInactiveBackground(), "InternalFrame.inactiveTitleForeground", getWindowTitleInactiveForeground(), "InternalFrame.maximizeIcon", MetalIconFactory.getInternalFrameMaximizeIcon(16), "InternalFrame.iconifyIcon", MetalIconFactory.getInternalFrameMinimizeIcon(16), "Label.background", getControl(), "Label.disabledForeground", getInactiveSystemTextColor(), "Label.disabledShadow", getControlShadow(), "Label.font", getControlTextFont(), "Label.foreground", getSystemTextColor(), "List.background", getWindowBackground(), "List.foreground", getUserTextColor(), "List.selectionBackground", getTextHighlightColor(), "List.selectionForeground", getHighlightedTextColor(), "Menu.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), "Menu.acceleratorForeground", getAcceleratorForeground(), "Menu.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "Menu.background", getMenuBackground(), "Menu.border", new MetalBorders.MenuItemBorder(), "Menu.borderPainted", Boolean.TRUE, "Menu.disabledForeground", getMenuDisabledForeground(), "Menu.font", getControlTextFont(), "Menu.foreground", getMenuForeground(), "Menu.selectionBackground", getMenuSelectedBackground(), "Menu.selectionForeground", getMenuSelectedForeground(), "MenuBar.background", getMenuBackground(), "MenuBar.border", new MetalBorders.MenuBarBorder(), "MenuBar.font", getControlTextFont(), "MenuBar.foreground", getMenuForeground(), "MenuBar.highlight", getControlHighlight(), "MenuBar.shadow", getControlShadow(), "MenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), "MenuItem.acceleratorForeground", getAcceleratorForeground(), "MenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "MenuItem.background", getMenuBackground(), "MenuItem.border", new MetalBorders.MenuItemBorder(), "MenuItem.disabledForeground", getMenuDisabledForeground(), "MenuItem.font", getControlTextFont(), "MenuItem.foreground", getMenuForeground(), "MenuItem.selectionBackground", getMenuSelectedBackground(), "MenuItem.selectionForeground", getMenuSelectedForeground(), "OptionPane.background", getControl(), "OptionPane.errorDialog.border.background", new ColorUIResource(153, 51, 51), "OptionPane.errorDialog.titlePane.background", new ColorUIResource(255, 153, 153), "OptionPane.errorDialog.titlePane.foreground", new ColorUIResource(51, 0, 0), "OptionPane.errorDialog.titlePane.shadow", new ColorUIResource(204, 102, 102), "OptionPane.foreground", getControlTextColor(), "OptionPane.messageForeground", getControlTextColor(), "OptionPane.questionDialog.border.background", new ColorUIResource(51, 102, 51), "OptionPane.questionDialog.titlePane.background", new ColorUIResource(153, 204, 153), "OptionPane.questionDialog.titlePane.foreground", new ColorUIResource(0, 51, 0), "OptionPane.questionDialog.titlePane.shadow", new ColorUIResource(102, 153, 102), "OptionPane.warningDialog.border.background", new ColorUIResource(153, 102, 51), "OptionPane.warningDialog.titlePane.background", new ColorUIResource(255, 204, 153), "OptionPane.warningDialog.titlePane.foreground", new ColorUIResource(102, 51, 0), "OptionPane.warningDialog.titlePane.shadow", new ColorUIResource(204, 153, 102), "Panel.background", getControl(), "Panel.foreground", getUserTextColor(), "PasswordField.background", getWindowBackground(), "PasswordField.caretForeground", getUserTextColor(), "PasswordField.foreground", getUserTextColor(), "PasswordField.inactiveBackground", getControl(), "PasswordField.inactiveForeground", getInactiveSystemTextColor(), "PasswordField.selectionBackground", getTextHighlightColor(), "PasswordField.selectionForeground", getHighlightedTextColor(), "PopupMenu.background", getMenuBackground(), "PopupMenu.border", new MetalBorders.PopupMenuBorder(), "PopupMenu.font", new FontUIResource("Dialog", Font.BOLD, 12), "PopupMenu.foreground", getMenuForeground(), "ProgressBar.background", getControl(), "ProgressBar.border", new BorderUIResource.LineBorderUIResource(getControlDarkShadow(), 1), "ProgressBar.font", new FontUIResource("Dialog", Font.BOLD, 12), "ProgressBar.foreground", getPrimaryControlShadow(), "ProgressBar.selectionBackground", getPrimaryControlDarkShadow(), "ProgressBar.selectionForeground", getControl(), "RadioButton.background", getControl(), "RadioButton.darkShadow", getControlDarkShadow(), "RadioButton.disabledText", getInactiveControlTextColor(), "RadioButton.icon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) { return MetalIconFactory.getRadioButtonIcon(); } }, "RadioButton.focus", MetalLookAndFeel.getFocusColor(), "RadioButton.font", MetalLookAndFeel.getControlTextFont(), "RadioButton.foreground", getControlTextColor(), "RadioButton.highlight", getControlHighlight(), "RadioButton.light", getControlHighlight(), "RadioButton.select", getControlShadow(), "RadioButton.shadow", getControlShadow(), "RadioButtonMenuItem.acceleratorFont", new Font("Dialog", Font.PLAIN, 10), "RadioButtonMenuItem.acceleratorForeground", getAcceleratorForeground(), "RadioButtonMenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "RadioButtonMenuItem.background", getMenuBackground(), "RadioButtonMenuItem.border", new MetalBorders.MenuItemBorder(), "RadioButtonMenuItem.borderPainted", Boolean.TRUE, "RadioButtonMenuItem.checkIcon", MetalIconFactory.getRadioButtonMenuItemIcon(), "RadioButtonMenuItem.disabledForeground", getMenuDisabledForeground(), "RadioButtonMenuItem.font", MetalLookAndFeel.getControlTextFont(), "RadioButtonMenuItem.foreground", getMenuForeground(), "RadioButtonMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "RadioButtonMenuItem.selectionBackground", MetalLookAndFeel.getMenuSelectedBackground(), "RadioButtonMenuItem.selectionForeground", MetalLookAndFeel.getMenuSelectedForeground(), "ScrollBar.background", getControl(), "ScrollBar.darkShadow", getControlDarkShadow(), "ScrollBar.foreground", getControl(), "ScrollBar.highlight", getControlHighlight(), "ScrollBar.shadow", getControlShadow(), "ScrollBar.thumb", getPrimaryControlShadow(), "ScrollBar.thumbDarkShadow", getControlDarkShadow(), "ScrollBar.thumbHighlight", getPrimaryControl(), "ScrollBar.thumbShadow", getPrimaryControlDarkShadow(), "ScrollBar.track", getControl(), "ScrollBar.trackHighlight", getControlDarkShadow(), "ScrollPane.background", getControl(), "ScrollPane.border", new MetalBorders.ScrollPaneBorder(), "ScrollPane.foreground", getControlTextColor(), "Separator.background", getSeparatorBackground(), "Separator.foreground", getSeparatorForeground(), "Separator.highlight", getControlHighlight(), "Separator.shadow", getControlShadow(), "Slider.background", getControl(), "Slider.focus", getFocusColor(), "Slider.focusInsets", new InsetsUIResource(0, 0, 0, 0), "Slider.foreground", getPrimaryControlShadow(), "Slider.highlight", getControlHighlight(), "Slider.horizontalThumbIcon", MetalIconFactory.getHorizontalSliderThumbIcon(), "Slider.majorTickLength", new Integer(6), "Slider.shadow", getControlShadow(), "Slider.trackWidth", new Integer(7), "Slider.verticalThumbIcon", MetalIconFactory.getVerticalSliderThumbIcon(), "Spinner.background", getControl(), "Spinner.font", new FontUIResource("Dialog", Font.BOLD, 12), "Spinner.foreground", getControl(), "SplitPane.background", getControl(), "SplitPane.darkShadow", getControlDarkShadow(), "SplitPane.dividerFocusColor", getPrimaryControl(), "SplitPane.highlight", getControlHighlight(), "SplitPane.shadow", getControlShadow(), "SplitPaneDivider.draggingColor", Color.DARK_GRAY, "TabbedPane.background", getControlShadow(), "TabbedPane.darkShadow", getControlDarkShadow(), "TabbedPane.focus", getPrimaryControlDarkShadow(), "TabbedPane.font", new FontUIResource("Dialog", Font.BOLD, 12), "TabbedPane.foreground", getControlTextColor(), "TabbedPane.highlight", getControlHighlight(), "TabbedPane.light", getControl(), "TabbedPane.selected", getControl(), "TabbedPane.selectHighlight", getControlHighlight(), "TabbedPane.selectedTabPadInsets", new InsetsUIResource(2, 2, 2, 1), "TabbedPane.shadow", getControlShadow(), "TabbedPane.tabAreaBackground", getControl(), "TabbedPane.tabAreaInsets", new InsetsUIResource(4, 2, 0, 6), "TabbedPane.tabInsets", new InsetsUIResource(0, 9, 1, 9), "Table.background", getWindowBackground(), "Table.focusCellBackground", getWindowBackground(), "Table.focusCellForeground", getControlTextColor(), "Table.foreground", getControlTextColor(), "Table.focusCellHighlightBorder", getControlShadow(), "Table.focusCellBackground", getWindowBackground(), "Table.gridColor", getControlShadow(), "TableHeader.background", getControl(), "TableHeader.foreground", getControlTextColor(), "TextArea.background", getWindowBackground(), "TextArea.caretForeground", getUserTextColor(), "TextArea.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TextArea.foreground", getUserTextColor(), "TextArea.inactiveForeground", getInactiveSystemTextColor(), "TextArea.selectionBackground", getTextHighlightColor(), "TextArea.selectionForeground", getHighlightedTextColor(), "TextField.background", getWindowBackground(), "TextField.border", MetalBorders.getTextFieldBorder(), "TextField.caretForeground", getUserTextColor(), "TextField.darkShadow", getControlDarkShadow(), "TextField.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TextField.foreground", getUserTextColor(), "TextField.highlight", getControlHighlight(), "TextField.inactiveBackground", getControl(), "TextField.inactiveForeground", getInactiveSystemTextColor(), "TextField.light", getControlHighlight(), "TextField.selectionBackground", getTextHighlightColor(), "TextField.selectionForeground", getHighlightedTextColor(), "TextField.shadow", getControlShadow(), "TextPane.background", getWindowBackground(), "TextPane.caretForeground", getUserTextColor(), "TextPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TextPane.foreground", getUserTextColor(), "TextPane.inactiveForeground", getInactiveSystemTextColor(), "TextPane.selectionBackground", getTextHighlightColor(), "TextPane.selectionForeground", getHighlightedTextColor(), "TitledBorder.font", new FontUIResource("Dialog", Font.BOLD, 12), "TitledBorder.titleColor", getSystemTextColor(), "ToggleButton.background", getControl(), "ToggleButton.border", MetalBorders.getButtonBorder(), "ToggleButton.darkShadow", getControlDarkShadow(), "ToggleButton.disabledText", getInactiveControlTextColor(), "ToggleButton.focus", new ColorUIResource(getFocusColor()), "ToggleButton.font", getControlTextFont(), "ToggleButton.foreground", getControlTextColor(), "ToggleButton.highlight", getControlHighlight(), "ToggleButton.light", getControlHighlight(), "ToggleButton.margin", new Insets(2, 14, 2, 14), "ToggleButton.select", getControlShadow(), "ToggleButton.shadow", getControlShadow(), "ToolBar.background", getMenuBackground(), "ToolBar.darkShadow", getControlDarkShadow(), "ToolBar.dockingBackground", getMenuBackground(), "ToolBar.dockingForeground", getPrimaryControlDarkShadow(), "ToolBar.floatingBackground", getMenuBackground(), "ToolBar.floatingForeground", getPrimaryControl(), "ToolBar.font", new FontUIResource("Dialog", Font.BOLD, 12), "ToolBar.foreground", getMenuForeground(), "ToolBar.highlight", getControlHighlight(), "ToolBar.light", getControlHighlight(), "ToolBar.shadow", getControlShadow(), "ToolTip.background", getPrimaryControl(), "ToolTip.backgroundInactive", getControl(), "ToolTip.border", new BorderUIResource.LineBorderUIResource(getPrimaryControlDarkShadow(), 1), "ToolTip.borderInactive", new BorderUIResource.LineBorderUIResource(getControlDarkShadow(), 1), "ToolTip.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ToolTip.foreground", getPrimaryControlInfo(), "ToolTip.foregroundInactive", getControlDarkShadow(), "Tree.background", getWindowBackground(), "Tree.closedIcon", MetalIconFactory.getTreeFolderIcon(), "Tree.collapsedIcon", MetalIconFactory.getTreeControlIcon(true), "Tree.expandedIcon", MetalIconFactory.getTreeControlIcon(false), "Tree.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Tree.foreground", getUserTextColor(), "Tree.hash", getPrimaryControl(), "Tree.leafIcon", MetalIconFactory.getTreeLeafIcon(), "Tree.leftChildIndent", new Integer(7), "Tree.line", getPrimaryControl(), "Tree.openIcon", MetalIconFactory.getTreeFolderIcon(), "Tree.rightChildIndent", new Integer(13), "Tree.rowHeight", new Integer(20), "Tree.scrollsOnExpand", Boolean.TRUE, "Tree.selectionBackground", getTextHighlightColor(), "Tree.selectionBorder", new BorderUIResource.LineBorderUIResource(new Color(102, 102, 153)), "Tree.selectionBorderColor", getFocusColor(), "Tree.selectionForeground", getHighlightedTextColor(), "Tree.textBackground", getWindowBackground(), "Tree.textForeground", getUserTextColor(), "Viewport.background", getControl(), "Viewport.foreground", getUserTextColor() }; defaults.putDefaults(myDefaults); }
"ToggleButton.border", MetalBorders.getButtonBorder(),
"ToggleButton.border", MetalBorders.getToggleButtonBorder(),
protected void initComponentDefaults(UIDefaults defaults) { super.initComponentDefaults(defaults); Object[] myDefaults = new Object[] { "Button.background", getControl(), "Button.border", MetalBorders.getButtonBorder(), "Button.darkShadow", getControlDarkShadow(), "Button.disabledText", getInactiveControlTextColor(), "Button.focus", getFocusColor(), "Button.font", getControlTextFont(), "Button.foreground", getControlTextColor(), "Button.highlight", getControlHighlight(), "Button.light", getControlHighlight(), "Button.margin", new Insets(2, 14, 2, 14), "Button.select", getControlShadow(), "Button.shadow", getControlShadow(), "CheckBox.background", getControl(), "CheckBox.border", MetalBorders.getButtonBorder(), "CheckBox.disabledText", getInactiveControlTextColor(), "CheckBox.focus", getFocusColor(), "CheckBox.font", new FontUIResource("Dialog", Font.BOLD, 12), "CheckBox.foreground", getControlTextColor(), "CheckBox.icon", new UIDefaults.ProxyLazyValue ("javax.swing.plaf.metal.MetalCheckBoxIcon"), "CheckBox.checkIcon", new UIDefaults.ProxyLazyValue ("javax.swing.plaf.metal.MetalCheckBoxIcon"), "Checkbox.select", getControlShadow(), "CheckBoxMenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), "CheckBoxMenuItem.acceleratorForeground", getAcceleratorForeground(), "CheckBoxMenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "CheckBoxMenuItem.background", getMenuBackground(), "CheckBoxMenuItem.borderPainted", new Boolean(true), "CheckBoxMenuItem.commandSound", "sounds/MenuItemCommand.wav", "CheckBoxMenuItem.checkIcon", MetalIconFactory.getCheckBoxMenuItemIcon(), "CheckBoxMenuItem.disabledForeground", getMenuDisabledForeground(), "CheckBoxMenuItem.font", new FontUIResource("Dialog", Font.BOLD, 12), "CheckBoxMenuItem.foreground", getMenuForeground(), "CheckBoxMenuItem.selectionBackground", getMenuSelectedBackground(), "CheckBoxMenuItem.selectionForeground", getMenuSelectedForeground(), "ColorChooser.background", getControl(), "ColorChooser.foreground", getControlTextColor(), "ColorChooser.rgbBlueMnemonic", new Integer(0), "ColorChooser.rgbGreenMnemonic", new Integer(0), "ColorChooser.rgbRedMnemonic", new Integer(0), "ColorChooser.swatchesDefaultRecentColor", getControl(), "ComboBox.background", getControl(), "ComboBox.buttonBackground", getControl(), "ComboBox.buttonDarkShadow", getControlDarkShadow(), "ComboBox.buttonHighlight", getControlHighlight(), "ComboBox.buttonShadow", getControlShadow(), "ComboBox.disabledBackground", getControl(), "ComboBox.disabledForeground", getInactiveSystemTextColor(), "ComboBox.font", new FontUIResource("Dialog", Font.BOLD, 12), "ComboBox.foreground", getControlTextColor(), "ComboBox.selectionBackground", getPrimaryControlShadow(), "ComboBox.selectionForeground", getControlTextColor(), "Desktop.background", getDesktopColor(), "DesktopIcon.background", getControl(), "DesktopIcon.foreground", getControlTextColor(), "DesktopIcon.width", new Integer(160), "EditorPane.background", getWindowBackground(), "EditorPane.caretForeground", getUserTextColor(), "EditorPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "EditorPane.foreground", getUserTextColor(), "EditorPane.inactiveForeground", getInactiveSystemTextColor(), "EditorPane.selectionBackground", getTextHighlightColor(), "EditorPane.selectionForeground", getHighlightedTextColor(), "FormattedTextField.background", getWindowBackground(), "FormattedTextField.caretForeground", getUserTextColor(), "FormattedTextField.font", new FontUIResource("Dialog", Font.PLAIN, 12), "FormattedTextField.foreground", getUserTextColor(), "FormattedTextField.inactiveBackground", getControl(), "FormattedTextField.inactiveForeground", getInactiveSystemTextColor(), "FormattedTextField.selectionBackground", getTextHighlightColor(), "FormattedTextField.selectionForeground", getHighlightedTextColor(), "InternalFrame.activeTitleBackground", getWindowTitleBackground(), "InternalFrame.activeTitleForeground", getWindowTitleForeground(), "InternalFrame.border", new MetalBorders.InternalFrameBorder(), "InternalFrame.borderColor", getControl(), "InternalFrame.borderDarkShadow", getControlDarkShadow(), "InternalFrame.borderHighlight", getControlHighlight(), "InternalFrame.borderLight", getControlHighlight(), "InternalFrame.borderShadow", getControlShadow(), "InternalFrame.icon", MetalIconFactory.getInternalFrameDefaultMenuIcon(), "InternalFrame.closeIcon", MetalIconFactory.getInternalFrameCloseIcon(16), "InternalFrame.inactiveTitleBackground", getWindowTitleInactiveBackground(), "InternalFrame.inactiveTitleForeground", getWindowTitleInactiveForeground(), "InternalFrame.maximizeIcon", MetalIconFactory.getInternalFrameMaximizeIcon(16), "InternalFrame.iconifyIcon", MetalIconFactory.getInternalFrameMinimizeIcon(16), "Label.background", getControl(), "Label.disabledForeground", getInactiveSystemTextColor(), "Label.disabledShadow", getControlShadow(), "Label.font", getControlTextFont(), "Label.foreground", getSystemTextColor(), "List.background", getWindowBackground(), "List.foreground", getUserTextColor(), "List.selectionBackground", getTextHighlightColor(), "List.selectionForeground", getHighlightedTextColor(), "Menu.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), "Menu.acceleratorForeground", getAcceleratorForeground(), "Menu.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "Menu.background", getMenuBackground(), "Menu.border", new MetalBorders.MenuItemBorder(), "Menu.borderPainted", Boolean.TRUE, "Menu.disabledForeground", getMenuDisabledForeground(), "Menu.font", getControlTextFont(), "Menu.foreground", getMenuForeground(), "Menu.selectionBackground", getMenuSelectedBackground(), "Menu.selectionForeground", getMenuSelectedForeground(), "MenuBar.background", getMenuBackground(), "MenuBar.border", new MetalBorders.MenuBarBorder(), "MenuBar.font", getControlTextFont(), "MenuBar.foreground", getMenuForeground(), "MenuBar.highlight", getControlHighlight(), "MenuBar.shadow", getControlShadow(), "MenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), "MenuItem.acceleratorForeground", getAcceleratorForeground(), "MenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "MenuItem.background", getMenuBackground(), "MenuItem.border", new MetalBorders.MenuItemBorder(), "MenuItem.disabledForeground", getMenuDisabledForeground(), "MenuItem.font", getControlTextFont(), "MenuItem.foreground", getMenuForeground(), "MenuItem.selectionBackground", getMenuSelectedBackground(), "MenuItem.selectionForeground", getMenuSelectedForeground(), "OptionPane.background", getControl(), "OptionPane.errorDialog.border.background", new ColorUIResource(153, 51, 51), "OptionPane.errorDialog.titlePane.background", new ColorUIResource(255, 153, 153), "OptionPane.errorDialog.titlePane.foreground", new ColorUIResource(51, 0, 0), "OptionPane.errorDialog.titlePane.shadow", new ColorUIResource(204, 102, 102), "OptionPane.foreground", getControlTextColor(), "OptionPane.messageForeground", getControlTextColor(), "OptionPane.questionDialog.border.background", new ColorUIResource(51, 102, 51), "OptionPane.questionDialog.titlePane.background", new ColorUIResource(153, 204, 153), "OptionPane.questionDialog.titlePane.foreground", new ColorUIResource(0, 51, 0), "OptionPane.questionDialog.titlePane.shadow", new ColorUIResource(102, 153, 102), "OptionPane.warningDialog.border.background", new ColorUIResource(153, 102, 51), "OptionPane.warningDialog.titlePane.background", new ColorUIResource(255, 204, 153), "OptionPane.warningDialog.titlePane.foreground", new ColorUIResource(102, 51, 0), "OptionPane.warningDialog.titlePane.shadow", new ColorUIResource(204, 153, 102), "Panel.background", getControl(), "Panel.foreground", getUserTextColor(), "PasswordField.background", getWindowBackground(), "PasswordField.caretForeground", getUserTextColor(), "PasswordField.foreground", getUserTextColor(), "PasswordField.inactiveBackground", getControl(), "PasswordField.inactiveForeground", getInactiveSystemTextColor(), "PasswordField.selectionBackground", getTextHighlightColor(), "PasswordField.selectionForeground", getHighlightedTextColor(), "PopupMenu.background", getMenuBackground(), "PopupMenu.border", new MetalBorders.PopupMenuBorder(), "PopupMenu.font", new FontUIResource("Dialog", Font.BOLD, 12), "PopupMenu.foreground", getMenuForeground(), "ProgressBar.background", getControl(), "ProgressBar.border", new BorderUIResource.LineBorderUIResource(getControlDarkShadow(), 1), "ProgressBar.font", new FontUIResource("Dialog", Font.BOLD, 12), "ProgressBar.foreground", getPrimaryControlShadow(), "ProgressBar.selectionBackground", getPrimaryControlDarkShadow(), "ProgressBar.selectionForeground", getControl(), "RadioButton.background", getControl(), "RadioButton.darkShadow", getControlDarkShadow(), "RadioButton.disabledText", getInactiveControlTextColor(), "RadioButton.icon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) { return MetalIconFactory.getRadioButtonIcon(); } }, "RadioButton.focus", MetalLookAndFeel.getFocusColor(), "RadioButton.font", MetalLookAndFeel.getControlTextFont(), "RadioButton.foreground", getControlTextColor(), "RadioButton.highlight", getControlHighlight(), "RadioButton.light", getControlHighlight(), "RadioButton.select", getControlShadow(), "RadioButton.shadow", getControlShadow(), "RadioButtonMenuItem.acceleratorFont", new Font("Dialog", Font.PLAIN, 10), "RadioButtonMenuItem.acceleratorForeground", getAcceleratorForeground(), "RadioButtonMenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "RadioButtonMenuItem.background", getMenuBackground(), "RadioButtonMenuItem.border", new MetalBorders.MenuItemBorder(), "RadioButtonMenuItem.borderPainted", Boolean.TRUE, "RadioButtonMenuItem.checkIcon", MetalIconFactory.getRadioButtonMenuItemIcon(), "RadioButtonMenuItem.disabledForeground", getMenuDisabledForeground(), "RadioButtonMenuItem.font", MetalLookAndFeel.getControlTextFont(), "RadioButtonMenuItem.foreground", getMenuForeground(), "RadioButtonMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "RadioButtonMenuItem.selectionBackground", MetalLookAndFeel.getMenuSelectedBackground(), "RadioButtonMenuItem.selectionForeground", MetalLookAndFeel.getMenuSelectedForeground(), "ScrollBar.background", getControl(), "ScrollBar.darkShadow", getControlDarkShadow(), "ScrollBar.foreground", getControl(), "ScrollBar.highlight", getControlHighlight(), "ScrollBar.shadow", getControlShadow(), "ScrollBar.thumb", getPrimaryControlShadow(), "ScrollBar.thumbDarkShadow", getControlDarkShadow(), "ScrollBar.thumbHighlight", getPrimaryControl(), "ScrollBar.thumbShadow", getPrimaryControlDarkShadow(), "ScrollBar.track", getControl(), "ScrollBar.trackHighlight", getControlDarkShadow(), "ScrollPane.background", getControl(), "ScrollPane.border", new MetalBorders.ScrollPaneBorder(), "ScrollPane.foreground", getControlTextColor(), "Separator.background", getSeparatorBackground(), "Separator.foreground", getSeparatorForeground(), "Separator.highlight", getControlHighlight(), "Separator.shadow", getControlShadow(), "Slider.background", getControl(), "Slider.focus", getFocusColor(), "Slider.focusInsets", new InsetsUIResource(0, 0, 0, 0), "Slider.foreground", getPrimaryControlShadow(), "Slider.highlight", getControlHighlight(), "Slider.horizontalThumbIcon", MetalIconFactory.getHorizontalSliderThumbIcon(), "Slider.majorTickLength", new Integer(6), "Slider.shadow", getControlShadow(), "Slider.trackWidth", new Integer(7), "Slider.verticalThumbIcon", MetalIconFactory.getVerticalSliderThumbIcon(), "Spinner.background", getControl(), "Spinner.font", new FontUIResource("Dialog", Font.BOLD, 12), "Spinner.foreground", getControl(), "SplitPane.background", getControl(), "SplitPane.darkShadow", getControlDarkShadow(), "SplitPane.dividerFocusColor", getPrimaryControl(), "SplitPane.highlight", getControlHighlight(), "SplitPane.shadow", getControlShadow(), "SplitPaneDivider.draggingColor", Color.DARK_GRAY, "TabbedPane.background", getControlShadow(), "TabbedPane.darkShadow", getControlDarkShadow(), "TabbedPane.focus", getPrimaryControlDarkShadow(), "TabbedPane.font", new FontUIResource("Dialog", Font.BOLD, 12), "TabbedPane.foreground", getControlTextColor(), "TabbedPane.highlight", getControlHighlight(), "TabbedPane.light", getControl(), "TabbedPane.selected", getControl(), "TabbedPane.selectHighlight", getControlHighlight(), "TabbedPane.selectedTabPadInsets", new InsetsUIResource(2, 2, 2, 1), "TabbedPane.shadow", getControlShadow(), "TabbedPane.tabAreaBackground", getControl(), "TabbedPane.tabAreaInsets", new InsetsUIResource(4, 2, 0, 6), "TabbedPane.tabInsets", new InsetsUIResource(0, 9, 1, 9), "Table.background", getWindowBackground(), "Table.focusCellBackground", getWindowBackground(), "Table.focusCellForeground", getControlTextColor(), "Table.foreground", getControlTextColor(), "Table.focusCellHighlightBorder", getControlShadow(), "Table.focusCellBackground", getWindowBackground(), "Table.gridColor", getControlShadow(), "TableHeader.background", getControl(), "TableHeader.foreground", getControlTextColor(), "TextArea.background", getWindowBackground(), "TextArea.caretForeground", getUserTextColor(), "TextArea.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TextArea.foreground", getUserTextColor(), "TextArea.inactiveForeground", getInactiveSystemTextColor(), "TextArea.selectionBackground", getTextHighlightColor(), "TextArea.selectionForeground", getHighlightedTextColor(), "TextField.background", getWindowBackground(), "TextField.border", MetalBorders.getTextFieldBorder(), "TextField.caretForeground", getUserTextColor(), "TextField.darkShadow", getControlDarkShadow(), "TextField.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TextField.foreground", getUserTextColor(), "TextField.highlight", getControlHighlight(), "TextField.inactiveBackground", getControl(), "TextField.inactiveForeground", getInactiveSystemTextColor(), "TextField.light", getControlHighlight(), "TextField.selectionBackground", getTextHighlightColor(), "TextField.selectionForeground", getHighlightedTextColor(), "TextField.shadow", getControlShadow(), "TextPane.background", getWindowBackground(), "TextPane.caretForeground", getUserTextColor(), "TextPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TextPane.foreground", getUserTextColor(), "TextPane.inactiveForeground", getInactiveSystemTextColor(), "TextPane.selectionBackground", getTextHighlightColor(), "TextPane.selectionForeground", getHighlightedTextColor(), "TitledBorder.font", new FontUIResource("Dialog", Font.BOLD, 12), "TitledBorder.titleColor", getSystemTextColor(), "ToggleButton.background", getControl(), "ToggleButton.border", MetalBorders.getButtonBorder(), "ToggleButton.darkShadow", getControlDarkShadow(), "ToggleButton.disabledText", getInactiveControlTextColor(), "ToggleButton.focus", new ColorUIResource(getFocusColor()), "ToggleButton.font", getControlTextFont(), "ToggleButton.foreground", getControlTextColor(), "ToggleButton.highlight", getControlHighlight(), "ToggleButton.light", getControlHighlight(), "ToggleButton.margin", new Insets(2, 14, 2, 14), "ToggleButton.select", getControlShadow(), "ToggleButton.shadow", getControlShadow(), "ToolBar.background", getMenuBackground(), "ToolBar.darkShadow", getControlDarkShadow(), "ToolBar.dockingBackground", getMenuBackground(), "ToolBar.dockingForeground", getPrimaryControlDarkShadow(), "ToolBar.floatingBackground", getMenuBackground(), "ToolBar.floatingForeground", getPrimaryControl(), "ToolBar.font", new FontUIResource("Dialog", Font.BOLD, 12), "ToolBar.foreground", getMenuForeground(), "ToolBar.highlight", getControlHighlight(), "ToolBar.light", getControlHighlight(), "ToolBar.shadow", getControlShadow(), "ToolTip.background", getPrimaryControl(), "ToolTip.backgroundInactive", getControl(), "ToolTip.border", new BorderUIResource.LineBorderUIResource(getPrimaryControlDarkShadow(), 1), "ToolTip.borderInactive", new BorderUIResource.LineBorderUIResource(getControlDarkShadow(), 1), "ToolTip.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ToolTip.foreground", getPrimaryControlInfo(), "ToolTip.foregroundInactive", getControlDarkShadow(), "Tree.background", getWindowBackground(), "Tree.closedIcon", MetalIconFactory.getTreeFolderIcon(), "Tree.collapsedIcon", MetalIconFactory.getTreeControlIcon(true), "Tree.expandedIcon", MetalIconFactory.getTreeControlIcon(false), "Tree.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Tree.foreground", getUserTextColor(), "Tree.hash", getPrimaryControl(), "Tree.leafIcon", MetalIconFactory.getTreeLeafIcon(), "Tree.leftChildIndent", new Integer(7), "Tree.line", getPrimaryControl(), "Tree.openIcon", MetalIconFactory.getTreeFolderIcon(), "Tree.rightChildIndent", new Integer(13), "Tree.rowHeight", new Integer(20), "Tree.scrollsOnExpand", Boolean.TRUE, "Tree.selectionBackground", getTextHighlightColor(), "Tree.selectionBorder", new BorderUIResource.LineBorderUIResource(new Color(102, 102, 153)), "Tree.selectionBorderColor", getFocusColor(), "Tree.selectionForeground", getHighlightedTextColor(), "Tree.textBackground", getWindowBackground(), "Tree.textForeground", getUserTextColor(), "Viewport.background", getControl(), "Viewport.foreground", getUserTextColor() }; defaults.putDefaults(myDefaults); }
"ToggleButton.focus", new ColorUIResource(getFocusColor()),
"ToggleButton.focus", getFocusColor(),
protected void initComponentDefaults(UIDefaults defaults) { super.initComponentDefaults(defaults); Object[] myDefaults = new Object[] { "Button.background", getControl(), "Button.border", MetalBorders.getButtonBorder(), "Button.darkShadow", getControlDarkShadow(), "Button.disabledText", getInactiveControlTextColor(), "Button.focus", getFocusColor(), "Button.font", getControlTextFont(), "Button.foreground", getControlTextColor(), "Button.highlight", getControlHighlight(), "Button.light", getControlHighlight(), "Button.margin", new Insets(2, 14, 2, 14), "Button.select", getControlShadow(), "Button.shadow", getControlShadow(), "CheckBox.background", getControl(), "CheckBox.border", MetalBorders.getButtonBorder(), "CheckBox.disabledText", getInactiveControlTextColor(), "CheckBox.focus", getFocusColor(), "CheckBox.font", new FontUIResource("Dialog", Font.BOLD, 12), "CheckBox.foreground", getControlTextColor(), "CheckBox.icon", new UIDefaults.ProxyLazyValue ("javax.swing.plaf.metal.MetalCheckBoxIcon"), "CheckBox.checkIcon", new UIDefaults.ProxyLazyValue ("javax.swing.plaf.metal.MetalCheckBoxIcon"), "Checkbox.select", getControlShadow(), "CheckBoxMenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), "CheckBoxMenuItem.acceleratorForeground", getAcceleratorForeground(), "CheckBoxMenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "CheckBoxMenuItem.background", getMenuBackground(), "CheckBoxMenuItem.borderPainted", new Boolean(true), "CheckBoxMenuItem.commandSound", "sounds/MenuItemCommand.wav", "CheckBoxMenuItem.checkIcon", MetalIconFactory.getCheckBoxMenuItemIcon(), "CheckBoxMenuItem.disabledForeground", getMenuDisabledForeground(), "CheckBoxMenuItem.font", new FontUIResource("Dialog", Font.BOLD, 12), "CheckBoxMenuItem.foreground", getMenuForeground(), "CheckBoxMenuItem.selectionBackground", getMenuSelectedBackground(), "CheckBoxMenuItem.selectionForeground", getMenuSelectedForeground(), "ColorChooser.background", getControl(), "ColorChooser.foreground", getControlTextColor(), "ColorChooser.rgbBlueMnemonic", new Integer(0), "ColorChooser.rgbGreenMnemonic", new Integer(0), "ColorChooser.rgbRedMnemonic", new Integer(0), "ColorChooser.swatchesDefaultRecentColor", getControl(), "ComboBox.background", getControl(), "ComboBox.buttonBackground", getControl(), "ComboBox.buttonDarkShadow", getControlDarkShadow(), "ComboBox.buttonHighlight", getControlHighlight(), "ComboBox.buttonShadow", getControlShadow(), "ComboBox.disabledBackground", getControl(), "ComboBox.disabledForeground", getInactiveSystemTextColor(), "ComboBox.font", new FontUIResource("Dialog", Font.BOLD, 12), "ComboBox.foreground", getControlTextColor(), "ComboBox.selectionBackground", getPrimaryControlShadow(), "ComboBox.selectionForeground", getControlTextColor(), "Desktop.background", getDesktopColor(), "DesktopIcon.background", getControl(), "DesktopIcon.foreground", getControlTextColor(), "DesktopIcon.width", new Integer(160), "EditorPane.background", getWindowBackground(), "EditorPane.caretForeground", getUserTextColor(), "EditorPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "EditorPane.foreground", getUserTextColor(), "EditorPane.inactiveForeground", getInactiveSystemTextColor(), "EditorPane.selectionBackground", getTextHighlightColor(), "EditorPane.selectionForeground", getHighlightedTextColor(), "FormattedTextField.background", getWindowBackground(), "FormattedTextField.caretForeground", getUserTextColor(), "FormattedTextField.font", new FontUIResource("Dialog", Font.PLAIN, 12), "FormattedTextField.foreground", getUserTextColor(), "FormattedTextField.inactiveBackground", getControl(), "FormattedTextField.inactiveForeground", getInactiveSystemTextColor(), "FormattedTextField.selectionBackground", getTextHighlightColor(), "FormattedTextField.selectionForeground", getHighlightedTextColor(), "InternalFrame.activeTitleBackground", getWindowTitleBackground(), "InternalFrame.activeTitleForeground", getWindowTitleForeground(), "InternalFrame.border", new MetalBorders.InternalFrameBorder(), "InternalFrame.borderColor", getControl(), "InternalFrame.borderDarkShadow", getControlDarkShadow(), "InternalFrame.borderHighlight", getControlHighlight(), "InternalFrame.borderLight", getControlHighlight(), "InternalFrame.borderShadow", getControlShadow(), "InternalFrame.icon", MetalIconFactory.getInternalFrameDefaultMenuIcon(), "InternalFrame.closeIcon", MetalIconFactory.getInternalFrameCloseIcon(16), "InternalFrame.inactiveTitleBackground", getWindowTitleInactiveBackground(), "InternalFrame.inactiveTitleForeground", getWindowTitleInactiveForeground(), "InternalFrame.maximizeIcon", MetalIconFactory.getInternalFrameMaximizeIcon(16), "InternalFrame.iconifyIcon", MetalIconFactory.getInternalFrameMinimizeIcon(16), "Label.background", getControl(), "Label.disabledForeground", getInactiveSystemTextColor(), "Label.disabledShadow", getControlShadow(), "Label.font", getControlTextFont(), "Label.foreground", getSystemTextColor(), "List.background", getWindowBackground(), "List.foreground", getUserTextColor(), "List.selectionBackground", getTextHighlightColor(), "List.selectionForeground", getHighlightedTextColor(), "Menu.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), "Menu.acceleratorForeground", getAcceleratorForeground(), "Menu.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "Menu.background", getMenuBackground(), "Menu.border", new MetalBorders.MenuItemBorder(), "Menu.borderPainted", Boolean.TRUE, "Menu.disabledForeground", getMenuDisabledForeground(), "Menu.font", getControlTextFont(), "Menu.foreground", getMenuForeground(), "Menu.selectionBackground", getMenuSelectedBackground(), "Menu.selectionForeground", getMenuSelectedForeground(), "MenuBar.background", getMenuBackground(), "MenuBar.border", new MetalBorders.MenuBarBorder(), "MenuBar.font", getControlTextFont(), "MenuBar.foreground", getMenuForeground(), "MenuBar.highlight", getControlHighlight(), "MenuBar.shadow", getControlShadow(), "MenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), "MenuItem.acceleratorForeground", getAcceleratorForeground(), "MenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "MenuItem.background", getMenuBackground(), "MenuItem.border", new MetalBorders.MenuItemBorder(), "MenuItem.disabledForeground", getMenuDisabledForeground(), "MenuItem.font", getControlTextFont(), "MenuItem.foreground", getMenuForeground(), "MenuItem.selectionBackground", getMenuSelectedBackground(), "MenuItem.selectionForeground", getMenuSelectedForeground(), "OptionPane.background", getControl(), "OptionPane.errorDialog.border.background", new ColorUIResource(153, 51, 51), "OptionPane.errorDialog.titlePane.background", new ColorUIResource(255, 153, 153), "OptionPane.errorDialog.titlePane.foreground", new ColorUIResource(51, 0, 0), "OptionPane.errorDialog.titlePane.shadow", new ColorUIResource(204, 102, 102), "OptionPane.foreground", getControlTextColor(), "OptionPane.messageForeground", getControlTextColor(), "OptionPane.questionDialog.border.background", new ColorUIResource(51, 102, 51), "OptionPane.questionDialog.titlePane.background", new ColorUIResource(153, 204, 153), "OptionPane.questionDialog.titlePane.foreground", new ColorUIResource(0, 51, 0), "OptionPane.questionDialog.titlePane.shadow", new ColorUIResource(102, 153, 102), "OptionPane.warningDialog.border.background", new ColorUIResource(153, 102, 51), "OptionPane.warningDialog.titlePane.background", new ColorUIResource(255, 204, 153), "OptionPane.warningDialog.titlePane.foreground", new ColorUIResource(102, 51, 0), "OptionPane.warningDialog.titlePane.shadow", new ColorUIResource(204, 153, 102), "Panel.background", getControl(), "Panel.foreground", getUserTextColor(), "PasswordField.background", getWindowBackground(), "PasswordField.caretForeground", getUserTextColor(), "PasswordField.foreground", getUserTextColor(), "PasswordField.inactiveBackground", getControl(), "PasswordField.inactiveForeground", getInactiveSystemTextColor(), "PasswordField.selectionBackground", getTextHighlightColor(), "PasswordField.selectionForeground", getHighlightedTextColor(), "PopupMenu.background", getMenuBackground(), "PopupMenu.border", new MetalBorders.PopupMenuBorder(), "PopupMenu.font", new FontUIResource("Dialog", Font.BOLD, 12), "PopupMenu.foreground", getMenuForeground(), "ProgressBar.background", getControl(), "ProgressBar.border", new BorderUIResource.LineBorderUIResource(getControlDarkShadow(), 1), "ProgressBar.font", new FontUIResource("Dialog", Font.BOLD, 12), "ProgressBar.foreground", getPrimaryControlShadow(), "ProgressBar.selectionBackground", getPrimaryControlDarkShadow(), "ProgressBar.selectionForeground", getControl(), "RadioButton.background", getControl(), "RadioButton.darkShadow", getControlDarkShadow(), "RadioButton.disabledText", getInactiveControlTextColor(), "RadioButton.icon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) { return MetalIconFactory.getRadioButtonIcon(); } }, "RadioButton.focus", MetalLookAndFeel.getFocusColor(), "RadioButton.font", MetalLookAndFeel.getControlTextFont(), "RadioButton.foreground", getControlTextColor(), "RadioButton.highlight", getControlHighlight(), "RadioButton.light", getControlHighlight(), "RadioButton.select", getControlShadow(), "RadioButton.shadow", getControlShadow(), "RadioButtonMenuItem.acceleratorFont", new Font("Dialog", Font.PLAIN, 10), "RadioButtonMenuItem.acceleratorForeground", getAcceleratorForeground(), "RadioButtonMenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "RadioButtonMenuItem.background", getMenuBackground(), "RadioButtonMenuItem.border", new MetalBorders.MenuItemBorder(), "RadioButtonMenuItem.borderPainted", Boolean.TRUE, "RadioButtonMenuItem.checkIcon", MetalIconFactory.getRadioButtonMenuItemIcon(), "RadioButtonMenuItem.disabledForeground", getMenuDisabledForeground(), "RadioButtonMenuItem.font", MetalLookAndFeel.getControlTextFont(), "RadioButtonMenuItem.foreground", getMenuForeground(), "RadioButtonMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "RadioButtonMenuItem.selectionBackground", MetalLookAndFeel.getMenuSelectedBackground(), "RadioButtonMenuItem.selectionForeground", MetalLookAndFeel.getMenuSelectedForeground(), "ScrollBar.background", getControl(), "ScrollBar.darkShadow", getControlDarkShadow(), "ScrollBar.foreground", getControl(), "ScrollBar.highlight", getControlHighlight(), "ScrollBar.shadow", getControlShadow(), "ScrollBar.thumb", getPrimaryControlShadow(), "ScrollBar.thumbDarkShadow", getControlDarkShadow(), "ScrollBar.thumbHighlight", getPrimaryControl(), "ScrollBar.thumbShadow", getPrimaryControlDarkShadow(), "ScrollBar.track", getControl(), "ScrollBar.trackHighlight", getControlDarkShadow(), "ScrollPane.background", getControl(), "ScrollPane.border", new MetalBorders.ScrollPaneBorder(), "ScrollPane.foreground", getControlTextColor(), "Separator.background", getSeparatorBackground(), "Separator.foreground", getSeparatorForeground(), "Separator.highlight", getControlHighlight(), "Separator.shadow", getControlShadow(), "Slider.background", getControl(), "Slider.focus", getFocusColor(), "Slider.focusInsets", new InsetsUIResource(0, 0, 0, 0), "Slider.foreground", getPrimaryControlShadow(), "Slider.highlight", getControlHighlight(), "Slider.horizontalThumbIcon", MetalIconFactory.getHorizontalSliderThumbIcon(), "Slider.majorTickLength", new Integer(6), "Slider.shadow", getControlShadow(), "Slider.trackWidth", new Integer(7), "Slider.verticalThumbIcon", MetalIconFactory.getVerticalSliderThumbIcon(), "Spinner.background", getControl(), "Spinner.font", new FontUIResource("Dialog", Font.BOLD, 12), "Spinner.foreground", getControl(), "SplitPane.background", getControl(), "SplitPane.darkShadow", getControlDarkShadow(), "SplitPane.dividerFocusColor", getPrimaryControl(), "SplitPane.highlight", getControlHighlight(), "SplitPane.shadow", getControlShadow(), "SplitPaneDivider.draggingColor", Color.DARK_GRAY, "TabbedPane.background", getControlShadow(), "TabbedPane.darkShadow", getControlDarkShadow(), "TabbedPane.focus", getPrimaryControlDarkShadow(), "TabbedPane.font", new FontUIResource("Dialog", Font.BOLD, 12), "TabbedPane.foreground", getControlTextColor(), "TabbedPane.highlight", getControlHighlight(), "TabbedPane.light", getControl(), "TabbedPane.selected", getControl(), "TabbedPane.selectHighlight", getControlHighlight(), "TabbedPane.selectedTabPadInsets", new InsetsUIResource(2, 2, 2, 1), "TabbedPane.shadow", getControlShadow(), "TabbedPane.tabAreaBackground", getControl(), "TabbedPane.tabAreaInsets", new InsetsUIResource(4, 2, 0, 6), "TabbedPane.tabInsets", new InsetsUIResource(0, 9, 1, 9), "Table.background", getWindowBackground(), "Table.focusCellBackground", getWindowBackground(), "Table.focusCellForeground", getControlTextColor(), "Table.foreground", getControlTextColor(), "Table.focusCellHighlightBorder", getControlShadow(), "Table.focusCellBackground", getWindowBackground(), "Table.gridColor", getControlShadow(), "TableHeader.background", getControl(), "TableHeader.foreground", getControlTextColor(), "TextArea.background", getWindowBackground(), "TextArea.caretForeground", getUserTextColor(), "TextArea.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TextArea.foreground", getUserTextColor(), "TextArea.inactiveForeground", getInactiveSystemTextColor(), "TextArea.selectionBackground", getTextHighlightColor(), "TextArea.selectionForeground", getHighlightedTextColor(), "TextField.background", getWindowBackground(), "TextField.border", MetalBorders.getTextFieldBorder(), "TextField.caretForeground", getUserTextColor(), "TextField.darkShadow", getControlDarkShadow(), "TextField.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TextField.foreground", getUserTextColor(), "TextField.highlight", getControlHighlight(), "TextField.inactiveBackground", getControl(), "TextField.inactiveForeground", getInactiveSystemTextColor(), "TextField.light", getControlHighlight(), "TextField.selectionBackground", getTextHighlightColor(), "TextField.selectionForeground", getHighlightedTextColor(), "TextField.shadow", getControlShadow(), "TextPane.background", getWindowBackground(), "TextPane.caretForeground", getUserTextColor(), "TextPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TextPane.foreground", getUserTextColor(), "TextPane.inactiveForeground", getInactiveSystemTextColor(), "TextPane.selectionBackground", getTextHighlightColor(), "TextPane.selectionForeground", getHighlightedTextColor(), "TitledBorder.font", new FontUIResource("Dialog", Font.BOLD, 12), "TitledBorder.titleColor", getSystemTextColor(), "ToggleButton.background", getControl(), "ToggleButton.border", MetalBorders.getButtonBorder(), "ToggleButton.darkShadow", getControlDarkShadow(), "ToggleButton.disabledText", getInactiveControlTextColor(), "ToggleButton.focus", new ColorUIResource(getFocusColor()), "ToggleButton.font", getControlTextFont(), "ToggleButton.foreground", getControlTextColor(), "ToggleButton.highlight", getControlHighlight(), "ToggleButton.light", getControlHighlight(), "ToggleButton.margin", new Insets(2, 14, 2, 14), "ToggleButton.select", getControlShadow(), "ToggleButton.shadow", getControlShadow(), "ToolBar.background", getMenuBackground(), "ToolBar.darkShadow", getControlDarkShadow(), "ToolBar.dockingBackground", getMenuBackground(), "ToolBar.dockingForeground", getPrimaryControlDarkShadow(), "ToolBar.floatingBackground", getMenuBackground(), "ToolBar.floatingForeground", getPrimaryControl(), "ToolBar.font", new FontUIResource("Dialog", Font.BOLD, 12), "ToolBar.foreground", getMenuForeground(), "ToolBar.highlight", getControlHighlight(), "ToolBar.light", getControlHighlight(), "ToolBar.shadow", getControlShadow(), "ToolTip.background", getPrimaryControl(), "ToolTip.backgroundInactive", getControl(), "ToolTip.border", new BorderUIResource.LineBorderUIResource(getPrimaryControlDarkShadow(), 1), "ToolTip.borderInactive", new BorderUIResource.LineBorderUIResource(getControlDarkShadow(), 1), "ToolTip.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ToolTip.foreground", getPrimaryControlInfo(), "ToolTip.foregroundInactive", getControlDarkShadow(), "Tree.background", getWindowBackground(), "Tree.closedIcon", MetalIconFactory.getTreeFolderIcon(), "Tree.collapsedIcon", MetalIconFactory.getTreeControlIcon(true), "Tree.expandedIcon", MetalIconFactory.getTreeControlIcon(false), "Tree.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Tree.foreground", getUserTextColor(), "Tree.hash", getPrimaryControl(), "Tree.leafIcon", MetalIconFactory.getTreeLeafIcon(), "Tree.leftChildIndent", new Integer(7), "Tree.line", getPrimaryControl(), "Tree.openIcon", MetalIconFactory.getTreeFolderIcon(), "Tree.rightChildIndent", new Integer(13), "Tree.rowHeight", new Integer(20), "Tree.scrollsOnExpand", Boolean.TRUE, "Tree.selectionBackground", getTextHighlightColor(), "Tree.selectionBorder", new BorderUIResource.LineBorderUIResource(new Color(102, 102, 153)), "Tree.selectionBorderColor", getFocusColor(), "Tree.selectionForeground", getHighlightedTextColor(), "Tree.textBackground", getWindowBackground(), "Tree.textForeground", getUserTextColor(), "Viewport.background", getControl(), "Viewport.foreground", getUserTextColor() }; defaults.putDefaults(myDefaults); }
"ToggleButton.margin", new Insets(2, 14, 2, 14),
"ToggleButton.margin", new InsetsUIResource(2, 14, 2, 14),
protected void initComponentDefaults(UIDefaults defaults) { super.initComponentDefaults(defaults); Object[] myDefaults = new Object[] { "Button.background", getControl(), "Button.border", MetalBorders.getButtonBorder(), "Button.darkShadow", getControlDarkShadow(), "Button.disabledText", getInactiveControlTextColor(), "Button.focus", getFocusColor(), "Button.font", getControlTextFont(), "Button.foreground", getControlTextColor(), "Button.highlight", getControlHighlight(), "Button.light", getControlHighlight(), "Button.margin", new Insets(2, 14, 2, 14), "Button.select", getControlShadow(), "Button.shadow", getControlShadow(), "CheckBox.background", getControl(), "CheckBox.border", MetalBorders.getButtonBorder(), "CheckBox.disabledText", getInactiveControlTextColor(), "CheckBox.focus", getFocusColor(), "CheckBox.font", new FontUIResource("Dialog", Font.BOLD, 12), "CheckBox.foreground", getControlTextColor(), "CheckBox.icon", new UIDefaults.ProxyLazyValue ("javax.swing.plaf.metal.MetalCheckBoxIcon"), "CheckBox.checkIcon", new UIDefaults.ProxyLazyValue ("javax.swing.plaf.metal.MetalCheckBoxIcon"), "Checkbox.select", getControlShadow(), "CheckBoxMenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), "CheckBoxMenuItem.acceleratorForeground", getAcceleratorForeground(), "CheckBoxMenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "CheckBoxMenuItem.background", getMenuBackground(), "CheckBoxMenuItem.borderPainted", new Boolean(true), "CheckBoxMenuItem.commandSound", "sounds/MenuItemCommand.wav", "CheckBoxMenuItem.checkIcon", MetalIconFactory.getCheckBoxMenuItemIcon(), "CheckBoxMenuItem.disabledForeground", getMenuDisabledForeground(), "CheckBoxMenuItem.font", new FontUIResource("Dialog", Font.BOLD, 12), "CheckBoxMenuItem.foreground", getMenuForeground(), "CheckBoxMenuItem.selectionBackground", getMenuSelectedBackground(), "CheckBoxMenuItem.selectionForeground", getMenuSelectedForeground(), "ColorChooser.background", getControl(), "ColorChooser.foreground", getControlTextColor(), "ColorChooser.rgbBlueMnemonic", new Integer(0), "ColorChooser.rgbGreenMnemonic", new Integer(0), "ColorChooser.rgbRedMnemonic", new Integer(0), "ColorChooser.swatchesDefaultRecentColor", getControl(), "ComboBox.background", getControl(), "ComboBox.buttonBackground", getControl(), "ComboBox.buttonDarkShadow", getControlDarkShadow(), "ComboBox.buttonHighlight", getControlHighlight(), "ComboBox.buttonShadow", getControlShadow(), "ComboBox.disabledBackground", getControl(), "ComboBox.disabledForeground", getInactiveSystemTextColor(), "ComboBox.font", new FontUIResource("Dialog", Font.BOLD, 12), "ComboBox.foreground", getControlTextColor(), "ComboBox.selectionBackground", getPrimaryControlShadow(), "ComboBox.selectionForeground", getControlTextColor(), "Desktop.background", getDesktopColor(), "DesktopIcon.background", getControl(), "DesktopIcon.foreground", getControlTextColor(), "DesktopIcon.width", new Integer(160), "EditorPane.background", getWindowBackground(), "EditorPane.caretForeground", getUserTextColor(), "EditorPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "EditorPane.foreground", getUserTextColor(), "EditorPane.inactiveForeground", getInactiveSystemTextColor(), "EditorPane.selectionBackground", getTextHighlightColor(), "EditorPane.selectionForeground", getHighlightedTextColor(), "FormattedTextField.background", getWindowBackground(), "FormattedTextField.caretForeground", getUserTextColor(), "FormattedTextField.font", new FontUIResource("Dialog", Font.PLAIN, 12), "FormattedTextField.foreground", getUserTextColor(), "FormattedTextField.inactiveBackground", getControl(), "FormattedTextField.inactiveForeground", getInactiveSystemTextColor(), "FormattedTextField.selectionBackground", getTextHighlightColor(), "FormattedTextField.selectionForeground", getHighlightedTextColor(), "InternalFrame.activeTitleBackground", getWindowTitleBackground(), "InternalFrame.activeTitleForeground", getWindowTitleForeground(), "InternalFrame.border", new MetalBorders.InternalFrameBorder(), "InternalFrame.borderColor", getControl(), "InternalFrame.borderDarkShadow", getControlDarkShadow(), "InternalFrame.borderHighlight", getControlHighlight(), "InternalFrame.borderLight", getControlHighlight(), "InternalFrame.borderShadow", getControlShadow(), "InternalFrame.icon", MetalIconFactory.getInternalFrameDefaultMenuIcon(), "InternalFrame.closeIcon", MetalIconFactory.getInternalFrameCloseIcon(16), "InternalFrame.inactiveTitleBackground", getWindowTitleInactiveBackground(), "InternalFrame.inactiveTitleForeground", getWindowTitleInactiveForeground(), "InternalFrame.maximizeIcon", MetalIconFactory.getInternalFrameMaximizeIcon(16), "InternalFrame.iconifyIcon", MetalIconFactory.getInternalFrameMinimizeIcon(16), "Label.background", getControl(), "Label.disabledForeground", getInactiveSystemTextColor(), "Label.disabledShadow", getControlShadow(), "Label.font", getControlTextFont(), "Label.foreground", getSystemTextColor(), "List.background", getWindowBackground(), "List.foreground", getUserTextColor(), "List.selectionBackground", getTextHighlightColor(), "List.selectionForeground", getHighlightedTextColor(), "Menu.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), "Menu.acceleratorForeground", getAcceleratorForeground(), "Menu.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "Menu.background", getMenuBackground(), "Menu.border", new MetalBorders.MenuItemBorder(), "Menu.borderPainted", Boolean.TRUE, "Menu.disabledForeground", getMenuDisabledForeground(), "Menu.font", getControlTextFont(), "Menu.foreground", getMenuForeground(), "Menu.selectionBackground", getMenuSelectedBackground(), "Menu.selectionForeground", getMenuSelectedForeground(), "MenuBar.background", getMenuBackground(), "MenuBar.border", new MetalBorders.MenuBarBorder(), "MenuBar.font", getControlTextFont(), "MenuBar.foreground", getMenuForeground(), "MenuBar.highlight", getControlHighlight(), "MenuBar.shadow", getControlShadow(), "MenuItem.acceleratorFont", new FontUIResource("Dialog", Font.PLAIN, 10), "MenuItem.acceleratorForeground", getAcceleratorForeground(), "MenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "MenuItem.background", getMenuBackground(), "MenuItem.border", new MetalBorders.MenuItemBorder(), "MenuItem.disabledForeground", getMenuDisabledForeground(), "MenuItem.font", getControlTextFont(), "MenuItem.foreground", getMenuForeground(), "MenuItem.selectionBackground", getMenuSelectedBackground(), "MenuItem.selectionForeground", getMenuSelectedForeground(), "OptionPane.background", getControl(), "OptionPane.errorDialog.border.background", new ColorUIResource(153, 51, 51), "OptionPane.errorDialog.titlePane.background", new ColorUIResource(255, 153, 153), "OptionPane.errorDialog.titlePane.foreground", new ColorUIResource(51, 0, 0), "OptionPane.errorDialog.titlePane.shadow", new ColorUIResource(204, 102, 102), "OptionPane.foreground", getControlTextColor(), "OptionPane.messageForeground", getControlTextColor(), "OptionPane.questionDialog.border.background", new ColorUIResource(51, 102, 51), "OptionPane.questionDialog.titlePane.background", new ColorUIResource(153, 204, 153), "OptionPane.questionDialog.titlePane.foreground", new ColorUIResource(0, 51, 0), "OptionPane.questionDialog.titlePane.shadow", new ColorUIResource(102, 153, 102), "OptionPane.warningDialog.border.background", new ColorUIResource(153, 102, 51), "OptionPane.warningDialog.titlePane.background", new ColorUIResource(255, 204, 153), "OptionPane.warningDialog.titlePane.foreground", new ColorUIResource(102, 51, 0), "OptionPane.warningDialog.titlePane.shadow", new ColorUIResource(204, 153, 102), "Panel.background", getControl(), "Panel.foreground", getUserTextColor(), "PasswordField.background", getWindowBackground(), "PasswordField.caretForeground", getUserTextColor(), "PasswordField.foreground", getUserTextColor(), "PasswordField.inactiveBackground", getControl(), "PasswordField.inactiveForeground", getInactiveSystemTextColor(), "PasswordField.selectionBackground", getTextHighlightColor(), "PasswordField.selectionForeground", getHighlightedTextColor(), "PopupMenu.background", getMenuBackground(), "PopupMenu.border", new MetalBorders.PopupMenuBorder(), "PopupMenu.font", new FontUIResource("Dialog", Font.BOLD, 12), "PopupMenu.foreground", getMenuForeground(), "ProgressBar.background", getControl(), "ProgressBar.border", new BorderUIResource.LineBorderUIResource(getControlDarkShadow(), 1), "ProgressBar.font", new FontUIResource("Dialog", Font.BOLD, 12), "ProgressBar.foreground", getPrimaryControlShadow(), "ProgressBar.selectionBackground", getPrimaryControlDarkShadow(), "ProgressBar.selectionForeground", getControl(), "RadioButton.background", getControl(), "RadioButton.darkShadow", getControlDarkShadow(), "RadioButton.disabledText", getInactiveControlTextColor(), "RadioButton.icon", new UIDefaults.LazyValue() { public Object createValue(UIDefaults def) { return MetalIconFactory.getRadioButtonIcon(); } }, "RadioButton.focus", MetalLookAndFeel.getFocusColor(), "RadioButton.font", MetalLookAndFeel.getControlTextFont(), "RadioButton.foreground", getControlTextColor(), "RadioButton.highlight", getControlHighlight(), "RadioButton.light", getControlHighlight(), "RadioButton.select", getControlShadow(), "RadioButton.shadow", getControlShadow(), "RadioButtonMenuItem.acceleratorFont", new Font("Dialog", Font.PLAIN, 10), "RadioButtonMenuItem.acceleratorForeground", getAcceleratorForeground(), "RadioButtonMenuItem.acceleratorSelectionForeground", getAcceleratorSelectedForeground(), "RadioButtonMenuItem.background", getMenuBackground(), "RadioButtonMenuItem.border", new MetalBorders.MenuItemBorder(), "RadioButtonMenuItem.borderPainted", Boolean.TRUE, "RadioButtonMenuItem.checkIcon", MetalIconFactory.getRadioButtonMenuItemIcon(), "RadioButtonMenuItem.disabledForeground", getMenuDisabledForeground(), "RadioButtonMenuItem.font", MetalLookAndFeel.getControlTextFont(), "RadioButtonMenuItem.foreground", getMenuForeground(), "RadioButtonMenuItem.margin", new InsetsUIResource(2, 2, 2, 2), "RadioButtonMenuItem.selectionBackground", MetalLookAndFeel.getMenuSelectedBackground(), "RadioButtonMenuItem.selectionForeground", MetalLookAndFeel.getMenuSelectedForeground(), "ScrollBar.background", getControl(), "ScrollBar.darkShadow", getControlDarkShadow(), "ScrollBar.foreground", getControl(), "ScrollBar.highlight", getControlHighlight(), "ScrollBar.shadow", getControlShadow(), "ScrollBar.thumb", getPrimaryControlShadow(), "ScrollBar.thumbDarkShadow", getControlDarkShadow(), "ScrollBar.thumbHighlight", getPrimaryControl(), "ScrollBar.thumbShadow", getPrimaryControlDarkShadow(), "ScrollBar.track", getControl(), "ScrollBar.trackHighlight", getControlDarkShadow(), "ScrollPane.background", getControl(), "ScrollPane.border", new MetalBorders.ScrollPaneBorder(), "ScrollPane.foreground", getControlTextColor(), "Separator.background", getSeparatorBackground(), "Separator.foreground", getSeparatorForeground(), "Separator.highlight", getControlHighlight(), "Separator.shadow", getControlShadow(), "Slider.background", getControl(), "Slider.focus", getFocusColor(), "Slider.focusInsets", new InsetsUIResource(0, 0, 0, 0), "Slider.foreground", getPrimaryControlShadow(), "Slider.highlight", getControlHighlight(), "Slider.horizontalThumbIcon", MetalIconFactory.getHorizontalSliderThumbIcon(), "Slider.majorTickLength", new Integer(6), "Slider.shadow", getControlShadow(), "Slider.trackWidth", new Integer(7), "Slider.verticalThumbIcon", MetalIconFactory.getVerticalSliderThumbIcon(), "Spinner.background", getControl(), "Spinner.font", new FontUIResource("Dialog", Font.BOLD, 12), "Spinner.foreground", getControl(), "SplitPane.background", getControl(), "SplitPane.darkShadow", getControlDarkShadow(), "SplitPane.dividerFocusColor", getPrimaryControl(), "SplitPane.highlight", getControlHighlight(), "SplitPane.shadow", getControlShadow(), "SplitPaneDivider.draggingColor", Color.DARK_GRAY, "TabbedPane.background", getControlShadow(), "TabbedPane.darkShadow", getControlDarkShadow(), "TabbedPane.focus", getPrimaryControlDarkShadow(), "TabbedPane.font", new FontUIResource("Dialog", Font.BOLD, 12), "TabbedPane.foreground", getControlTextColor(), "TabbedPane.highlight", getControlHighlight(), "TabbedPane.light", getControl(), "TabbedPane.selected", getControl(), "TabbedPane.selectHighlight", getControlHighlight(), "TabbedPane.selectedTabPadInsets", new InsetsUIResource(2, 2, 2, 1), "TabbedPane.shadow", getControlShadow(), "TabbedPane.tabAreaBackground", getControl(), "TabbedPane.tabAreaInsets", new InsetsUIResource(4, 2, 0, 6), "TabbedPane.tabInsets", new InsetsUIResource(0, 9, 1, 9), "Table.background", getWindowBackground(), "Table.focusCellBackground", getWindowBackground(), "Table.focusCellForeground", getControlTextColor(), "Table.foreground", getControlTextColor(), "Table.focusCellHighlightBorder", getControlShadow(), "Table.focusCellBackground", getWindowBackground(), "Table.gridColor", getControlShadow(), "TableHeader.background", getControl(), "TableHeader.foreground", getControlTextColor(), "TextArea.background", getWindowBackground(), "TextArea.caretForeground", getUserTextColor(), "TextArea.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TextArea.foreground", getUserTextColor(), "TextArea.inactiveForeground", getInactiveSystemTextColor(), "TextArea.selectionBackground", getTextHighlightColor(), "TextArea.selectionForeground", getHighlightedTextColor(), "TextField.background", getWindowBackground(), "TextField.border", MetalBorders.getTextFieldBorder(), "TextField.caretForeground", getUserTextColor(), "TextField.darkShadow", getControlDarkShadow(), "TextField.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TextField.foreground", getUserTextColor(), "TextField.highlight", getControlHighlight(), "TextField.inactiveBackground", getControl(), "TextField.inactiveForeground", getInactiveSystemTextColor(), "TextField.light", getControlHighlight(), "TextField.selectionBackground", getTextHighlightColor(), "TextField.selectionForeground", getHighlightedTextColor(), "TextField.shadow", getControlShadow(), "TextPane.background", getWindowBackground(), "TextPane.caretForeground", getUserTextColor(), "TextPane.font", new FontUIResource("Dialog", Font.PLAIN, 12), "TextPane.foreground", getUserTextColor(), "TextPane.inactiveForeground", getInactiveSystemTextColor(), "TextPane.selectionBackground", getTextHighlightColor(), "TextPane.selectionForeground", getHighlightedTextColor(), "TitledBorder.font", new FontUIResource("Dialog", Font.BOLD, 12), "TitledBorder.titleColor", getSystemTextColor(), "ToggleButton.background", getControl(), "ToggleButton.border", MetalBorders.getButtonBorder(), "ToggleButton.darkShadow", getControlDarkShadow(), "ToggleButton.disabledText", getInactiveControlTextColor(), "ToggleButton.focus", new ColorUIResource(getFocusColor()), "ToggleButton.font", getControlTextFont(), "ToggleButton.foreground", getControlTextColor(), "ToggleButton.highlight", getControlHighlight(), "ToggleButton.light", getControlHighlight(), "ToggleButton.margin", new Insets(2, 14, 2, 14), "ToggleButton.select", getControlShadow(), "ToggleButton.shadow", getControlShadow(), "ToolBar.background", getMenuBackground(), "ToolBar.darkShadow", getControlDarkShadow(), "ToolBar.dockingBackground", getMenuBackground(), "ToolBar.dockingForeground", getPrimaryControlDarkShadow(), "ToolBar.floatingBackground", getMenuBackground(), "ToolBar.floatingForeground", getPrimaryControl(), "ToolBar.font", new FontUIResource("Dialog", Font.BOLD, 12), "ToolBar.foreground", getMenuForeground(), "ToolBar.highlight", getControlHighlight(), "ToolBar.light", getControlHighlight(), "ToolBar.shadow", getControlShadow(), "ToolTip.background", getPrimaryControl(), "ToolTip.backgroundInactive", getControl(), "ToolTip.border", new BorderUIResource.LineBorderUIResource(getPrimaryControlDarkShadow(), 1), "ToolTip.borderInactive", new BorderUIResource.LineBorderUIResource(getControlDarkShadow(), 1), "ToolTip.font", new FontUIResource("Dialog", Font.PLAIN, 12), "ToolTip.foreground", getPrimaryControlInfo(), "ToolTip.foregroundInactive", getControlDarkShadow(), "Tree.background", getWindowBackground(), "Tree.closedIcon", MetalIconFactory.getTreeFolderIcon(), "Tree.collapsedIcon", MetalIconFactory.getTreeControlIcon(true), "Tree.expandedIcon", MetalIconFactory.getTreeControlIcon(false), "Tree.font", new FontUIResource("Dialog", Font.PLAIN, 12), "Tree.foreground", getUserTextColor(), "Tree.hash", getPrimaryControl(), "Tree.leafIcon", MetalIconFactory.getTreeLeafIcon(), "Tree.leftChildIndent", new Integer(7), "Tree.line", getPrimaryControl(), "Tree.openIcon", MetalIconFactory.getTreeFolderIcon(), "Tree.rightChildIndent", new Integer(13), "Tree.rowHeight", new Integer(20), "Tree.scrollsOnExpand", Boolean.TRUE, "Tree.selectionBackground", getTextHighlightColor(), "Tree.selectionBorder", new BorderUIResource.LineBorderUIResource(new Color(102, 102, 153)), "Tree.selectionBorderColor", getFocusColor(), "Tree.selectionForeground", getHighlightedTextColor(), "Tree.textBackground", getWindowBackground(), "Tree.textForeground", getUserTextColor(), "Viewport.background", getControl(), "Viewport.foreground", getUserTextColor() }; defaults.putDefaults(myDefaults); }
testForValidEmit(obj, cls.getName());
try { testForValidEmit(obj, cls.getName()); } catch (JNodeClassNotFoundException ex) { throw new BuildException(ex); }
public final void emitObject(Object obj) throws BuildException, ClassNotFoundException { if (obj == null) { return; } final Class cls = obj.getClass(); testForValidEmit(obj, cls.getName()); if (debugWriter != null) { debugWriter.println("$" + Integer.toHexString(os.getLength())); if (obj instanceof char[]) { final char[] a = (char[]) obj; for (int i = 0; i < a.length; i++) { debugWriter.print("'" + a[i] + "' "); } debugWriter.println(); } else if (obj instanceof byte[]) { final byte[] a = (byte[]) obj; for (int i = 0; i < a.length; i++) { debugWriter.print("" + a[i] + ' '); } debugWriter.println(); } else { debugWriter.println(obj); } } if (obj instanceof VmSystemObject) { ((VmSystemObject) obj).verifyBeforeEmit(); } // Writeout the header final VmClassType vmClass = (VmClassType) loaderContext.loadClass(cls.getName(), true); vmClass.incInstanceCount(); final X86Stream.ObjectInfo oInfo = os.startObject(vmClass); os.setObjectRef(obj); // If the object is a VmClass, force the loading of the // correspondig java.lang.Class if (cls.equals(VmType.class)) { VmType vmCls = (VmType) obj; String name = vmCls.getName().replace('/', '.'); if (!name.startsWith("java.lang")) { vmCls.asClassDuringBootstrap(); } } // Writeout object contents if (cls.equals(String.class)) { emitString((String) obj); } else if (cls.equals(Integer.class)) { emitInteger((Integer) obj); } else if (cls.equals(Long.class)) { emitLong((Long) obj); } else if (cls.equals(Class.class)) { emitClass((Class) obj); } else if (cls.isArray()) { emitArray(cls, obj, (VmArrayClass)vmClass); } else { emitObject(cls, obj); } oInfo.markEnd(); if (debugWriter != null) { debugWriter.println(); } }
emitObject(cls, obj);
try { emitObject(cls, obj); } catch (JNodeClassNotFoundException ex) { throw new BuildException(ex); }
public final void emitObject(Object obj) throws BuildException, ClassNotFoundException { if (obj == null) { return; } final Class cls = obj.getClass(); testForValidEmit(obj, cls.getName()); if (debugWriter != null) { debugWriter.println("$" + Integer.toHexString(os.getLength())); if (obj instanceof char[]) { final char[] a = (char[]) obj; for (int i = 0; i < a.length; i++) { debugWriter.print("'" + a[i] + "' "); } debugWriter.println(); } else if (obj instanceof byte[]) { final byte[] a = (byte[]) obj; for (int i = 0; i < a.length; i++) { debugWriter.print("" + a[i] + ' '); } debugWriter.println(); } else { debugWriter.println(obj); } } if (obj instanceof VmSystemObject) { ((VmSystemObject) obj).verifyBeforeEmit(); } // Writeout the header final VmClassType vmClass = (VmClassType) loaderContext.loadClass(cls.getName(), true); vmClass.incInstanceCount(); final X86Stream.ObjectInfo oInfo = os.startObject(vmClass); os.setObjectRef(obj); // If the object is a VmClass, force the loading of the // correspondig java.lang.Class if (cls.equals(VmType.class)) { VmType vmCls = (VmType) obj; String name = vmCls.getName().replace('/', '.'); if (!name.startsWith("java.lang")) { vmCls.asClassDuringBootstrap(); } } // Writeout object contents if (cls.equals(String.class)) { emitString((String) obj); } else if (cls.equals(Integer.class)) { emitInteger((Integer) obj); } else if (cls.equals(Long.class)) { emitLong((Long) obj); } else if (cls.equals(Class.class)) { emitClass((Class) obj); } else if (cls.isArray()) { emitArray(cls, obj, (VmArrayClass)vmClass); } else { emitObject(cls, obj); } oInfo.markEnd(); if (debugWriter != null) { debugWriter.println(); } }
public FieldInfo getFieldInfo(Class jdkType) throws ClassNotFoundException {
public FieldInfo getFieldInfo(Class jdkType) throws ClassNotFoundException, JNodeClassNotFoundException {
public FieldInfo getFieldInfo(Class jdkType) throws ClassNotFoundException { final String cname = jdkType.getName(); FieldInfo info = (FieldInfo)fieldInfos.get(cname); if (info == null) { final VmType jnodeType = loaderContext.loadClass(cname, true); info = new FieldInfo(jdkType, jnodeType); fieldInfos.put(cname, info); } return info; }
final VmType jnodeType = loaderContext.loadClass(cname, true);
VmType jnodeType = null; try { jnodeType = loaderContext.loadClass(cname, true); } catch (ClassNotFoundException ex) { throw new JNodeClassNotFoundException(cname); }
public FieldInfo getFieldInfo(Class jdkType) throws ClassNotFoundException { final String cname = jdkType.getName(); FieldInfo info = (FieldInfo)fieldInfos.get(cname); if (info == null) { final VmType jnodeType = loaderContext.loadClass(cname, true); info = new FieldInfo(jdkType, jnodeType); fieldInfos.put(cname, info); } return info; }
public final void testForValidEmit(Object object, String location) throws BuildException {
public final void testForValidEmit(Object object, String location) throws BuildException, JNodeClassNotFoundException {
public final void testForValidEmit(Object object, String location) throws BuildException { if (object == null) { return; } else if (object instanceof BootableObject) { return; } else if (object.getClass().isArray()) { return; } else if (object instanceof Class) { return; } else { final String clsName = object.getClass().getName().replace('/', '.'); /* * if (clsName.startsWith("org.jnode.")) { return; */ if (legalInstanceClasses.contains(clsName)) { return; } final FieldInfo fieldInfo; try { fieldInfo = getFieldInfo(object.getClass()); } catch (ClassNotFoundException ex) { throw new BuildException(ex); } if (!fieldInfo.isExact()) { BootLog.warn("Use of in-exact matching class (" + clsName + ") in bootimage at " + location); } legalInstanceClasses.add(clsName); return; /* * final Class javaClass = object.getClass(); try { final VmClassType vmClass = * (VmClassType)loaderContext.loadClass(javaClass.getName(), true); * testClassCompatibility(javaClass, vmClass); System.out.println("Found compatible * class " + clsName); legalInstanceClasses.add(clsName); } catch * (ClassNotFoundException ex) { throw new BuildException("VmClass not found for " + * clsName, ex); */// throw new BuildException("Cannot emit object of type " + clsName); } }
for(int i=0; i<nameLen; i++) name.append( (char)Ext2Utils.get8(data, offset+8+i) ); Ext2Debugger.debug("Ext2DirectoryRecord(): iNode="+iNodeNr+", name="+name,3);
for (int i = 0; i < nameLen; i++) name.append((char) Ext2Utils.get8(data, offset + 8 + i)); log.debug("Ext2DirectoryRecord(): iNode=" + iNodeNr + ", name=" + name);
public Ext2DirectoryRecord(byte[] data, int offset) { iNodeNr = (int)Ext2Utils.get32(data, offset); recLen = Ext2Utils.get16(data, offset+4); nameLen = Ext2Utils.get8(data, offset+6); type = Ext2Utils.get8(data, offset+7); name = new StringBuffer(); if(iNodeNr!=0) { //XXX character conversion for(int i=0; i<nameLen; i++) name.append( (char)Ext2Utils.get8(data, offset+8+i) ); Ext2Debugger.debug("Ext2DirectoryRecord(): iNode="+iNodeNr+", name="+name,3); } }
bad.minor = Minor.Any;
public static NoContext extract(Any any) { try { EmptyExceptionHolder h = (EmptyExceptionHolder) any.extract_Streamable(); return (NoContext) h.value; } catch (ClassCastException cex) { BAD_OPERATION bad = new BAD_OPERATION("NoContext expected"); bad.initCause(cex); throw bad; } }
throw new Error("not implemented");
DefaultDocumentEvent ev = new DefaultDocumentEvent(offset, length, DocumentEvent.EventType.CHANGE); buffer.change(offset, length, ev); Element root = getDefaultRootElement(); int paragraphCount = root.getElementCount(); for (int pindex = 0; pindex < paragraphCount; pindex++) { Element paragraph = root.getElement(pindex); if ((paragraph.getStartOffset() > offset + length) || (paragraph.getEndOffset() < offset)) continue; int contentCount = paragraph.getElementCount(); for (int cindex = 0; cindex < contentCount; cindex++) { Element content = paragraph.getElement(cindex); if ((content.getStartOffset() > offset + length) || (content.getEndOffset() < offset)) continue; if (content instanceof AbstractElement) { AbstractElement el = (AbstractElement) content; if (replace) el.removeAttributes(el); el.addAttributes(attributes); } else throw new AssertionError("content elements are expected to be" + "instances of " + "javax.swing.text.AbstractDocument.AbstractElement"); } }
public void setCharacterAttributes(int offset, int length, AttributeSet attributes, boolean replace) { // FIXME: Implement me. throw new Error("not implemented"); }
m.minor = Minor.UserException;
public static UnionMember read(InputStream istream) { try { UnionMember value = new UnionMember(); value.name = istream.read_string(); value.label = istream.read_any(); value.type = TypeCodeHelper.read(istream); value.type_def = IDLTypeHelper.read(istream); return value; } catch (UserException ex) { MARSHAL m = new MARSHAL(); m.initCause(ex); throw m; } }
m.minor = Minor.UserException;
public static void write(OutputStream ostream, UnionMember value) { try { ostream.write_string(value.name); ostream.write_any(value.label); TypeCodeHelper.write(ostream, value.type); IDLTypeHelper.write(ostream, value.type_def); } catch (UserException ex) { MARSHAL m = new MARSHAL(); m.initCause(ex); throw m; } }
if (inputMap != null)
public KeyStroke[] allKeys() { Set set = new HashSet(); if (parent != null) { Object[] parentKeys = parent.allKeys(); if (parentKeys != null) set.addAll(Arrays.asList(parentKeys)); } set.addAll(inputMap.keySet()); if (set.size() == 0) return null; KeyStroke[] array = new KeyStroke[set.size()]; return (KeyStroke[]) set.toArray(array); }
if (inputMap != null)
public void clear() { inputMap.clear(); }
Object result = inputMap.get(keystroke);
Object result = null; if (inputMap != null) result = inputMap.get(keystroke);
public Object get(KeyStroke keystroke) { Object result = inputMap.get(keystroke); if (result == null && parent != null) result = parent.get(keystroke); return result; }
if (size() != 0)
if (inputMap != null)
public KeyStroke[] keys() { if (size() != 0) { KeyStroke[] array = new KeyStroke[size()]; return (KeyStroke[]) inputMap.keySet().toArray(array); } return null; }
if (keystroke == null) return; if (inputMap == null) inputMap = new HashMap();
public void put(KeyStroke keystroke, Object actionMapKey) { if (actionMapKey == null) inputMap.remove(keystroke); else inputMap.put(keystroke, actionMapKey); }
if (inputMap != null)
public void remove(KeyStroke keystroke) { inputMap.remove(keystroke); }
return inputMap.size();
int result = 0; if (inputMap != null) result = inputMap.size(); return result;
public int size() { return inputMap.size(); }
public ConfigurationElementModel(PluginDescriptorModel plugin, XMLElement e) throws PluginException { super(plugin); name = e.getName(); final Enumeration<?> aI = e.enumerateAttributeNames(); if (aI.hasMoreElements()) { final ArrayList<AttributeModel> list = new ArrayList<AttributeModel>(); while (aI.hasMoreElements()) { final String name = (String)aI.nextElement(); final String value = e.getStringAttribute(name); list.add(new AttributeModel(name, value)); if (value == null) { throw new PluginException("Cannot find attribute value for attribute " + name); } } attributes = (AttributeModel[])list.toArray(new AttributeModel[list.size()]); } else { attributes = null; }
public ConfigurationElementModel(PluginDescriptorModel plugin, XMLElement e) throws PluginException { super(plugin); name = e.getName();
public ConfigurationElementModel(PluginDescriptorModel plugin, XMLElement e) throws PluginException { super(plugin); name = e.getName(); final Enumeration<?> aI = e.enumerateAttributeNames(); if (aI.hasMoreElements()) { final ArrayList<AttributeModel> list = new ArrayList<AttributeModel>(); while (aI.hasMoreElements()) { final String name = (String)aI.nextElement(); final String value = e.getStringAttribute(name); list.add(new AttributeModel(name, value)); if (value == null) { throw new PluginException("Cannot find attribute value for attribute " + name); } //System.out.println("name[" + name + "] value[" + value + "]"); } attributes = (AttributeModel[])list.toArray(new AttributeModel[list.size()]); } else { attributes = null; } final ArrayList<ConfigurationElementModel> list = new ArrayList<ConfigurationElementModel>(); for (Iterator<?> i = e.getChildren().iterator(); i.hasNext(); ) { final XMLElement ce = (XMLElement)i.next(); list.add(new ConfigurationElementModel(plugin, ce)); } elements = (ConfigurationElement[])list.toArray(new ConfigurationElement[list.size()]); }
final ArrayList<ConfigurationElementModel> list = new ArrayList<ConfigurationElementModel>(); for (Iterator<?> i = e.getChildren().iterator(); i.hasNext(); ) { final XMLElement ce = (XMLElement)i.next(); list.add(new ConfigurationElementModel(plugin, ce)); } elements = (ConfigurationElement[])list.toArray(new ConfigurationElement[list.size()]); }
final Enumeration<?> aI = e.enumerateAttributeNames(); if (aI.hasMoreElements()) { final ArrayList<AttributeModel> list = new ArrayList<AttributeModel>(); while (aI.hasMoreElements()) { final String name = (String) aI.nextElement(); final String value = e.getStringAttribute(name); list.add(new AttributeModel(name, value)); if (value == null) { throw new PluginException("Cannot find attribute value for attribute " + name); } } attributes = (AttributeModel[]) list.toArray(new AttributeModel[list.size()]); } else { attributes = null; } final ArrayList<ConfigurationElementModel> list = new ArrayList<ConfigurationElementModel>(); for (Iterator<?> i = e.getChildren().iterator(); i.hasNext();) { final XMLElement ce = (XMLElement) i.next(); list.add(new ConfigurationElementModel(plugin, ce)); } elements = (ConfigurationElement[]) list.toArray(new ConfigurationElement[list.size()]); }
public ConfigurationElementModel(PluginDescriptorModel plugin, XMLElement e) throws PluginException { super(plugin); name = e.getName(); final Enumeration<?> aI = e.enumerateAttributeNames(); if (aI.hasMoreElements()) { final ArrayList<AttributeModel> list = new ArrayList<AttributeModel>(); while (aI.hasMoreElements()) { final String name = (String)aI.nextElement(); final String value = e.getStringAttribute(name); list.add(new AttributeModel(name, value)); if (value == null) { throw new PluginException("Cannot find attribute value for attribute " + name); } //System.out.println("name[" + name + "] value[" + value + "]"); } attributes = (AttributeModel[])list.toArray(new AttributeModel[list.size()]); } else { attributes = null; } final ArrayList<ConfigurationElementModel> list = new ArrayList<ConfigurationElementModel>(); for (Iterator<?> i = e.getChildren().iterator(); i.hasNext(); ) { final XMLElement ce = (XMLElement)i.next(); list.add(new ConfigurationElementModel(plugin, ce)); } elements = (ConfigurationElement[])list.toArray(new ConfigurationElement[list.size()]); }
host.repaint(0, repaintRec.y, host.getWidth(), repaintRec.height);
host.repaint();
protected void damageLineRange (int line0, int line1, Shape a, Component host) { if (a == null) return; Rectangle rec0 = lineToRect(a, line0); Rectangle rec1 = lineToRect(a, line1); if (rec0 == null || rec1 == null) // something went wrong, repaint the entire host to be safe host.repaint(); else { Rectangle repaintRec = rec0.union(rec1); host.repaint(0, repaintRec.y, host.getWidth(), repaintRec.height); } }
assert false : "BadLocationException should not be thrown here.";
float determineMaxLineLength() { // if the longest line is cached, return the cached value if (maxLineLength != -1) return maxLineLength; // otherwise we have to go through all the lines and find it Element el = getElement(); Segment seg = getLineBuffer(); float span = 0; for (int i = 0; i < el.getElementCount(); i++) { Element child = el.getElement(i); int start = child.getStartOffset(); int end = child.getEndOffset(); try { el.getDocument().getText(start, start + end, seg); } catch (BadLocationException ex) { } if (seg == null || seg.array == null || seg.count == 0) continue; int width = metrics.charsWidth(seg.array, seg.offset, seg.count); if (width > span) { longestLine = child; span = width; } } maxLineLength = span; return maxLineLength; }
assert false : "BadLocationException should not be thrown here.";
protected void updateDamage(DocumentEvent changes, Shape a, ViewFactory f) { Element el = getElement(); ElementChange ec = changes.getChange(el); // If ec is null then no lines were added or removed, just // repaint the changed line if (ec == null) { int line = getElement().getElementIndex(changes.getOffset()); damageLineRange(line, line, a, getContainer()); return; } Element[] removed = ec.getChildrenRemoved(); Element[] newElements = ec.getChildrenAdded(); // If no Elements were added or removed, we just want to repaint // the area containing the line that was modified if (removed == null && newElements == null) { int line = getElement().getElementIndex(changes.getOffset()); damageLineRange(line, line, a, getContainer()); return; } // Check to see if we removed the longest line, if so we have to // search through all lines and find the longest one again if (removed != null) { for (int i = 0; i < removed.length; i++) if (removed[i].equals(longestLine)) { // reset maxLineLength and search through all lines for longest one maxLineLength = -1; determineMaxLineLength(); ((JTextComponent)getContainer()).repaint(); return; } } // If we've reached here, that means we haven't removed the longest line if (newElements == null) { // No lines were added, just repaint the container and exit ((JTextComponent)getContainer()).repaint(); return; } // Make sure we have the metrics updateMetrics(); // If we've reached here, that means we haven't removed the longest line // and we have added at least one line, so we have to check if added lines // are longer than the previous longest line Segment seg = getLineBuffer(); float longestNewLength = 0; Element longestNewLine = null; // Loop through the added lines to check their length for (int i = 0; i < newElements.length; i++) { Element child = newElements[i]; int start = child.getStartOffset(); int end = child.getEndOffset(); try { el.getDocument().getText(start, end - start, seg); } catch (BadLocationException ex) { } if (seg == null || seg.array == null || seg.count == 0) continue; int width = metrics.charsWidth(seg.array, seg.offset, seg.count); if (width > longestNewLength) { longestNewLine = child; longestNewLength = width; } } // Check if the longest of the new lines is longer than our previous // longest line, and if so update our values if (longestNewLength > maxLineLength) { maxLineLength = longestNewLength; longestLine = longestNewLine; } // Repaint the container ((JTextComponent)getContainer()).repaint(); }
checkZipFile();
public ZipFile(String name) throws ZipException, IOException { this.raf = new RandomAccessFile(name, "r"); this.name = name; }
return null;
return EmptyEnumeration.getInstance();
public Enumeration entries() { try { return new ZipEntryEnumeration(getEntries().values().iterator()); } catch (IOException ioe) { return null; } }
checkClosed();
public ZipEntry getEntry(String name) { try { HashMap entries = getEntries(); ZipEntry entry = (ZipEntry) entries.get(name); // If we didn't find it, maybe it's a directory. if (entry == null && !name.endsWith("/")) entry = (ZipEntry) entries.get(name + '/'); return entry != null ? new ZipEntry(entry, name) : null; } catch (IOException ioe) { return null; } }
checkClosed();
public InputStream getInputStream(ZipEntry entry) throws IOException { HashMap entries = getEntries(); String name = entry.getName(); ZipEntry zipEntry = (ZipEntry) entries.get(name); if (zipEntry == null) return null; long start = checkLocalHeader(zipEntry); int method = zipEntry.getMethod(); InputStream is = new BufferedInputStream(new PartialInputStream (raf, start, zipEntry.getCompressedSize())); switch (method) { case ZipOutputStream.STORED: return is; case ZipOutputStream.DEFLATED: return new InflaterInputStream(is, new Inflater(true)); default: throw new ZipException("Unknown compression method " + method); } }
public Manifest(InputStream in) throws IOException { this(); read(in);
public Manifest() { mainAttr = new Attributes(); entries = new Hashtable();
public Manifest(InputStream in) throws IOException { this(); read(in); }
public final void update(byte[]data, int off, int len) throws SignatureException
public final void update(byte b) throws SignatureException
public final void update(byte[]data, int off, int len) throws SignatureException { if (state != UNINITIALIZED) engineUpdate(data, off, len); else throw new SignatureException(); }
engineUpdate(data, off, len);
engineUpdate(b);
public final void update(byte[]data, int off, int len) throws SignatureException { if (state != UNINITIALIZED) engineUpdate(data, off, len); else throw new SignatureException(); }
String[] macrosList = macros.getMacroList();
String[] macrosList = Macronizer.getMacroList();
public static void loadMacros(Session session, Macronizer macros, JMenu menu) { final Session ses = session; Vector mv = new Vector(); Action action; menu.addSeparator(); String[] macrosList = macros.getMacroList(); for (int x = 0; x < macrosList.length; x++) { mv.add(macrosList[x]); } Collections.sort(mv); for (int x = 0; x < mv.size(); x++) { action = new AbstractAction((String)mv.get(x)) { public void actionPerformed(ActionEvent e) { ses.executeMeMacro(e); } }; menu.add(action); } scriptDir("scripts",menu,session); String conPath = ""; String conPath2 = ""; try { conPath = new File("scripts").getCanonicalPath(); conPath2 = new File(GlobalConfigure.instance().getProperty( "emulator.settingsDirectory") + "scripts").getCanonicalPath(); } catch (IOException ioe ) { } // lets not load the menu again if they point to the same place if (!conPath.equals(conPath2)) scriptDir(GlobalConfigure.instance().getProperty( "emulator.settingsDirectory") + "scripts",menu,session); }
{ return null; }
{ return StyleConstants.getComponent(getElement().getAttributes()); }
protected Component createComponent() { return null; }
int width = container.getWidth() - insets.left - insets.right - 1; int height = container.getHeight() - insets.top - insets.bottom - 1;
int width = container.getWidth() - insets.left - insets.right; int height = container.getHeight() - insets.top - insets.bottom;
public void layoutContainer(Container parent) { // Setup the SizeRequirements for both the X and Y axis. Component[] children = container.getComponents(); SizeRequirements[] hSizeReqs = new SizeRequirements[children.length]; SizeRequirements[] vSizeReqs = new SizeRequirements[children.length]; getSizeRequirements(hSizeReqs, vSizeReqs); int[] hSpans = new int[children.length]; int[] hOffsets = new int[children.length]; int[] vSpans = new int[children.length]; int[] vOffsets = new int[children.length]; Insets insets = container.getInsets(); int width = container.getWidth() - insets.left - insets.right - 1; int height = container.getHeight() - insets.top - insets.bottom - 1; if (isHorizontalIn(container)) { SizeRequirements.calculateTiledPositions(width, null, hSizeReqs, hOffsets, hSpans); SizeRequirements.calculateAlignedPositions(height, null, vSizeReqs, vOffsets, vSpans); } else { SizeRequirements.calculateTiledPositions(height, null, vSizeReqs, vOffsets, vSpans); SizeRequirements.calculateAlignedPositions(width, null, hSizeReqs, hOffsets, hSpans); } // Set positions and widths of child components. for (int i = 0; i < children.length; i++) { Component child = children[i]; child.setBounds(hOffsets[i] + insets.left, vOffsets[i] + insets.top, hSpans[i], vSpans[i]); } }
return new Dimension(hReq.preferred, vReq.preferred);
Insets insets = container.getInsets(); return new Dimension(hReq.preferred + insets.left + insets.right, vReq.preferred + insets.top + insets.bottom);
public Dimension preferredLayoutSize(Container parent) { if (parent != container) throw new AWTError("invalid parent"); // Setup the SizeRequirements for both the X and Y axis. Component[] children = container.getComponents(); SizeRequirements[] hSizeReqs = new SizeRequirements[children.length]; SizeRequirements[] vSizeReqs = new SizeRequirements[children.length]; getSizeRequirements(hSizeReqs, vSizeReqs); SizeRequirements hReq; SizeRequirements vReq; if (isHorizontalIn(container)) { hReq = SizeRequirements.getTiledSizeRequirements(hSizeReqs); vReq = SizeRequirements.getAlignedSizeRequirements(vSizeReqs); } else { hReq = SizeRequirements.getAlignedSizeRequirements(hSizeReqs); vReq = SizeRequirements.getTiledSizeRequirements(vSizeReqs); } return new Dimension(hReq.preferred, vReq.preferred); }
this.index0 = index0; this.index1 = index1;
this.index0 = Math.min(index0, index1); this.index1 = Math.max(index0, index1);
public ListDataEvent(Object source, int type, int index0, int index1) { super(source); this.type = type; this.index0 = index0; this.index1 = index1; }
SessionAttributes sa = new SessionAttributes(propFileName,
SessionAttributes sa = null; if (me == null) sa = new SessionAttributes(propFileName, defaultProps, new JFrame()); else sa = new SessionAttributes(propFileName,
private void doAttributes() { SessionAttributes sa = new SessionAttributes(propFileName, defaultProps, (Frame)me.getParentView((Session)this)); sa.addPropertyChangeListener(screen); sa.addPropertyChangeListener(this); sa.showIt(); defaultProps = sa.getProperties(); sa.removePropertyChangeListener(screen); sa.removePropertyChangeListener(this); getFocusForMe(); sa = null; }
kc = new KeyConfigure(me.getParentView((Session)this),macrosList,vt.getCodePage());
kc = new KeyConfigure(parent,macrosList,vt.getCodePage());
private void mapMeKeys() { KeyConfigure kc; if (macros.isMacrosExist()) { String[] macrosList = macros.getMacroList(); kc = new KeyConfigure(me.getParentView((Session)this),macrosList,vt.getCodePage()); } else kc = new KeyConfigure(me.getParentView((Session)this),null,vt.getCodePage()); }