<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java%2FGWT%2FImage_Button</id>
		<title>Java/GWT/Image Button - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java%2FGWT%2FImage_Button"/>
		<link rel="alternate" type="text/html" href="http://jexp.ru/index.php?title=Java/GWT/Image_Button&amp;action=history"/>
		<updated>2026-04-07T02:37:39Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://jexp.ru/index.php?title=Java/GWT/Image_Button&amp;diff=7015&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://jexp.ru/index.php?title=Java/GWT/Image_Button&amp;diff=7015&amp;oldid=prev"/>
				<updated>2010-06-01T06:35:22Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 06:35, 1 июня 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://jexp.ru/index.php?title=Java/GWT/Image_Button&amp;diff=7014&amp;oldid=prev</id>
		<title> в 18:01, 31 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://jexp.ru/index.php?title=Java/GWT/Image_Button&amp;diff=7014&amp;oldid=prev"/>
				<updated>2010-05-31T18:01:44Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== Image Button without browser compatibility issue ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
package com.jexp.gwt.client;&lt;br /&gt;
import com.google.gwt.user.client.*;&lt;br /&gt;
import com.google.gwt.user.client.ui.*;&lt;br /&gt;
import com.google.gwt.core.client.*;&lt;br /&gt;
public class GWTClient implements EntryPoint{&lt;br /&gt;
  public void onModuleLoad() {&lt;br /&gt;
    RootPanel.get().add(new ImageButton(&amp;quot;images/close.png&amp;quot;,16,16));&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright 2006 Robert Hanson &amp;lt;iamroberthanson AT gmail.ru&amp;gt;&lt;br /&gt;
 * &lt;br /&gt;
 * Licensed under the Apache License, Version 2.0 (the &amp;quot;License&amp;quot;);&lt;br /&gt;
 * you may not use this file except in compliance with the License.&lt;br /&gt;
 * You may obtain a copy of the License at&lt;br /&gt;
 * &lt;br /&gt;
 *    http://www.apache.org/licenses/LICENSE-2.0&lt;br /&gt;
 * &lt;br /&gt;
 * Unless required by applicable law or agreed to in writing, software&lt;br /&gt;
 * distributed under the License is distributed on an &amp;quot;AS IS&amp;quot; BASIS,&lt;br /&gt;
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&lt;br /&gt;
 * See the License for the specific language governing permissions and&lt;br /&gt;
 * limitations under the License.&lt;br /&gt;
 */&lt;br /&gt;
/**&lt;br /&gt;
 * Use an image as a button.  Allows for setting of on/off &lt;br /&gt;
 * background color, border color, border width, and border &lt;br /&gt;
 * style.  The &amp;quot;on&amp;quot; colors are used on mouse over.&lt;br /&gt;
 * &lt;br /&gt;
 * @author rhanson&lt;br /&gt;
 */&lt;br /&gt;
class ImageButton extends PNGImage&lt;br /&gt;
{&lt;br /&gt;
    protected final static int ON_STATE = 1;&lt;br /&gt;
    protected final static int OFF_STATE = -1;&lt;br /&gt;
    private int state = OFF_STATE;&lt;br /&gt;
    &lt;br /&gt;
    private String onStyle = &amp;quot;gwl-ImageButton-On&amp;quot;;&lt;br /&gt;
    private String offStyle = &amp;quot;gwl-ImageButton-Off&amp;quot;;&lt;br /&gt;
    private Color backgroundOnColor = Color.NONE;&lt;br /&gt;
    private Color backgroundOffColor = Color.NONE;&lt;br /&gt;
    private Color borderOnColor = Color.BLACK;&lt;br /&gt;
    private Color borderOffColor = Color.NONE;&lt;br /&gt;
    &lt;br /&gt;
    private int borderOnWidth = 1;&lt;br /&gt;
    private int borderOffWidth = 0;&lt;br /&gt;
    &lt;br /&gt;
    private int paddingLeft = 0;&lt;br /&gt;
    private int paddingRight = 0;&lt;br /&gt;
    private int paddingTop = 0;&lt;br /&gt;
    private int paddingBottom = 0;&lt;br /&gt;
    &lt;br /&gt;
    private BorderStyleConstant borderOnStyle = BorderStyle.BORDER_STYLE_SOLID;&lt;br /&gt;
    private BorderStyleConstant borderOffStyle = BorderStyle.BORDER_STYLE_NONE;&lt;br /&gt;
&lt;br /&gt;
    public ImageButton (String url, int width, int height)&lt;br /&gt;
    {&lt;br /&gt;
        super(url, width, height);&lt;br /&gt;
        setStyleName(&amp;quot;gwl-image-button&amp;quot;);&lt;br /&gt;
        setColors();&lt;br /&gt;
        init();&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    protected void init ()&lt;br /&gt;
    {&lt;br /&gt;
        addMouseListener(new MouseListenerAdapter(){&lt;br /&gt;
            public void onMouseEnter (Widget sender)&lt;br /&gt;
            {&lt;br /&gt;
                state = ON_STATE;&lt;br /&gt;
                setColors();&lt;br /&gt;
            }&lt;br /&gt;
            public void onMouseLeave (Widget sender)&lt;br /&gt;
            {&lt;br /&gt;
                state = OFF_STATE;&lt;br /&gt;
                setColors();&lt;br /&gt;
            }&lt;br /&gt;
        });&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    &lt;br /&gt;
    public boolean isOn ()&lt;br /&gt;
    {&lt;br /&gt;
        return state == ON_STATE;&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * Updates the colors of the widget based on the state&lt;br /&gt;
     * and color settings. This is usually only used after &lt;br /&gt;
     * setting one or more of the colors.&lt;br /&gt;
     */&lt;br /&gt;
    public void setColors ()&lt;br /&gt;
    {&lt;br /&gt;
        DOM.setStyleAttribute(getElement(), &amp;quot;paddingTop&amp;quot;, getPaddingTopWidth() + &amp;quot;px&amp;quot;);&lt;br /&gt;
        DOM.setStyleAttribute(getElement(), &amp;quot;paddingRight&amp;quot;, getPaddingRightWidth() + &amp;quot;px&amp;quot;);&lt;br /&gt;
        DOM.setStyleAttribute(getElement(), &amp;quot;paddingBottom&amp;quot;, getPaddingBottomWidth() + &amp;quot;px&amp;quot;);&lt;br /&gt;
        DOM.setStyleAttribute(getElement(), &amp;quot;paddingLeft&amp;quot;, getPaddingLeftWidth() + &amp;quot;px&amp;quot;);&lt;br /&gt;
        DOM.setStyleAttribute(getElement(), &amp;quot;borderWidth&amp;quot;, getBorderWidth() + &amp;quot;px&amp;quot;);&lt;br /&gt;
        DOM.setStyleAttribute(getElement(), &amp;quot;borderColor&amp;quot;, getBorderColor().getHexValue());&lt;br /&gt;
        DOM.setStyleAttribute(getElement(), &amp;quot;borderStyle&amp;quot;, getBorderStyle().getBorderStyleName());&lt;br /&gt;
        DOM.setStyleAttribute(getElement(), &amp;quot;backgroundColor&amp;quot;, getBackgroundColor().getHexValue());&lt;br /&gt;
        setStyleName(getCssStyleName());&lt;br /&gt;
    }&lt;br /&gt;
    private String getCssStyleName ()&lt;br /&gt;
    {&lt;br /&gt;
        if (state == ON_STATE)&lt;br /&gt;
            return onStyle;&lt;br /&gt;
        else&lt;br /&gt;
            return offStyle;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    private Color getBackgroundColor ()&lt;br /&gt;
    {&lt;br /&gt;
        if (state == ON_STATE)&lt;br /&gt;
            return backgroundOnColor;&lt;br /&gt;
        else&lt;br /&gt;
            return backgroundOffColor;&lt;br /&gt;
    }&lt;br /&gt;
    private BorderStyleConstant getBorderStyle ()&lt;br /&gt;
    {&lt;br /&gt;
        if (state == ON_STATE)&lt;br /&gt;
            return borderOnStyle;&lt;br /&gt;
        else&lt;br /&gt;
            return borderOffStyle;&lt;br /&gt;
    }&lt;br /&gt;
    private Color getBorderColor ()&lt;br /&gt;
    {&lt;br /&gt;
        if (state == ON_STATE)&lt;br /&gt;
            return borderOnColor;&lt;br /&gt;
        else&lt;br /&gt;
            return borderOffColor;&lt;br /&gt;
    }&lt;br /&gt;
    private int getBorderWidth ()&lt;br /&gt;
    {&lt;br /&gt;
        if (state == ON_STATE)&lt;br /&gt;
            return borderOnWidth;&lt;br /&gt;
        else&lt;br /&gt;
            return borderOffWidth;&lt;br /&gt;
    }&lt;br /&gt;
    private int getPaddingLeftWidth ()&lt;br /&gt;
    {&lt;br /&gt;
        int max = (borderOnWidth &amp;gt; borderOffWidth) ? borderOnWidth : borderOffWidth;&lt;br /&gt;
        &lt;br /&gt;
        if (state == ON_STATE) {&lt;br /&gt;
            return (max - borderOnWidth + paddingLeft);&lt;br /&gt;
        }&lt;br /&gt;
        else {&lt;br /&gt;
            return (max - borderOffWidth + paddingLeft);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    private int getPaddingRightWidth ()&lt;br /&gt;
    {&lt;br /&gt;
        int max = (borderOnWidth &amp;gt; borderOffWidth) ? borderOnWidth : borderOffWidth;&lt;br /&gt;
        &lt;br /&gt;
        if (state == ON_STATE) {&lt;br /&gt;
            return (max - borderOnWidth + paddingRight);&lt;br /&gt;
        }&lt;br /&gt;
        else {&lt;br /&gt;
            return (max - borderOffWidth + paddingRight);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    private int getPaddingTopWidth ()&lt;br /&gt;
    {&lt;br /&gt;
        int max = (borderOnWidth &amp;gt; borderOffWidth) ? borderOnWidth : borderOffWidth;&lt;br /&gt;
        &lt;br /&gt;
        if (state == ON_STATE) {&lt;br /&gt;
            return (max - borderOnWidth + paddingTop);&lt;br /&gt;
        }&lt;br /&gt;
        else {&lt;br /&gt;
            return (max - borderOffWidth + paddingTop);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    private int getPaddingBottomWidth ()&lt;br /&gt;
    {&lt;br /&gt;
        int max = (borderOnWidth &amp;gt; borderOffWidth) ? borderOnWidth : borderOffWidth;&lt;br /&gt;
        &lt;br /&gt;
        if (state == ON_STATE) {&lt;br /&gt;
            return (max - borderOnWidth + paddingBottom);&lt;br /&gt;
        }&lt;br /&gt;
        else {&lt;br /&gt;
            return (max - borderOffWidth + paddingBottom);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * This method is under consideration for removal,&lt;br /&gt;
     * if you have an opion please comment on http://gwtwidgets.blogspot.ru.&lt;br /&gt;
     */&lt;br /&gt;
    public void setMargin (int px)&lt;br /&gt;
    {&lt;br /&gt;
        DOM.setStyleAttribute(getElement(), &amp;quot;margin&amp;quot;, px + &amp;quot;px&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    /**&lt;br /&gt;
     * This method is under consideration for removal,&lt;br /&gt;
     * if you have an opion please comment on http://gwtwidgets.blogspot.ru.&lt;br /&gt;
     */&lt;br /&gt;
    public void setHorizontalMargin (int px)&lt;br /&gt;
    {&lt;br /&gt;
        DOM.setStyleAttribute(getElement(), &amp;quot;marginLeft&amp;quot;, px + &amp;quot;px&amp;quot;);&lt;br /&gt;
        DOM.setStyleAttribute(getElement(), &amp;quot;marginRight&amp;quot;, px + &amp;quot;px&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * This method is under consideration for removal,&lt;br /&gt;
     * if you have an opion please comment on http://gwtwidgets.blogspot.ru.&lt;br /&gt;
     */&lt;br /&gt;
    public void setVerticleMargin (int px)&lt;br /&gt;
    {&lt;br /&gt;
        DOM.setStyleAttribute(getElement(), &amp;quot;marginTop&amp;quot;, px + &amp;quot;px&amp;quot;);&lt;br /&gt;
        DOM.setStyleAttribute(getElement(), &amp;quot;marginBotom&amp;quot;, px + &amp;quot;px&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * This method is under consideration for removal,&lt;br /&gt;
     * if you have an opion please comment on http://gwtwidgets.blogspot.ru.&lt;br /&gt;
     */&lt;br /&gt;
    public Color getBackgroundOffColor ()&lt;br /&gt;
    {&lt;br /&gt;
        return backgroundOffColor;&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * This method is under consideration for removal,&lt;br /&gt;
     * if you have an opion please comment on http://gwtwidgets.blogspot.ru.&lt;br /&gt;
     */&lt;br /&gt;
    public void setBackgroundOffColor (Color backgroundOffColor)&lt;br /&gt;
    {&lt;br /&gt;
        this.backgroundOffColor = backgroundOffColor;&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * This method is under consideration for removal,&lt;br /&gt;
     * if you have an opion please comment on http://gwtwidgets.blogspot.ru.&lt;br /&gt;
     */&lt;br /&gt;
    public Color getBackgroundOnColor ()&lt;br /&gt;
    {&lt;br /&gt;
        return backgroundOnColor;&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * This method is under consideration for removal,&lt;br /&gt;
     * if you have an opion please comment on http://gwtwidgets.blogspot.ru.&lt;br /&gt;
     */&lt;br /&gt;
    public void setBackgroundOnColor (Color backgroundOnColor)&lt;br /&gt;
    {&lt;br /&gt;
        this.backgroundOnColor = backgroundOnColor;&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * This method is under consideration for removal,&lt;br /&gt;
     * if you have an opion please comment on http://gwtwidgets.blogspot.ru.&lt;br /&gt;
     */&lt;br /&gt;
    public Color getBorderOffColor ()&lt;br /&gt;
    {&lt;br /&gt;
        return borderOffColor;&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * This method is under consideration for removal,&lt;br /&gt;
     * if you have an opion please comment on http://gwtwidgets.blogspot.ru.&lt;br /&gt;
     */&lt;br /&gt;
    public void setBorderOffColor (Color borderOffColor)&lt;br /&gt;
    {&lt;br /&gt;
        this.borderOffColor = borderOffColor;&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * This method is under consideration for removal,&lt;br /&gt;
     * if you have an opion please comment on http://gwtwidgets.blogspot.ru.&lt;br /&gt;
     */&lt;br /&gt;
    public BorderStyleConstant getBorderOffStyle ()&lt;br /&gt;
    {&lt;br /&gt;
        return borderOffStyle;&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * This method is under consideration for removal,&lt;br /&gt;
     * if you have an opion please comment on http://gwtwidgets.blogspot.ru.&lt;br /&gt;
     */&lt;br /&gt;
    public void setBorderOffStyle (BorderStyleConstant borderOffStyle)&lt;br /&gt;
    {&lt;br /&gt;
        this.borderOffStyle = borderOffStyle;&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * This method is under consideration for removal,&lt;br /&gt;
     * if you have an opion please comment on http://gwtwidgets.blogspot.ru.&lt;br /&gt;
     */&lt;br /&gt;
    public int getBorderOffWidth ()&lt;br /&gt;
    {&lt;br /&gt;
        return borderOffWidth;&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * This method is under consideration for removal,&lt;br /&gt;
     * if you have an opion please comment on http://gwtwidgets.blogspot.ru.&lt;br /&gt;
     */&lt;br /&gt;
    public void setBorderOffWidth (int borderOffWidth)&lt;br /&gt;
    {&lt;br /&gt;
        this.borderOffWidth = borderOffWidth;&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * This method is under consideration for removal,&lt;br /&gt;
     * if you have an opion please comment on http://gwtwidgets.blogspot.ru.&lt;br /&gt;
     */&lt;br /&gt;
    public Color getBorderOnColor ()&lt;br /&gt;
    {&lt;br /&gt;
        return borderOnColor;&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * This method is under consideration for removal,&lt;br /&gt;
     * if you have an opion please comment on http://gwtwidgets.blogspot.ru.&lt;br /&gt;
     */&lt;br /&gt;
    public void setBorderOnColor (Color borderOnColor)&lt;br /&gt;
    {&lt;br /&gt;
        this.borderOnColor = borderOnColor;&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * This method is under consideration for removal,&lt;br /&gt;
     * if you have an opion please comment on http://gwtwidgets.blogspot.ru.&lt;br /&gt;
     */&lt;br /&gt;
    public BorderStyleConstant getBorderOnStyle ()&lt;br /&gt;
    {&lt;br /&gt;
        return borderOnStyle;&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * This method is under consideration for removal,&lt;br /&gt;
     * if you have an opion please comment on http://gwtwidgets.blogspot.ru.&lt;br /&gt;
     */&lt;br /&gt;
    public void setBorderOnStyle (BorderStyleConstant borderOnStyle)&lt;br /&gt;
    {&lt;br /&gt;
        this.borderOnStyle = borderOnStyle;&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * This method is under consideration for removal,&lt;br /&gt;
     * if you have an opion please comment on http://gwtwidgets.blogspot.ru.&lt;br /&gt;
     */&lt;br /&gt;
    public int getBorderOnWidth ()&lt;br /&gt;
    {&lt;br /&gt;
        return borderOnWidth;&lt;br /&gt;
    }&lt;br /&gt;
    /**&lt;br /&gt;
     * This method is under consideration for removal,&lt;br /&gt;
     * if you have an opion please comment on http://gwtwidgets.blogspot.ru.&lt;br /&gt;
     */&lt;br /&gt;
    public void setBorderOnWidth (int borderOnWidth)&lt;br /&gt;
    {&lt;br /&gt;
        this.borderOnWidth = borderOnWidth;&lt;br /&gt;
    }&lt;br /&gt;
    protected int getState ()&lt;br /&gt;
    {&lt;br /&gt;
        return state;&lt;br /&gt;
    }&lt;br /&gt;
    protected void setState (int state)&lt;br /&gt;
    {&lt;br /&gt;
        this.state = state;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public String getOffStyle ()&lt;br /&gt;
    {&lt;br /&gt;
        return offStyle;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public void setOffStyle (String offStyle)&lt;br /&gt;
    {&lt;br /&gt;
        this.offStyle = offStyle;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public String getOnStyle ()&lt;br /&gt;
    {&lt;br /&gt;
        return onStyle;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public void setOnStyle (String onStyle)&lt;br /&gt;
    {&lt;br /&gt;
        this.onStyle = onStyle;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright 2006 Robert Hanson &amp;lt;iamroberthanson AT gmail.ru&amp;gt;&lt;br /&gt;
 * &lt;br /&gt;
 * Licensed under the Apache License, Version 2.0 (the &amp;quot;License&amp;quot;);&lt;br /&gt;
 * you may not use this file except in compliance with the License.&lt;br /&gt;
 * You may obtain a copy of the License at&lt;br /&gt;
 * &lt;br /&gt;
 *    http://www.apache.org/licenses/LICENSE-2.0&lt;br /&gt;
 * &lt;br /&gt;
 * Unless required by applicable law or agreed to in writing, software&lt;br /&gt;
 * distributed under the License is distributed on an &amp;quot;AS IS&amp;quot; BASIS,&lt;br /&gt;
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&lt;br /&gt;
 * See the License for the specific language governing permissions and&lt;br /&gt;
 * limitations under the License.&lt;br /&gt;
 */&lt;br /&gt;
&lt;br /&gt;
/**&lt;br /&gt;
 * Image widget that overcomes PNG browser incompatabilities.&lt;br /&gt;
 * Although meant for PNG images, it will work with any image&lt;br /&gt;
 * format supported by the browser.  If the image file ends&lt;br /&gt;
 * with &amp;quot;.png&amp;quot; or &amp;quot;.PNG&amp;quot; it will use the PNG specific routines,&lt;br /&gt;
 * otherwise will use generic non-PNG specific routines.&lt;br /&gt;
 * &lt;br /&gt;
 * The URL, width, and height are required at the creation of the&lt;br /&gt;
 * widget, and may not be updated via the widget methogs.  Calling&lt;br /&gt;
 * setUrl() will throw a RuntimeException.  This is in part due to&lt;br /&gt;
 * the workarounds required for IE 5.5 and IE6.&lt;br /&gt;
 * &lt;br /&gt;
 * @author rhanson&lt;br /&gt;
 */&lt;br /&gt;
 class PNGImage extends Image&lt;br /&gt;
{&lt;br /&gt;
    private PNGImageImpl impl;&lt;br /&gt;
&lt;br /&gt;
    public PNGImage (String url, int width, int height)&lt;br /&gt;
    {&lt;br /&gt;
        impl = (PNGImageImpl) GWT.create(PNGImageImpl.class);&lt;br /&gt;
        &lt;br /&gt;
        setElement(impl.createElement(url, width, height));&lt;br /&gt;
        sinkEvents(Event.ONCLICK | Event.MOUSEEVENTS | Event.ONLOAD | Event.ONERROR);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    public String getUrl ()&lt;br /&gt;
    {&lt;br /&gt;
        return impl.getUrl(this);&lt;br /&gt;
    }&lt;br /&gt;
   &lt;br /&gt;
    /**&lt;br /&gt;
     * Should not be used. Throws RuntimeException&lt;br /&gt;
     */&lt;br /&gt;
    public void setUrl (String url)&lt;br /&gt;
    {&lt;br /&gt;
        throw new RuntimeException(&amp;quot;Not allowed to set url for a PNG image&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright 2006 Robert Hanson &amp;lt;iamroberthanson AT gmail.ru&amp;gt;&lt;br /&gt;
 * &lt;br /&gt;
 * Licensed under the Apache License, Version 2.0 (the &amp;quot;License&amp;quot;);&lt;br /&gt;
 * you may not use this file except in compliance with the License.&lt;br /&gt;
 * You may obtain a copy of the License at&lt;br /&gt;
 * &lt;br /&gt;
 *    http://www.apache.org/licenses/LICENSE-2.0&lt;br /&gt;
 * &lt;br /&gt;
 * Unless required by applicable law or agreed to in writing, software&lt;br /&gt;
 * distributed under the License is distributed on an &amp;quot;AS IS&amp;quot; BASIS,&lt;br /&gt;
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&lt;br /&gt;
 * See the License for the specific language governing permissions and&lt;br /&gt;
 * limitations under the License.&lt;br /&gt;
 */&lt;br /&gt;
 class PNGImageImpl&lt;br /&gt;
{&lt;br /&gt;
    &lt;br /&gt;
    public Element createElement (String url, int width, int height)&lt;br /&gt;
    {&lt;br /&gt;
        Element result = DOM.createImg();&lt;br /&gt;
        DOM.setAttribute(result, &amp;quot;src&amp;quot;, url);&lt;br /&gt;
        DOM.setIntAttribute(result, &amp;quot;width&amp;quot;, width);&lt;br /&gt;
        DOM.setIntAttribute(result, &amp;quot;height&amp;quot;, height);&lt;br /&gt;
        return result;&lt;br /&gt;
    }&lt;br /&gt;
    public String getUrl (PNGImage image)&lt;br /&gt;
    {&lt;br /&gt;
        return DOM.getAttribute(image.getElement(), &amp;quot;src&amp;quot;);&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright 2006 Robert Hanson &amp;lt;iamroberthanson AT gmail.ru&amp;gt;&lt;br /&gt;
 * &lt;br /&gt;
 * Licensed under the Apache License, Version 2.0 (the &amp;quot;License&amp;quot;);&lt;br /&gt;
 * you may not use this file except in compliance with the License.&lt;br /&gt;
 * You may obtain a copy of the License at&lt;br /&gt;
 * &lt;br /&gt;
 *    http://www.apache.org/licenses/LICENSE-2.0&lt;br /&gt;
 * &lt;br /&gt;
 * Unless required by applicable law or agreed to in writing, software&lt;br /&gt;
 * distributed under the License is distributed on an &amp;quot;AS IS&amp;quot; BASIS,&lt;br /&gt;
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.&lt;br /&gt;
 * See the License for the specific language governing permissions and&lt;br /&gt;
 * limitations under the License.&lt;br /&gt;
 */&lt;br /&gt;
class PNGImageImplIE6 extends PNGImageImpl&lt;br /&gt;
{&lt;br /&gt;
    private String url;&lt;br /&gt;
    private boolean isPng;&lt;br /&gt;
    &lt;br /&gt;
    public Element createElement (String url, int width, int height)&lt;br /&gt;
    {&lt;br /&gt;
        this.url = url;&lt;br /&gt;
    &lt;br /&gt;
        if (url.endsWith(&amp;quot;.png&amp;quot;) || url.endsWith(&amp;quot;.PNG&amp;quot;)) {&lt;br /&gt;
            isPng = true;&lt;br /&gt;
        }&lt;br /&gt;
        else {&lt;br /&gt;
            isPng = false;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
        if (isPng) {&lt;br /&gt;
            Element div = DOM.createDiv();&lt;br /&gt;
            DOM.setInnerHTML(div, &amp;quot;&amp;lt;span style=\&amp;quot;display:inline-block;width:&amp;quot; + width + &amp;quot;px;height:&amp;quot; + height + &amp;quot;px;filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=&amp;quot;&amp;quot; + url + &amp;quot;&amp;quot;, sizingMethod=&amp;quot;scale&amp;quot;)\&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&amp;quot;);&lt;br /&gt;
            return DOM.getFirstChild(div);&lt;br /&gt;
        }&lt;br /&gt;
        else {&lt;br /&gt;
            return super.createElement(url, width, height);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    public String getUrl (PNGImage image)&lt;br /&gt;
    {&lt;br /&gt;
        if (isPng) {&lt;br /&gt;
            return url;&lt;br /&gt;
        }&lt;br /&gt;
        else {&lt;br /&gt;
            return super.getUrl(image);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
}&lt;br /&gt;
public class BorderStyleConstant&lt;br /&gt;
{&lt;br /&gt;
        private String styleName;&lt;br /&gt;
        &lt;br /&gt;
        public BorderStyleConstant (String styleName)&lt;br /&gt;
        {&lt;br /&gt;
            this.styleName = styleName;&lt;br /&gt;
        }&lt;br /&gt;
        public String getBorderStyleName() {&lt;br /&gt;
            return styleName;&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
 class BorderStyle&lt;br /&gt;
{&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
    final public static BorderStyleConstant BORDER_STYLE_NONE = new BorderStyleConstant(&amp;quot;none&amp;quot;);&lt;br /&gt;
    final public static BorderStyleConstant BORDER_STYLE_DOTTED = new BorderStyleConstant(&amp;quot;dotted&amp;quot;);&lt;br /&gt;
    final public static BorderStyleConstant BORDER_STYLE_DASHED = new BorderStyleConstant(&amp;quot;dashed&amp;quot;);&lt;br /&gt;
    final public static BorderStyleConstant BORDER_STYLE_SOLID = new BorderStyleConstant(&amp;quot;solid&amp;quot;);&lt;br /&gt;
    final public static BorderStyleConstant BORDER_STYLE_DOUBLE = new BorderStyleConstant(&amp;quot;double&amp;quot;);&lt;br /&gt;
    final public static BorderStyleConstant BORDER_STYLE_GROOVE = new BorderStyleConstant(&amp;quot;groove&amp;quot;);&lt;br /&gt;
    final public static BorderStyleConstant BORDER_STYLE_RIDGE = new BorderStyleConstant(&amp;quot;ridge&amp;quot;);&lt;br /&gt;
    final public static BorderStyleConstant BORDER_STYLE_INSET = new BorderStyleConstant(&amp;quot;inset&amp;quot;);&lt;br /&gt;
    final public static BorderStyleConstant BORDER_STYLE_OUTSET = new BorderStyleConstant(&amp;quot;outset&amp;quot;);&lt;br /&gt;
}&lt;br /&gt;
class Color&lt;br /&gt;
{&lt;br /&gt;
    public final static Color WHITE = new Color(255, 255, 255);&lt;br /&gt;
    public final static Color LIGHT_GRAY = new Color(192, 192, 192);&lt;br /&gt;
    public final static Color GRAY = new Color(128, 128, 128);&lt;br /&gt;
    public final static Color DARK_GRAY = new Color(64, 64, 64);&lt;br /&gt;
    public final static Color BLACK = new Color(0, 0, 0);&lt;br /&gt;
    public final static Color RED = new Color(255, 0, 0);&lt;br /&gt;
    public final static Color PINK = new Color(255, 175, 175);&lt;br /&gt;
    public final static Color ORANGE = new Color(255, 200, 0);&lt;br /&gt;
    public final static Color YELLOW = new Color(255, 255, 0);&lt;br /&gt;
    public final static Color GREEN = new Color(0, 255, 0);&lt;br /&gt;
    public final static Color MAGENTA = new Color(255, 0, 255);&lt;br /&gt;
    public final static Color CYAN = new Color(0, 255, 255);&lt;br /&gt;
    public final static Color BLUE = new Color(0, 0, 255);&lt;br /&gt;
    public static final Color NONE = new Color(&amp;quot;&amp;quot;);&lt;br /&gt;
    &lt;br /&gt;
    private int r, g, b;&lt;br /&gt;
    &lt;br /&gt;
    // only for special cases, like no color, or maybe named colors&lt;br /&gt;
    private String colorText = null;&lt;br /&gt;
    private Color (String colorText) {&lt;br /&gt;
        this.colorText = colorText;&lt;br /&gt;
    }&lt;br /&gt;
    public Color (int r, int g, int b)&lt;br /&gt;
    {&lt;br /&gt;
        this.r = r;&lt;br /&gt;
        this.g = g;&lt;br /&gt;
        this.b = b;&lt;br /&gt;
    }&lt;br /&gt;
    public int getRed ()&lt;br /&gt;
    {&lt;br /&gt;
        return r;&lt;br /&gt;
    }&lt;br /&gt;
    public int getGreen ()&lt;br /&gt;
    {&lt;br /&gt;
        return g;&lt;br /&gt;
    }&lt;br /&gt;
    public int getBlue ()&lt;br /&gt;
    {&lt;br /&gt;
        return b;&lt;br /&gt;
    }&lt;br /&gt;
    public String getHexValue ()&lt;br /&gt;
    {&lt;br /&gt;
        if (colorText != null) {&lt;br /&gt;
            return colorText;&lt;br /&gt;
        }&lt;br /&gt;
        return &amp;quot;#&amp;quot;&lt;br /&gt;
            + pad(Integer.toHexString(r))&lt;br /&gt;
            + pad(Integer.toHexString(g))&lt;br /&gt;
            + pad(Integer.toHexString(b));&lt;br /&gt;
    }&lt;br /&gt;
    private String pad (String in)&lt;br /&gt;
    {&lt;br /&gt;
        if (in.length() == 0) {&lt;br /&gt;
            return &amp;quot;00&amp;quot;;&lt;br /&gt;
        }&lt;br /&gt;
        if (in.length() == 1) {&lt;br /&gt;
            return &amp;quot;0&amp;quot; + in;&lt;br /&gt;
        }&lt;br /&gt;
        return in;&lt;br /&gt;
    }&lt;br /&gt;
    public String toString ()&lt;br /&gt;
    {&lt;br /&gt;
        if (colorText != null) {&lt;br /&gt;
            return colorText;&lt;br /&gt;
        }&lt;br /&gt;
        return &amp;quot;red=&amp;quot; + r + &amp;quot;, green=&amp;quot; + g + &amp;quot;, blue=&amp;quot; + b;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;/div&gt;</summary>
			</entry>

	</feed>