X-Git-Url: http://source.jalview.org/gitweb/?p=jalviewjs.git;a=blobdiff_plain;f=site%2Fj2s%2Fjavax%2Fswing%2Fborder%2FSoftBevelBorder.js;fp=site%2Fj2s%2Fjavax%2Fswing%2Fborder%2FSoftBevelBorder.js;h=22c0219479fc6ac173ab5a59e08bf9dc2995dde8;hp=84b42fca46d21bc18ebc6e85e027a85a03e682ed;hb=b9b7a352eee79b7764c3b09c9d19663075061d8c;hpb=7301a2415adab88038b291fc54caeeb3a5a47a44 diff --git a/site/j2s/javax/swing/border/SoftBevelBorder.js b/site/j2s/javax/swing/border/SoftBevelBorder.js index 84b42fc..22c0219 100644 --- a/site/j2s/javax/swing/border/SoftBevelBorder.js +++ b/site/j2s/javax/swing/border/SoftBevelBorder.js @@ -1,56 +1,56 @@ -Clazz.declarePackage ("javax.swing.border"); -Clazz.load (["javax.swing.border.BevelBorder"], "javax.swing.border.SoftBevelBorder", ["java.awt.Insets"], function () { -c$ = Clazz.declareType (javax.swing.border, "SoftBevelBorder", javax.swing.border.BevelBorder); -Clazz.overrideMethod (c$, "paintBorder", -function (c, g, x, y, width, height) { -var oldColor = g.getColor (); -g.translate (x, y); -if (this.bevelType == 0) { -g.setColor (this.getHighlightOuterColor (c)); -g.drawLine (0, 0, width - 2, 0); -g.drawLine (0, 0, 0, height - 2); -g.drawLine (1, 1, 1, 1); -g.setColor (this.getHighlightInnerColor (c)); -g.drawLine (2, 1, width - 2, 1); -g.drawLine (1, 2, 1, height - 2); -g.drawLine (2, 2, 2, 2); -g.drawLine (0, height - 1, 0, height - 2); -g.drawLine (width - 1, 0, width - 1, 0); -g.setColor (this.getShadowOuterColor (c)); -g.drawLine (2, height - 1, width - 1, height - 1); -g.drawLine (width - 1, 2, width - 1, height - 1); -g.setColor (this.getShadowInnerColor (c)); -g.drawLine (width - 2, height - 2, width - 2, height - 2); -} else if (this.bevelType == 1) { -g.setColor (this.getShadowOuterColor (c)); -g.drawLine (0, 0, width - 2, 0); -g.drawLine (0, 0, 0, height - 2); -g.drawLine (1, 1, 1, 1); -g.setColor (this.getShadowInnerColor (c)); -g.drawLine (2, 1, width - 2, 1); -g.drawLine (1, 2, 1, height - 2); -g.drawLine (2, 2, 2, 2); -g.drawLine (0, height - 1, 0, height - 2); -g.drawLine (width - 1, 0, width - 1, 0); -g.setColor (this.getHighlightOuterColor (c)); -g.drawLine (2, height - 1, width - 1, height - 1); -g.drawLine (width - 1, 2, width - 1, height - 1); -g.setColor (this.getHighlightInnerColor (c)); -g.drawLine (width - 2, height - 2, width - 2, height - 2); -}g.translate (-x, -y); -g.setColor (oldColor); -}, "java.awt.Component,java.awt.Graphics,~N,~N,~N,~N"); -Clazz.defineMethod (c$, "getBorderInsets", -function (c) { -return this.getBorderInsets (c, new java.awt.Insets (0, 0, 0, 0)); -}, "java.awt.Component"); -Clazz.defineMethod (c$, "getBorderInsets", -function (c, insets) { -insets.top = insets.left = insets.bottom = insets.right = 3; -return insets; -}, "java.awt.Component,java.awt.Insets"); -Clazz.overrideMethod (c$, "isBorderOpaque", -function () { -return false; -}); -}); +Clazz.declarePackage ("javax.swing.border"); +Clazz.load (["javax.swing.border.BevelBorder"], "javax.swing.border.SoftBevelBorder", ["java.awt.Insets"], function () { +c$ = Clazz.declareType (javax.swing.border, "SoftBevelBorder", javax.swing.border.BevelBorder); +Clazz.overrideMethod (c$, "paintBorder", +function (c, g, x, y, width, height) { +var oldColor = g.getColor (); +g.translate (x, y); +if (this.bevelType == 0) { +g.setColor (this.getHighlightOuterColor (c)); +g.drawLine (0, 0, width - 2, 0); +g.drawLine (0, 0, 0, height - 2); +g.drawLine (1, 1, 1, 1); +g.setColor (this.getHighlightInnerColor (c)); +g.drawLine (2, 1, width - 2, 1); +g.drawLine (1, 2, 1, height - 2); +g.drawLine (2, 2, 2, 2); +g.drawLine (0, height - 1, 0, height - 2); +g.drawLine (width - 1, 0, width - 1, 0); +g.setColor (this.getShadowOuterColor (c)); +g.drawLine (2, height - 1, width - 1, height - 1); +g.drawLine (width - 1, 2, width - 1, height - 1); +g.setColor (this.getShadowInnerColor (c)); +g.drawLine (width - 2, height - 2, width - 2, height - 2); +} else if (this.bevelType == 1) { +g.setColor (this.getShadowOuterColor (c)); +g.drawLine (0, 0, width - 2, 0); +g.drawLine (0, 0, 0, height - 2); +g.drawLine (1, 1, 1, 1); +g.setColor (this.getShadowInnerColor (c)); +g.drawLine (2, 1, width - 2, 1); +g.drawLine (1, 2, 1, height - 2); +g.drawLine (2, 2, 2, 2); +g.drawLine (0, height - 1, 0, height - 2); +g.drawLine (width - 1, 0, width - 1, 0); +g.setColor (this.getHighlightOuterColor (c)); +g.drawLine (2, height - 1, width - 1, height - 1); +g.drawLine (width - 1, 2, width - 1, height - 1); +g.setColor (this.getHighlightInnerColor (c)); +g.drawLine (width - 2, height - 2, width - 2, height - 2); +}g.translate (-x, -y); +g.setColor (oldColor); +}, "java.awt.Component,java.awt.Graphics,~N,~N,~N,~N"); +Clazz.defineMethod (c$, "getBorderInsets", +function (c) { +return this.getBorderInsets (c, new java.awt.Insets (0, 0, 0, 0)); +}, "java.awt.Component"); +Clazz.defineMethod (c$, "getBorderInsets", +function (c, insets) { +insets.top = insets.left = insets.bottom = insets.right = 3; +return insets; +}, "java.awt.Component,java.awt.Insets"); +Clazz.overrideMethod (c$, "isBorderOpaque", +function () { +return false; +}); +});