1 Clazz.declarePackage ("jalview.appletgui");
\r
2 Clazz.load (["awt2swing.Panel", "java.awt.Insets"], "jalview.appletgui.TitledPanel", null, function () {
\r
3 c$ = Clazz.decorateAsClass (function () {
\r
6 Clazz.instantialize (this, arguments);
\r
7 }, jalview.appletgui, "TitledPanel", awt2swing.Panel);
\r
8 Clazz.prepareFields (c$, function () {
\r
9 this.$insets = new java.awt.Insets (10, 10, 10, 10);
\r
11 Clazz.makeConstructor (c$,
\r
13 this.construct ("");
\r
15 Clazz.makeConstructor (c$,
\r
17 Clazz.superConstructor (this, jalview.appletgui.TitledPanel, []);
\r
18 this.setTitle (title);
\r
20 Clazz.defineMethod (c$, "getInsets",
\r
22 return this.$insets;
\r
24 Clazz.defineMethod (c$, "paintComponent",
\r
26 Clazz.superCall (this, jalview.appletgui.TitledPanel, "paintComponent", [g]);
\r
27 g.setColor (this.getForeground ());
\r
28 g.drawRect (5, 5, this.getWidth () - 10, this.getHeight () - 10);
\r
29 var width = g.getFontMetrics ().stringWidth (this.getTitle ());
\r
30 g.setColor (this.getBackground ());
\r
31 g.fillRect (10, 0, width, 10);
\r
32 g.setColor (this.getForeground ());
\r
33 g.drawString (this.getTitle (), 10, 10);
\r
34 }, "java.awt.Graphics");
\r
35 Clazz.defineMethod (c$, "getTitle",
\r
39 Clazz.defineMethod (c$, "setTitle",
\r