X-Git-Url: http://source.jalview.org/gitweb/?p=jalviewjs.git;a=blobdiff_plain;f=bin%2Fjalview%2Fappletgui%2FTitledPanel.js;h=026a455238250126cc09c99a76758d8ef965f6cd;hp=351c3ff56dc6cbabb211e88154b07076d042bfce;hb=8ffd05b3abe52c0b6b79b011c0966361f82d5fe6;hpb=6154cb57a6eac3bb1344b8342495f5bb701ee921 diff --git a/bin/jalview/appletgui/TitledPanel.js b/bin/jalview/appletgui/TitledPanel.js index 351c3ff..026a455 100644 --- a/bin/jalview/appletgui/TitledPanel.js +++ b/bin/jalview/appletgui/TitledPanel.js @@ -1,43 +1,43 @@ -Clazz.declarePackage ("jalview.appletgui"); -Clazz.load (["awt2swing.Panel", "java.awt.Insets"], "jalview.appletgui.TitledPanel", null, function () { -c$ = Clazz.decorateAsClass (function () { -this.title = null; -this.$insets = null; -Clazz.instantialize (this, arguments); -}, jalview.appletgui, "TitledPanel", awt2swing.Panel); -Clazz.prepareFields (c$, function () { -this.$insets = new java.awt.Insets (10, 10, 10, 10); -}); -Clazz.makeConstructor (c$, -function () { -this.construct (""); -}); -Clazz.makeConstructor (c$, -function (title) { -Clazz.superConstructor (this, jalview.appletgui.TitledPanel, []); -this.setTitle (title); -}, "~S"); -Clazz.defineMethod (c$, "getInsets", -function () { -return this.$insets; -}); -Clazz.defineMethod (c$, "paintComponent", -function (g) { -Clazz.superCall (this, jalview.appletgui.TitledPanel, "paintComponent", [g]); -g.setColor (this.getForeground ()); -g.drawRect (5, 5, this.getWidth () - 10, this.getHeight () - 10); -var width = g.getFontMetrics ().stringWidth (this.getTitle ()); -g.setColor (this.getBackground ()); -g.fillRect (10, 0, width, 10); -g.setColor (this.getForeground ()); -g.drawString (this.getTitle (), 10, 10); -}, "java.awt.Graphics"); -Clazz.defineMethod (c$, "getTitle", -function () { -return this.title; -}); -Clazz.defineMethod (c$, "setTitle", -function (title) { -this.title = title; -}, "~S"); -}); +Clazz.declarePackage ("jalview.appletgui"); +Clazz.load (["awt2swing.Panel", "java.awt.Insets"], "jalview.appletgui.TitledPanel", null, function () { +c$ = Clazz.decorateAsClass (function () { +this.title = null; +this.$insets = null; +Clazz.instantialize (this, arguments); +}, jalview.appletgui, "TitledPanel", awt2swing.Panel); +Clazz.prepareFields (c$, function () { +this.$insets = new java.awt.Insets (10, 10, 10, 10); +}); +Clazz.makeConstructor (c$, +function () { +this.construct (""); +}); +Clazz.makeConstructor (c$, +function (title) { +Clazz.superConstructor (this, jalview.appletgui.TitledPanel, []); +this.setTitle (title); +}, "~S"); +Clazz.defineMethod (c$, "getInsets", +function () { +return this.$insets; +}); +Clazz.defineMethod (c$, "paintComponent", +function (g) { +Clazz.superCall (this, jalview.appletgui.TitledPanel, "paintComponent", [g]); +g.setColor (this.getForeground ()); +g.drawRect (5, 5, this.getWidth () - 10, this.getHeight () - 10); +var width = g.getFontMetrics ().stringWidth (this.getTitle ()); +g.setColor (this.getBackground ()); +g.fillRect (10, 0, width, 10); +g.setColor (this.getForeground ()); +g.drawString (this.getTitle (), 10, 10); +}, "java.awt.Graphics"); +Clazz.defineMethod (c$, "getTitle", +function () { +return this.title; +}); +Clazz.defineMethod (c$, "setTitle", +function (title) { +this.title = title; +}, "~S"); +});