* New look and feel and theme selection UI. The old editor is still
there but not used. * Make compiere swing components works better under window and plastic look and feel. * Rename org.compiere.plaf.Adempiere*UI classes back to org.compiere.plaf.Compiere*UI. This is to make a clean separation between the new AdempiereLookAndFeel and the old CompiereLookAndFeel. Any class used by AdempiereLookAndFeel should goes into the org.adempiere.plaf package instead. As part of the exercise, AdempierePLAF is moved from org.compiere.plaf to org.adempiere.plaf * Fixed some bug related UI painting issue after switching of look and feel. It is still not perfect but much better. * Added a logout icon. Feel free to replace this if you have a better one. Please email me or post into the SF Developer forum is I break anything. Also, I haven't tested the new code under Linux yet and some localization work to be done.
This commit is contained in:
parent
0843ba946f
commit
b830c022cd
File diff suppressed because it is too large
Load Diff
|
@ -1,286 +0,0 @@
|
||||||
/******************************************************************************
|
|
||||||
* The contents of this file are subject to the Compiere License Version 1.1
|
|
||||||
* ("License"); You may not use this file except in compliance with the License
|
|
||||||
* You may obtain a copy of the License at http://www.compiere.org/license.html
|
|
||||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
||||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
|
||||||
* the specific language governing rights and limitations under the License.
|
|
||||||
* The Original Code is Compiere ERP & CRM Smart Business Solution. The Initial
|
|
||||||
* Developer of the Original Code is Jorg Janke. Portions created by Jorg Janke
|
|
||||||
* are Copyright (C) 1999-2005 Jorg Janke.
|
|
||||||
* All parts are Copyright (C) 1999-2005 ComPiere, Inc. All Rights Reserved.
|
|
||||||
* Contributor(s): ______________________________________.
|
|
||||||
*****************************************************************************/
|
|
||||||
package org.adempiere.plaf;
|
|
||||||
|
|
||||||
import java.awt.Color;
|
|
||||||
import java.util.logging.*;
|
|
||||||
|
|
||||||
import javax.swing.plaf.ColorUIResource;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Color Blind Utilities.
|
|
||||||
* These utilities help to show how color blind/challenged see colors.
|
|
||||||
*
|
|
||||||
* Created by Thomas Wolfmaier.
|
|
||||||
* Copyright (C) 1999-2005 HCIRN.
|
|
||||||
* All rights reserved.
|
|
||||||
* @see <a href="http://www.hcirn.com">HCIRN</a>
|
|
||||||
*
|
|
||||||
* @author Thomas Wolfmaier
|
|
||||||
* @version $Id: ColorBlind.java,v 1.8 2005/10/14 00:42:52 jjanke Exp $
|
|
||||||
*/
|
|
||||||
public class AdempiereColorBlind
|
|
||||||
{
|
|
||||||
/** Color Blindness Type - 0=none */
|
|
||||||
public static final String[] COLORBLIND_TYPE =
|
|
||||||
{"", "Protanopia", "Deuteranopia", "Tritanopia"};
|
|
||||||
|
|
||||||
public static final int NORMAL = 0;
|
|
||||||
public static final int PROTANOPIA = 1;
|
|
||||||
public static final int DEUTERANOPIA = 2;
|
|
||||||
public static final int TRITANOPIA = 3;
|
|
||||||
|
|
||||||
/*************************************************************************/
|
|
||||||
|
|
||||||
private static final double[][] confusionPoints =
|
|
||||||
{ {0.735, 0.265},
|
|
||||||
{1.140, -0.140},
|
|
||||||
{0.171, -0.003}
|
|
||||||
};
|
|
||||||
private static final double[][][] colorAxes =
|
|
||||||
{ {{0.115807, 0.073581}, {0.471899, 0.527051}},
|
|
||||||
{{0.102776, 0.102864}, {0.505845, 0.493211}},
|
|
||||||
{{0.045391, 0.294976}, {0.665764, 0.334011}}
|
|
||||||
};
|
|
||||||
private static final double[][] RGBtoXYZMatrix =
|
|
||||||
{ {0.430574, 0.341550, 0.178325},
|
|
||||||
{0.222015, 0.706655, 0.071330},
|
|
||||||
{0.020183, 0.129553, 0.939180}
|
|
||||||
};
|
|
||||||
private static final double[][] XYZtoRGBMatrix =
|
|
||||||
{ { 3.063218, -1.393325, -0.475802},
|
|
||||||
{-0.969243, 1.875966, 0.041555},
|
|
||||||
{ 0.067871, -0.228834, 1.069251}
|
|
||||||
};
|
|
||||||
private static final double[] whitePoint =
|
|
||||||
{ 0.312713, 0.329016, 0.358271
|
|
||||||
};
|
|
||||||
private static final double gamma = 2.2;
|
|
||||||
|
|
||||||
/** Color Blind Type */
|
|
||||||
private static int s_colorType = NORMAL;
|
|
||||||
|
|
||||||
/** Logger */
|
|
||||||
private static Logger log = Logger.getLogger(AdempiereColorBlind.class.getName());
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set Color Type for Color Blind view
|
|
||||||
* @param colorType (0 = none)
|
|
||||||
*/
|
|
||||||
public static void setColorType (int colorType)
|
|
||||||
{
|
|
||||||
if (colorType > 0 && colorType < 4)
|
|
||||||
s_colorType = colorType;
|
|
||||||
else
|
|
||||||
s_colorType = 0;
|
|
||||||
if (s_colorType != 0)
|
|
||||||
log.config(COLORBLIND_TYPE[colorType]);
|
|
||||||
} // setColorType
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Color Type for Color Blind view
|
|
||||||
* @return colorType (0 = none)
|
|
||||||
*/
|
|
||||||
public static int getColorType ()
|
|
||||||
{
|
|
||||||
return s_colorType;
|
|
||||||
} // getColorType
|
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
|
||||||
* Convert "normal" color to Dichromat Color based on set color type
|
|
||||||
* @param color Java Color object containing values for RGB
|
|
||||||
* @return Dichromat Color
|
|
||||||
*/
|
|
||||||
public static ColorUIResource getDichromatColorUIResource (ColorUIResource color)
|
|
||||||
{
|
|
||||||
if (s_colorType == NORMAL)
|
|
||||||
return color;
|
|
||||||
return new ColorUIResource(getDichromatColorUIResource (color, s_colorType));
|
|
||||||
} // convertToDichromatColorUIResource
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Convert "normal" color to Dichromat Color
|
|
||||||
* @param color Java Color object containing values for RGB
|
|
||||||
* @param colorType PROTANOPIA = 1, DEUTERANOPIA = 2 or TRITANOPIA = 3 as declared above
|
|
||||||
* @return Dichromat Color
|
|
||||||
*/
|
|
||||||
public static Color getDichromatColorUIResource (ColorUIResource color, int colorType)
|
|
||||||
{
|
|
||||||
if (s_colorType == NORMAL)
|
|
||||||
return color;
|
|
||||||
return new ColorUIResource(getDichromatColor (color, s_colorType));
|
|
||||||
} // convertToDichromatColorUIResource
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Convert "normal" color to Dichromat Color based on set color type
|
|
||||||
* @param color Java Color object containing values for RGB
|
|
||||||
* @return Dichromat Color
|
|
||||||
*/
|
|
||||||
public static Color getDichromatColor (Color color)
|
|
||||||
{
|
|
||||||
if (s_colorType == NORMAL)
|
|
||||||
return color;
|
|
||||||
return getDichromatColor (color, s_colorType);
|
|
||||||
} // convertToDichromatColor
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Convert "normal" color to Dichromat Color
|
|
||||||
* @param color Java Color object containing values for RGB
|
|
||||||
* @param colorType PROTANOPIA = 1, DEUTERANOPIA = 2 or TRITANOPIA = 3 as declared above
|
|
||||||
* @return Dichromat Color
|
|
||||||
*/
|
|
||||||
public static Color getDichromatColor (Color color, int colorType)
|
|
||||||
{
|
|
||||||
// check type & return if not valid
|
|
||||||
int type = 0;
|
|
||||||
if (colorType > 0 && colorType < 4)
|
|
||||||
type = colorType;
|
|
||||||
// No conversion or no color
|
|
||||||
if (type == 0 || color == null)
|
|
||||||
return color;
|
|
||||||
type--; // correct to zero based
|
|
||||||
|
|
||||||
// Return white & black - not converted
|
|
||||||
if (color.equals(Color.black) || color.equals(Color.white))
|
|
||||||
return color;
|
|
||||||
|
|
||||||
double red = color.getRed();
|
|
||||||
double green = color.getGreen();
|
|
||||||
double blue = color.getBlue();
|
|
||||||
|
|
||||||
// System.out.println("Red: " + red + " Green: " + green + " Blue: " + blue);
|
|
||||||
|
|
||||||
double X = RGBtoXYZMatrix[0][0] * Math.pow(red / 255.0, gamma) +
|
|
||||||
RGBtoXYZMatrix[0][1] * Math.pow(green / 255.0, gamma) +
|
|
||||||
RGBtoXYZMatrix[0][2] * Math.pow(blue / 255.0, gamma);
|
|
||||||
double Y = RGBtoXYZMatrix[1][0] * Math.pow(red / 255.0, gamma) +
|
|
||||||
RGBtoXYZMatrix[1][1] * Math.pow(green / 255.0, gamma) +
|
|
||||||
RGBtoXYZMatrix[1][2] * Math.pow(blue / 255.0, gamma);
|
|
||||||
double Z = RGBtoXYZMatrix[2][0] * Math.pow(red / 255.0, gamma) +
|
|
||||||
RGBtoXYZMatrix[2][1] * Math.pow(green / 255.0, gamma) +
|
|
||||||
RGBtoXYZMatrix[2][2] * Math.pow(blue / 255.0, gamma);
|
|
||||||
|
|
||||||
// System.out.println("X: " + X + " Y: " + Y + " Z: " + Z);
|
|
||||||
|
|
||||||
double x = 0.0;
|
|
||||||
double y = 0.0;
|
|
||||||
|
|
||||||
if ((X + Y + Z) != 0.0)
|
|
||||||
{
|
|
||||||
x = X / (X + Y + Z);
|
|
||||||
y = Y / (X + Y + Z);
|
|
||||||
}
|
|
||||||
|
|
||||||
// System.out.println("x: " + x + " y: " + y + " Y: " + Y);
|
|
||||||
|
|
||||||
double Yn = Y;
|
|
||||||
double Xn = (whitePoint[0] * Yn) / whitePoint[1];
|
|
||||||
double Zn = (whitePoint[2] * Yn) / whitePoint[1];
|
|
||||||
|
|
||||||
double xc = confusionPoints[type][0];
|
|
||||||
double yc = confusionPoints[type][1];
|
|
||||||
|
|
||||||
double x1 = colorAxes[type][0][0];
|
|
||||||
double y1 = colorAxes[type][0][1];
|
|
||||||
double x2 = colorAxes[type][1][0];
|
|
||||||
double y2 = colorAxes[type][1][1];
|
|
||||||
|
|
||||||
double ap = (y2 - y1) / (x2 - x1);
|
|
||||||
double bp = y1 - (x1 * ap);
|
|
||||||
|
|
||||||
// System.out.println("ap: " + ap + " bp: " + bp);
|
|
||||||
|
|
||||||
double a;
|
|
||||||
if (x < xc)
|
|
||||||
a = (yc - y) / (xc - x);
|
|
||||||
else
|
|
||||||
a = (y - yc) / (x - xc);
|
|
||||||
|
|
||||||
double b = y - (x * a);
|
|
||||||
|
|
||||||
// System.out.println("a: " + a + " b: " + b);
|
|
||||||
|
|
||||||
x = (bp - b) / (a - ap);
|
|
||||||
y = a * x + b;
|
|
||||||
|
|
||||||
// System.out.println("x: " + x + " y: " + y);
|
|
||||||
|
|
||||||
X = 0.0;
|
|
||||||
Z = 0.0;
|
|
||||||
if (y != 0)
|
|
||||||
{
|
|
||||||
X = x * (Y / y);
|
|
||||||
Z = (1 - x - y) * (Y / y);
|
|
||||||
}
|
|
||||||
|
|
||||||
// System.out.println("X: " + X + " Y: " + Y + " Z: " + Z);
|
|
||||||
|
|
||||||
red = XYZtoRGBMatrix[0][0] * X +
|
|
||||||
XYZtoRGBMatrix[0][1] * Y +
|
|
||||||
XYZtoRGBMatrix[0][2] * Z;
|
|
||||||
green = XYZtoRGBMatrix[1][0] * X +
|
|
||||||
XYZtoRGBMatrix[1][1] * Y +
|
|
||||||
XYZtoRGBMatrix[1][2] * Z;
|
|
||||||
blue = XYZtoRGBMatrix[2][0] * X +
|
|
||||||
XYZtoRGBMatrix[2][1] * Y +
|
|
||||||
XYZtoRGBMatrix[2][2] * Z;
|
|
||||||
|
|
||||||
// System.out.println("Red: " + red + " Green: " + green + " Blue: " + blue);
|
|
||||||
|
|
||||||
double reddiff = XYZtoRGBMatrix[0][0] * (Xn - X) +
|
|
||||||
XYZtoRGBMatrix[0][1] * (Yn - Y) +
|
|
||||||
XYZtoRGBMatrix[0][2] * (Zn - Z);
|
|
||||||
double greendiff = XYZtoRGBMatrix[1][0] * (Xn - X) +
|
|
||||||
XYZtoRGBMatrix[1][1] * (Yn - Y) +
|
|
||||||
XYZtoRGBMatrix[1][2] * (Zn - Z);
|
|
||||||
double bluediff = XYZtoRGBMatrix[2][0] * (Xn - X) +
|
|
||||||
XYZtoRGBMatrix[2][1] * (Yn - Y) +
|
|
||||||
XYZtoRGBMatrix[2][2] * (Zn - Z);
|
|
||||||
|
|
||||||
double cr = ((red < 0.0 ? 0.0 : 1.0) - red) / reddiff;
|
|
||||||
double cg = ((green < 0.0 ? 0.0 : 1.0) - green) / greendiff;
|
|
||||||
double cb = ((blue < 0.0 ? 0.0 : 1.0) - blue) / bluediff;
|
|
||||||
|
|
||||||
// System.out.println("cr: " + cr + " cg: " + cg + " cb: " + cb);
|
|
||||||
|
|
||||||
double c1 = (cr < 0 || cr > 1) ? 0 : cr;
|
|
||||||
double c2 = (cg < 0 || cg > 1) ? 0 : cg;
|
|
||||||
double c3 = (cb < 0 || cb > 1) ? 0 : cb;
|
|
||||||
double c = Math.max(c1, Math.max(c2, c3));
|
|
||||||
|
|
||||||
// System.out.println("c: " + c);
|
|
||||||
|
|
||||||
red = red + c * reddiff;
|
|
||||||
green = green + c * greendiff;
|
|
||||||
blue = blue + c * bluediff;
|
|
||||||
|
|
||||||
// System.out.println("Red: " + red + " Green: " + green + " Blue: " + blue);
|
|
||||||
|
|
||||||
red = Math.pow(red, 1.0 / gamma);
|
|
||||||
green = Math.pow(green, 1.0 / gamma);
|
|
||||||
blue = Math.pow(blue, 1.0 / gamma);
|
|
||||||
|
|
||||||
// System.out.println("Red: " + red + " Green: " + green + " Blue: " + blue);
|
|
||||||
// System.out.println("Red: " + red * 255.0 + " Green: " + green * 255.0 + " Blue: " + blue * 255.0);
|
|
||||||
|
|
||||||
Color retValue = new Color((float)red, (float)green, (float)blue);
|
|
||||||
log.fine("Color " + color.getRed() + "-" + color.getGreen() + "-" + color.getBlue()
|
|
||||||
+ " -> " + retValue.getRed() + "-" + retValue.getGreen() + "-" + retValue.getBlue() + " <- " + COLORBLIND_TYPE[colorType]);
|
|
||||||
|
|
||||||
return retValue;
|
|
||||||
} // convertToDichromatColor
|
|
||||||
|
|
||||||
} // ColorBlind
|
|
|
@ -19,7 +19,7 @@ import javax.swing.plaf.*;
|
||||||
import javax.swing.plaf.basic.*;
|
import javax.swing.plaf.basic.*;
|
||||||
import javax.swing.plaf.metal.*;
|
import javax.swing.plaf.metal.*;
|
||||||
|
|
||||||
import org.compiere.plaf.AdempiereComboPopup;
|
import org.compiere.plaf.CompiereComboPopup;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -55,7 +55,7 @@ public class AdempiereComboBoxUI extends com.jgoodies.looks.plastic.PlasticCombo
|
||||||
{
|
{
|
||||||
MouseListener[] ml = c.getMouseListeners();
|
MouseListener[] ml = c.getMouseListeners();
|
||||||
super.installUI(c);
|
super.installUI(c);
|
||||||
c.setOpaque(false);
|
//c.setOpaque(false);
|
||||||
//
|
//
|
||||||
for (int i = 0; i < ml.length; i++)
|
for (int i = 0; i < ml.length; i++)
|
||||||
{
|
{
|
||||||
|
@ -74,8 +74,8 @@ public class AdempiereComboBoxUI extends com.jgoodies.looks.plastic.PlasticCombo
|
||||||
protected JButton createArrowButton()
|
protected JButton createArrowButton()
|
||||||
{
|
{
|
||||||
JButton button = super.createArrowButton();
|
JButton button = super.createArrowButton();
|
||||||
button.setContentAreaFilled(false);
|
//button.setContentAreaFilled(false);
|
||||||
button.setOpaque(false);
|
//button.setOpaque(false);
|
||||||
return button;
|
return button;
|
||||||
} // createArrowButton
|
} // createArrowButton
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ public class AdempiereComboBoxUI extends com.jgoodies.looks.plastic.PlasticCombo
|
||||||
*/
|
*/
|
||||||
protected ComboPopup createPopup()
|
protected ComboPopup createPopup()
|
||||||
{
|
{
|
||||||
AdempiereComboPopup newPopup = new AdempiereComboPopup( comboBox );
|
CompiereComboPopup newPopup = new CompiereComboPopup( comboBox );
|
||||||
newPopup.getAccessibleContext().setAccessibleParent(comboBox);
|
newPopup.getAccessibleContext().setAccessibleParent(comboBox);
|
||||||
return newPopup;
|
return newPopup;
|
||||||
} // createPopup
|
} // createPopup
|
||||||
|
|
|
@ -1,15 +1,18 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* The contents of this file are subject to the Compiere License Version 1.1
|
* Product: Adempiere ERP & CRM Smart Business Solution *
|
||||||
* ("License"); You may not use this file except in compliance with the License
|
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
|
||||||
* You may obtain a copy of the License at http://www.compiere.org/license.html
|
* This program is free software; you can redistribute it and/or modify it *
|
||||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
* under the terms version 2 of the GNU General Public License as published *
|
||||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
|
* by the Free Software Foundation. This program is distributed in the hope *
|
||||||
* the specific language governing rights and limitations under the License.
|
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
|
||||||
* The Original Code is Compiere ERP & CRM Smart Business Solution. The Initial
|
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||||
* Developer of the Original Code is Jorg Janke. Portions created by Jorg Janke
|
* See the GNU General Public License for more details. *
|
||||||
* are Copyright (C) 1999-2005 Jorg Janke.
|
* You should have received a copy of the GNU General Public License along *
|
||||||
* All parts are Copyright (C) 1999-2005 ComPiere, Inc. All Rights Reserved.
|
* with this program; if not, write to the Free Software Foundation, Inc., *
|
||||||
* Contributor(s): ______________________________________.
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
|
||||||
|
* For the text or an alternative of this public license, you may reach us *
|
||||||
|
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||||
|
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
package org.adempiere.plaf;
|
package org.adempiere.plaf;
|
||||||
|
|
||||||
|
@ -18,18 +21,10 @@ import java.awt.*;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.plaf.metal.*;
|
import javax.swing.plaf.metal.*;
|
||||||
|
|
||||||
|
import com.jgoodies.looks.plastic.PlasticLookAndFeel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compiere Look & Feel.
|
* Adempiere Look & Feel, based on JGoodies look and feel
|
||||||
* We wanted a nice UI not the battleship gray based stuff.
|
|
||||||
* I guess a matter of taste.
|
|
||||||
* <code>
|
|
||||||
* :
|
|
||||||
* UIManager.setLookAndFeel(new com.compiere.plaf.CompiereLookAndFeel());
|
|
||||||
* // or UIManager.setLookAndFeel("com.compiere.plaf.CompiereLookAndFeel");
|
|
||||||
* </code>
|
|
||||||
*
|
|
||||||
* @author Jorg Janke
|
|
||||||
* @version $Id: CompiereLookAndFeel.java,v 1.19 2005/12/05 02:38:28 jjanke Exp $
|
|
||||||
*/
|
*/
|
||||||
public class AdempiereLookAndFeel extends com.jgoodies.looks.plastic.PlasticLookAndFeel
|
public class AdempiereLookAndFeel extends com.jgoodies.looks.plastic.PlasticLookAndFeel
|
||||||
{
|
{
|
||||||
|
@ -86,10 +81,7 @@ public class AdempiereLookAndFeel extends com.jgoodies.looks.plastic.PlasticLook
|
||||||
*/
|
*/
|
||||||
public UIDefaults getDefaults()
|
public UIDefaults getDefaults()
|
||||||
{
|
{
|
||||||
// System.out.println("CompiereLookAndFeel.getDefaults");
|
//com.jgoodies.looks.plastic.PlasticLookAndFeel.setCurrentTheme(s_theme);
|
||||||
// Theme already created/set
|
|
||||||
//MetalLookAndFeel.setCurrentTheme(s_theme);
|
|
||||||
com.jgoodies.looks.plastic.PlasticLookAndFeel.setCurrentTheme(s_theme);
|
|
||||||
UIDefaults defaults = super.getDefaults(); // calls init..Defaults
|
UIDefaults defaults = super.getDefaults(); // calls init..Defaults
|
||||||
return defaults;
|
return defaults;
|
||||||
} // getDefaults
|
} // getDefaults
|
||||||
|
@ -153,11 +145,7 @@ public class AdempiereLookAndFeel extends com.jgoodies.looks.plastic.PlasticLook
|
||||||
*/
|
*/
|
||||||
protected void initSystemColorDefaults (UIDefaults table)
|
protected void initSystemColorDefaults (UIDefaults table)
|
||||||
{
|
{
|
||||||
// System.out.println("CompiereLookAndFeel.initSystemColorDefaults");
|
|
||||||
super.initSystemColorDefaults( table);
|
super.initSystemColorDefaults( table);
|
||||||
|
|
||||||
// we made the color a bit darker
|
|
||||||
// table.put("textHighlight", CompiereUtils.getTranslucentColor(getTextHighlightColor(), 128));
|
|
||||||
} // initSystemColorDefaults
|
} // initSystemColorDefaults
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -166,7 +154,6 @@ public class AdempiereLookAndFeel extends com.jgoodies.looks.plastic.PlasticLook
|
||||||
*/
|
*/
|
||||||
protected void initComponentDefaults (UIDefaults table)
|
protected void initComponentDefaults (UIDefaults table)
|
||||||
{
|
{
|
||||||
// System.out.println("CompiereLookAndFeel.initComponentDefaults");
|
|
||||||
super.initComponentDefaults( table);
|
super.initComponentDefaults( table);
|
||||||
|
|
||||||
// ComboBox defaults
|
// ComboBox defaults
|
||||||
|
@ -199,7 +186,7 @@ public class AdempiereLookAndFeel extends com.jgoodies.looks.plastic.PlasticLook
|
||||||
{
|
{
|
||||||
if (theme != null)
|
if (theme != null)
|
||||||
s_theme = theme;
|
s_theme = theme;
|
||||||
MetalLookAndFeel.setCurrentTheme(s_theme);
|
PlasticLookAndFeel.setCurrentTheme(s_theme);
|
||||||
} // setCurrentTheme
|
} // setCurrentTheme
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -244,4 +231,4 @@ public class AdempiereLookAndFeel extends com.jgoodies.looks.plastic.PlasticLook
|
||||||
super.provideErrorFeedback (component);
|
super.provideErrorFeedback (component);
|
||||||
} // provideErrorFeedback
|
} // provideErrorFeedback
|
||||||
|
|
||||||
} // CompiereLookAndFeel
|
} // AdempiereLookAndFeel
|
||||||
|
|
|
@ -14,18 +14,44 @@
|
||||||
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||||
* or via info@compiere.org or http://www.compiere.org/license.html *
|
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
package org.compiere.plaf;
|
package org.adempiere.plaf;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.Color;
|
||||||
import java.awt.event.*;
|
import java.awt.Dimension;
|
||||||
import java.lang.reflect.*;
|
import java.awt.Font;
|
||||||
import java.util.*;
|
import java.awt.Insets;
|
||||||
import java.util.logging.*;
|
import java.awt.Toolkit;
|
||||||
import javax.swing.*;
|
import java.awt.Window;
|
||||||
import javax.swing.plaf.metal.*;
|
import java.awt.event.WindowEvent;
|
||||||
//import org.compiere.process.OrgOwnership;
|
import java.lang.reflect.Method;
|
||||||
import org.compiere.swing.*;
|
import java.lang.reflect.Modifier;
|
||||||
import org.compiere.util.*;
|
import java.util.ArrayList;
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.ResourceBundle;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
import javax.swing.ImageIcon;
|
||||||
|
import javax.swing.JFrame;
|
||||||
|
import javax.swing.JOptionPane;
|
||||||
|
import javax.swing.LookAndFeel;
|
||||||
|
import javax.swing.SwingUtilities;
|
||||||
|
import javax.swing.UIManager;
|
||||||
|
import javax.swing.plaf.metal.MetalLookAndFeel;
|
||||||
|
import javax.swing.plaf.metal.MetalTheme;
|
||||||
|
|
||||||
|
import org.compiere.plaf.CompiereLookAndFeel;
|
||||||
|
import org.compiere.plaf.CompiereThemeBlueMetal;
|
||||||
|
import org.compiere.plaf.CompiereThemeIce;
|
||||||
|
import org.compiere.swing.CButton;
|
||||||
|
import org.compiere.swing.CFrame;
|
||||||
|
import org.compiere.swing.ColorBlind;
|
||||||
|
import org.compiere.swing.ExtendedTheme;
|
||||||
|
import org.compiere.util.Ini;
|
||||||
|
import org.compiere.util.ValueNamePair;
|
||||||
|
|
||||||
|
import com.jgoodies.looks.plastic.PlasticLookAndFeel;
|
||||||
|
import com.jgoodies.looks.plastic.PlasticTheme;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Variable Pluggable Look And Feel.
|
* Variable Pluggable Look And Feel.
|
||||||
|
@ -33,18 +59,12 @@ import org.compiere.util.*;
|
||||||
*
|
*
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: AdempierePLAF.java,v 1.3 2006/07/30 00:52:23 jjanke Exp $
|
* @version $Id: AdempierePLAF.java,v 1.3 2006/07/30 00:52:23 jjanke Exp $
|
||||||
|
*
|
||||||
|
* @author Low Heng Sin
|
||||||
|
* @version 2006-11-27
|
||||||
*/
|
*/
|
||||||
public final class AdempierePLAF
|
public final class AdempierePLAF
|
||||||
{
|
{
|
||||||
/** Version tag */
|
|
||||||
public static final String VERSION = "R1.4.0";
|
|
||||||
/** Key of Client Property to paint in AdempiereColor */
|
|
||||||
public static final String BACKGROUND = "AdempiereBackground";
|
|
||||||
/** Key of Client Property for Rectangle Items - if exists, the standard background is used */
|
|
||||||
public static final String BACKGROUND_FILL = "AdempiereBackgroundFill";
|
|
||||||
/** Key of Client Property for CPanel */
|
|
||||||
public static final String TABLEVEL = "AdempiereTabLevel";
|
|
||||||
|
|
||||||
/** Logger */
|
/** Logger */
|
||||||
private static Logger log = Logger.getLogger(AdempierePLAF.class.getName());
|
private static Logger log = Logger.getLogger(AdempierePLAF.class.getName());
|
||||||
|
|
||||||
|
@ -62,30 +82,40 @@ public final class AdempierePLAF
|
||||||
} // getFieldBackground_Normal
|
} // getFieldBackground_Normal
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return Error field background (AdempiereTheme)
|
* Return Error field background
|
||||||
* @return Color
|
* @return Color
|
||||||
*/
|
*/
|
||||||
public static Color getFieldBackground_Error()
|
public static Color getFieldBackground_Error()
|
||||||
{
|
{
|
||||||
return ColorBlind.getDichromatColor(AdempiereThemeInnova.error);
|
Color c = UIManager.getColor(ExtendedTheme.ERROR_BG_KEY);
|
||||||
|
if (c == null)
|
||||||
|
c = ExtendedTheme.DEFAULT_ERROR_BG;
|
||||||
|
return ColorBlind.getDichromatColor(c);
|
||||||
} // getFieldBackground_Error
|
} // getFieldBackground_Error
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return Mandatory field background color (AdempiereTheme)
|
* Return Mandatory field background color
|
||||||
* @return Color
|
* @return Color
|
||||||
*/
|
*/
|
||||||
public static Color getFieldBackground_Mandatory()
|
public static Color getFieldBackground_Mandatory()
|
||||||
{
|
{
|
||||||
return ColorBlind.getDichromatColor(AdempiereThemeInnova.mandatory);
|
Color c = UIManager.getColor(ExtendedTheme.MANDATORY_BG_KEY);
|
||||||
|
if (c == null)
|
||||||
|
c = ExtendedTheme.DEFAULT_MANDATORY_BG;
|
||||||
|
return ColorBlind.getDichromatColor(c);
|
||||||
} // getFieldBackground_Mandatory
|
} // getFieldBackground_Mandatory
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return Inactive field background color (AdempiereTheme)
|
* Return Inactive field background color
|
||||||
* @return Color
|
* @return Color
|
||||||
*/
|
*/
|
||||||
public static Color getFieldBackground_Inactive()
|
public static Color getFieldBackground_Inactive()
|
||||||
{
|
{
|
||||||
return ColorBlind.getDichromatColor(AdempiereThemeInnova.inactive);
|
Color c = UIManager.getColor(ExtendedTheme.INACTIVE_BG_KEY);
|
||||||
|
if ( c != null )
|
||||||
|
return ColorBlind.getDichromatColor(c);
|
||||||
|
else
|
||||||
|
return getFieldBackground_Normal();
|
||||||
} // getFieldBackground_Inactive
|
} // getFieldBackground_Inactive
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -105,7 +135,10 @@ public final class AdempierePLAF
|
||||||
*/
|
*/
|
||||||
public static Color getInfoBackground()
|
public static Color getInfoBackground()
|
||||||
{
|
{
|
||||||
return ColorBlind.getDichromatColor(AdempiereThemeInnova.info);
|
Color c = UIManager.getColor(ExtendedTheme.INFO_BG_KEY);
|
||||||
|
if (c == null)
|
||||||
|
c = UIManager.getColor("info");
|
||||||
|
return ColorBlind.getDichromatColor(c);
|
||||||
} // getInfoBackground
|
} // getInfoBackground
|
||||||
|
|
||||||
|
|
||||||
|
@ -127,7 +160,7 @@ public final class AdempierePLAF
|
||||||
*/
|
*/
|
||||||
public static Color getTextColor_OK()
|
public static Color getTextColor_OK()
|
||||||
{
|
{
|
||||||
return ColorBlind.getDichromatColor(AdempiereThemeInnova.txt_ok);
|
return getTextColor_Normal();
|
||||||
} // getText_OK
|
} // getText_OK
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -136,7 +169,10 @@ public final class AdempierePLAF
|
||||||
*/
|
*/
|
||||||
public static Color getTextColor_Issue()
|
public static Color getTextColor_Issue()
|
||||||
{
|
{
|
||||||
return ColorBlind.getDichromatColor(AdempiereThemeInnova.txt_error);
|
Color c = UIManager.getColor(ExtendedTheme.ERROR_FG_KEY);
|
||||||
|
if (c == null)
|
||||||
|
c = ExtendedTheme.DEFAULT_ERROR_FG;
|
||||||
|
return ColorBlind.getDichromatColor(c);
|
||||||
} // getText_Issue
|
} // getText_Issue
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -155,7 +191,7 @@ public final class AdempierePLAF
|
||||||
*/
|
*/
|
||||||
public static Color getPrimary1()
|
public static Color getPrimary1()
|
||||||
{
|
{
|
||||||
return ColorBlind.getDichromatColor(AdempiereThemeInnova.primary1);
|
return ColorBlind.getDichromatColor(MetalLookAndFeel.getCurrentTheme().getPrimaryControlDarkShadow());
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Get Primary2
|
* Get Primary2
|
||||||
|
@ -163,7 +199,7 @@ public final class AdempierePLAF
|
||||||
*/
|
*/
|
||||||
public static Color getPrimary2()
|
public static Color getPrimary2()
|
||||||
{
|
{
|
||||||
return ColorBlind.getDichromatColor(AdempiereThemeInnova.primary2);
|
return ColorBlind.getDichromatColor(MetalLookAndFeel.getCurrentTheme().getPrimaryControlShadow());
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Get Primary3
|
* Get Primary3
|
||||||
|
@ -171,7 +207,7 @@ public final class AdempierePLAF
|
||||||
*/
|
*/
|
||||||
public static Color getPrimary3()
|
public static Color getPrimary3()
|
||||||
{
|
{
|
||||||
return ColorBlind.getDichromatColor(AdempiereThemeInnova.primary3);
|
return ColorBlind.getDichromatColor(MetalLookAndFeel.getCurrentTheme().getPrimaryControl());
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Get Secondary 1
|
* Get Secondary 1
|
||||||
|
@ -179,7 +215,7 @@ public final class AdempierePLAF
|
||||||
*/
|
*/
|
||||||
public static Color getSecondary1()
|
public static Color getSecondary1()
|
||||||
{
|
{
|
||||||
return ColorBlind.getDichromatColor(AdempiereThemeInnova.secondary1);
|
return ColorBlind.getDichromatColor(MetalLookAndFeel.getCurrentTheme().getControlDarkShadow());
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Get Secondary 2
|
* Get Secondary 2
|
||||||
|
@ -187,7 +223,7 @@ public final class AdempierePLAF
|
||||||
*/
|
*/
|
||||||
public static Color getSecondary2()
|
public static Color getSecondary2()
|
||||||
{
|
{
|
||||||
return ColorBlind.getDichromatColor(AdempiereThemeInnova.secondary2);
|
return ColorBlind.getDichromatColor(MetalLookAndFeel.getCurrentTheme().getControlShadow());
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Get Secondary 3
|
* Get Secondary 3
|
||||||
|
@ -195,20 +231,19 @@ public final class AdempierePLAF
|
||||||
*/
|
*/
|
||||||
public static Color getSecondary3()
|
public static Color getSecondary3()
|
||||||
{
|
{
|
||||||
return ColorBlind.getDichromatColor(AdempiereThemeInnova.secondary3);
|
return ColorBlind.getDichromatColor(MetalLookAndFeel.getCurrentTheme().getControl());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/****** Fonts ************************************************************/
|
/****** Fonts ************************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Header Font (window/label font)
|
* Get Header Font (window title font)
|
||||||
* @return font
|
* @return font
|
||||||
*/
|
*/
|
||||||
public static Font getFont_Header()
|
public static Font getFont_Header()
|
||||||
{
|
{
|
||||||
return CompiereTheme.windowFont;
|
return MetalLookAndFeel.getWindowTitleFont();
|
||||||
// return UIManager.getFont("Label.font");
|
|
||||||
} // getFont_Header
|
} // getFont_Header
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -217,8 +252,7 @@ public final class AdempierePLAF
|
||||||
*/
|
*/
|
||||||
public static Font getFont_Field()
|
public static Font getFont_Field()
|
||||||
{
|
{
|
||||||
return CompiereTheme.userFont;
|
return UIManager.getFont("TextField.font");
|
||||||
// return UIManager.getFont("TextField.font");
|
|
||||||
} // getFont_Field
|
} // getFont_Field
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -227,8 +261,7 @@ public final class AdempierePLAF
|
||||||
*/
|
*/
|
||||||
public static Font getFont_Label()
|
public static Font getFont_Label()
|
||||||
{
|
{
|
||||||
return CompiereTheme.controlFont;
|
return UIManager.getFont("Label.font");
|
||||||
// return UIManager.getFont("Label.font");
|
|
||||||
} // setFont_Label
|
} // setFont_Label
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -237,7 +270,7 @@ public final class AdempierePLAF
|
||||||
*/
|
*/
|
||||||
public static Font getFont_Small()
|
public static Font getFont_Small()
|
||||||
{
|
{
|
||||||
return CompiereTheme.smallFont;
|
return MetalLookAndFeel.getSubTextFont();
|
||||||
} // setFont_Small
|
} // setFont_Small
|
||||||
|
|
||||||
/****** Available L&F ****************************************************/
|
/****** Available L&F ****************************************************/
|
||||||
|
@ -247,20 +280,17 @@ public final class AdempierePLAF
|
||||||
/** Default PLAF */
|
/** Default PLAF */
|
||||||
private static ValueNamePair s_defaultPLAF = null;
|
private static ValueNamePair s_defaultPLAF = null;
|
||||||
/** Availablle Themes */
|
/** Availablle Themes */
|
||||||
private static ValueNamePair[] s_themes = null;
|
private static ValueNamePair[] s_metalThemes = null;
|
||||||
|
private static ValueNamePair[] s_plasticThemes = null;
|
||||||
|
|
||||||
private static ValueNamePair s_vp_adempiereTheme = null;
|
//default theme
|
||||||
|
private static ValueNamePair s_vp_compiereTheme = null;
|
||||||
private static ValueNamePair s_vp_metalTheme = null;
|
private static ValueNamePair s_vp_metalTheme = null;
|
||||||
private static ValueNamePair s_vp_kunststoffTheme = null;
|
private static ValueNamePair s_vp_plasticTheme = null;
|
||||||
//e-evolution vpj-cd 19102006
|
//e-evolution vpj-cd 19102006
|
||||||
private static ValueNamePair s_vp_jgoodiesTheme = null;
|
private static ValueNamePair s_vp_adempiereTheme = null;
|
||||||
//e-evolution vpj-cd 1910200sky
|
//e-evolution vpj-cd 1910200sky
|
||||||
|
|
||||||
/** PLAF class list
|
|
||||||
com.sun.java.swing.plaf.windows.WindowsLookAndFeel
|
|
||||||
com.sun.java.swing.plaf.motif.MotifLookAndFeel
|
|
||||||
javax.swing.plaf.metal.MetalLookAndFeel
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Static Initializer.
|
* Static Initializer.
|
||||||
* - Fill available PLAFs and Themes
|
* - Fill available PLAFs and Themes
|
||||||
|
@ -270,55 +300,50 @@ public final class AdempierePLAF
|
||||||
ArrayList<ValueNamePair> plafList = new ArrayList<ValueNamePair>();
|
ArrayList<ValueNamePair> plafList = new ArrayList<ValueNamePair>();
|
||||||
//e-evolution vpj-cd 19102006
|
//e-evolution vpj-cd 19102006
|
||||||
ValueNamePair vp = null;
|
ValueNamePair vp = null;
|
||||||
ArrayList<ValueNamePair> themeList = new ArrayList<ValueNamePair>();
|
ArrayList<ValueNamePair> metalThemes = new ArrayList<ValueNamePair>();
|
||||||
|
ArrayList<ValueNamePair> plasticThemes = new ArrayList<ValueNamePair>();
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Class c = Class.forName("com.jgoodies.looks.plastic.PlasticLookAndFeel");
|
Class c = Class.forName("com.jgoodies.looks.plastic.Plastic3DLookAndFeel");
|
||||||
vp = new ValueNamePair("org.adempiere.plaf.AdempiereLookAndFeel", org.adempiere.plaf.AdempiereLookAndFeel.NAME);
|
vp = new ValueNamePair("org.adempiere.plaf.AdempiereLookAndFeel", org.adempiere.plaf.AdempiereLookAndFeel.NAME);
|
||||||
plafList.add(vp);
|
plafList.add(vp);
|
||||||
s_vp_jgoodiesTheme = new ValueNamePair("org.compiere.plaf.AdempiereTheme", AdempiereThemeInnova.NAME);
|
s_vp_adempiereTheme = new ValueNamePair("org.adempiere.plaf.AdempiereTheme", AdempiereThemeInnova.NAME);
|
||||||
themeList.add (s_vp_jgoodiesTheme);
|
plasticThemes.add (s_vp_adempiereTheme);
|
||||||
|
|
||||||
|
c = Class.forName("com.jgoodies.looks.plastic.PlasticXPLookAndFeel");
|
||||||
|
vp = new ValueNamePair("com.jgoodies.looks.plastic.PlasticXPLookAndFeel", "Plastic");
|
||||||
|
plafList.add(vp);
|
||||||
|
MetalTheme theme = PlasticLookAndFeel.createMyDefaultTheme();
|
||||||
|
vp = new ValueNamePair(theme.getClass().getName(), theme.getName());
|
||||||
|
s_vp_plasticTheme = vp;
|
||||||
|
List installedThemes = PlasticLookAndFeel.getInstalledThemes();
|
||||||
|
for(Object t : installedThemes) {
|
||||||
|
theme = (MetalTheme)t;
|
||||||
|
vp = new ValueNamePair(theme.getClass().getName(), theme.getName());
|
||||||
|
plasticThemes.add(vp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
// log.severe("Kuststoff not found");
|
log.severe("Plastic look and feel not found");
|
||||||
}
|
}
|
||||||
//e-evolution vpj-cd 19102006
|
//e-evolution vpj-cd 19102006
|
||||||
//vpj-cd ValueNamePair vp = new ValueNamePair("org.compiere.plaf.CompiereLookAndFeel", CompiereLookAndFeel.NAME);
|
|
||||||
vp = new ValueNamePair("org.compiere.plaf.CompiereLookAndFeel", CompiereLookAndFeel.NAME);
|
vp = new ValueNamePair("org.compiere.plaf.CompiereLookAndFeel", CompiereLookAndFeel.NAME);
|
||||||
plafList.add (vp);
|
plafList.add (vp);
|
||||||
// Themes
|
s_vp_compiereTheme = new ValueNamePair("org.compiere.plaf.CompiereThemeBlueMetal", CompiereThemeBlueMetal.NAME);
|
||||||
//vpj-cd ArrayList<ValueNamePair> themeList = new ArrayList<ValueNamePair>();
|
metalThemes.add (s_vp_compiereTheme);
|
||||||
s_vp_adempiereTheme = new ValueNamePair("org.compiere.plaf.CompiereThemeBlueMetal", CompiereThemeBlueMetal.NAME);
|
metalThemes.add (new ValueNamePair("org.compiere.plaf.CompiereThemeIce", CompiereThemeIce.NAME));
|
||||||
themeList.add (s_vp_adempiereTheme);
|
|
||||||
themeList.add (new ValueNamePair("org.compiere.plaf.CompiereThemeIce", CompiereThemeIce.NAME));
|
|
||||||
// Metal
|
|
||||||
s_vp_metalTheme = new ValueNamePair("javax.swing.plaf.metal.DefaultMetalTheme", "Steel");
|
|
||||||
themeList.add (s_vp_metalTheme);
|
|
||||||
themeList.add (new ValueNamePair("javax.swing.plaf.metal.OceanTheme", "Ocean"));
|
|
||||||
// themeList.add (new ValueNamePair("javax.swing.plaf.metal.MetalHighContrastTheme", "Java High Contrast"));
|
|
||||||
//
|
|
||||||
themeList.add (new ValueNamePair("org.compiere.plaf.AquaTheme", "Aqua"));
|
|
||||||
themeList.add (new ValueNamePair("org.compiere.plaf.CharcoalTheme", "Charcoal"));
|
|
||||||
themeList.add (new ValueNamePair("org.compiere.plaf.ContrastTheme", "Contrast"));
|
|
||||||
themeList.add (new ValueNamePair("org.compiere.plaf.EmeraldTheme", "Emerald"));
|
|
||||||
themeList.add (new ValueNamePair("org.compiere.plaf.RubyTheme", "Ruby"));
|
|
||||||
|
|
||||||
// Discover and Install - Kuststoff
|
//Metal
|
||||||
try
|
s_vp_metalTheme = new ValueNamePair("javax.swing.plaf.metal.OceanTheme", "Ocean");
|
||||||
{
|
metalThemes.add (s_vp_metalTheme);
|
||||||
Class c = Class.forName("com.incors.plaf.kunststoff.KunststoffLookAndFeel");
|
metalThemes.add (new ValueNamePair("javax.swing.plaf.metal.DefaultMetalTheme", "Steel"));
|
||||||
vp = new ValueNamePair("com.incors.plaf.kunststoff.KunststoffLookAndFeel", "Kunststoff");
|
metalThemes.add (new ValueNamePair("org.compiere.plaf.AquaTheme", "Aqua"));
|
||||||
plafList.add(vp);
|
metalThemes.add (new ValueNamePair("org.compiere.plaf.CharcoalTheme", "Charcoal"));
|
||||||
vp = new ValueNamePair("com.incors.plaf.kunststoff.KunststoffTheme", "Kuststoff");
|
metalThemes.add (new ValueNamePair("org.compiere.plaf.ContrastTheme", "Contrast"));
|
||||||
themeList.add(vp);
|
metalThemes.add (new ValueNamePair("org.compiere.plaf.EmeraldTheme", "Emerald"));
|
||||||
s_vp_kunststoffTheme = vp;
|
metalThemes.add (new ValueNamePair("org.compiere.plaf.RubyTheme", "Ruby"));
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
// log.severe("Kuststoff not found");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Install discovered PLAFs
|
// Install discovered PLAFs
|
||||||
for (int i = 0; i < plafList.size(); i++)
|
for (int i = 0; i < plafList.size(); i++)
|
||||||
|
@ -334,10 +359,7 @@ public final class AdempierePLAF
|
||||||
{
|
{
|
||||||
vp = new ValueNamePair (lfInfo[i].getClassName(), lfInfo[i].getName());
|
vp = new ValueNamePair (lfInfo[i].getClassName(), lfInfo[i].getName());
|
||||||
plafList.add(vp);
|
plafList.add(vp);
|
||||||
//begin vpj-cd e-evolution 26 oct 2006
|
|
||||||
//if (lfInfo[i].getName().equals(CompiereLookAndFeel.NAME))
|
|
||||||
if (lfInfo[i].getName().equals(org.adempiere.plaf.AdempiereLookAndFeel.NAME))
|
if (lfInfo[i].getName().equals(org.adempiere.plaf.AdempiereLookAndFeel.NAME))
|
||||||
//end vpj-cd e-evolution 26 oct 2006
|
|
||||||
{
|
{
|
||||||
s_defaultPLAF = vp;
|
s_defaultPLAF = vp;
|
||||||
log.finest(vp.getName() + " (default)");
|
log.finest(vp.getName() + " (default)");
|
||||||
|
@ -349,8 +371,11 @@ public final class AdempierePLAF
|
||||||
plafList.toArray(s_looks);
|
plafList.toArray(s_looks);
|
||||||
|
|
||||||
// Fill Available Themes
|
// Fill Available Themes
|
||||||
s_themes = new ValueNamePair[themeList.size()];
|
s_metalThemes = new ValueNamePair[metalThemes.size()];
|
||||||
themeList.toArray(s_themes);
|
metalThemes.toArray(s_metalThemes);
|
||||||
|
|
||||||
|
s_plasticThemes = new ValueNamePair[plasticThemes.size()];
|
||||||
|
plasticThemes.toArray(s_plasticThemes);
|
||||||
//
|
//
|
||||||
// printPLAFDefaults();
|
// printPLAFDefaults();
|
||||||
} // static Initializer
|
} // static Initializer
|
||||||
|
@ -366,22 +391,24 @@ public final class AdempierePLAF
|
||||||
} // getPLAFs
|
} // getPLAFs
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the list of available Metal Themes if the current L&F is a Metal L&F
|
* Get the list of available Metal or Plastic Themes.
|
||||||
* @return Array of Strings with Names of Metal Themes
|
* @return Array of Strings with Names of Metal Themes
|
||||||
*/
|
*/
|
||||||
public static ValueNamePair[] getThemes ()
|
public static ValueNamePair[] getThemes ()
|
||||||
{
|
{
|
||||||
if (UIManager.getLookAndFeel() instanceof MetalLookAndFeel)
|
LookAndFeel l = UIManager.getLookAndFeel();
|
||||||
return s_themes;
|
if ( l instanceof PlasticLookAndFeel)
|
||||||
|
return s_plasticThemes;
|
||||||
|
else if ( l instanceof MetalLookAndFeel)
|
||||||
|
return s_metalThemes;
|
||||||
return new ValueNamePair[0];
|
return new ValueNamePair[0];
|
||||||
} // getThemes
|
} // getThemes
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* Set PLAF based on Ini Properties
|
* Set PLAF based on Ini Properties
|
||||||
* @param win Optional Window
|
|
||||||
*/
|
*/
|
||||||
public static void setPLAF (Window win)
|
public static void setPLAF ()
|
||||||
{
|
{
|
||||||
String look = Ini.getProperty(Ini.P_UI_LOOK);
|
String look = Ini.getProperty(Ini.P_UI_LOOK);
|
||||||
String lookTheme = Ini.getProperty(Ini.P_UI_THEME);
|
String lookTheme = Ini.getProperty(Ini.P_UI_THEME);
|
||||||
|
@ -397,16 +424,28 @@ public final class AdempierePLAF
|
||||||
}
|
}
|
||||||
// Search for Theme
|
// Search for Theme
|
||||||
ValueNamePair theme = null;
|
ValueNamePair theme = null;
|
||||||
for (int i = 0; i < s_themes.length; i++)
|
for (int i = 0; i < s_metalThemes.length; i++)
|
||||||
{
|
{
|
||||||
if (s_themes[i].getName().equals(lookTheme))
|
if (s_metalThemes[i].getName().equals(lookTheme))
|
||||||
{
|
{
|
||||||
theme = s_themes[i];
|
theme = s_metalThemes[i];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (theme == null)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < s_plasticThemes.length; i++)
|
||||||
|
{
|
||||||
|
if (s_plasticThemes[i].getName().equals(lookTheme))
|
||||||
|
{
|
||||||
|
theme = s_plasticThemes[i];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
// Set PLAF
|
// Set PLAF
|
||||||
setPLAF (plaf == null ? s_defaultPLAF : plaf, theme, win);
|
setPLAF (plaf == null ? s_defaultPLAF : plaf, theme, true);
|
||||||
} // setPLAF
|
} // setPLAF
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -414,58 +453,66 @@ public final class AdempierePLAF
|
||||||
*
|
*
|
||||||
* @param plaf ValueNamePair of the PLAF to be set
|
* @param plaf ValueNamePair of the PLAF to be set
|
||||||
* @param theme Optional Theme name
|
* @param theme Optional Theme name
|
||||||
* @param win Optional Window
|
* @param upateIni Update setting to INI
|
||||||
*/
|
*/
|
||||||
public static void setPLAF (ValueNamePair plaf, ValueNamePair theme, Window win)
|
public static void setPLAF (ValueNamePair plaf, ValueNamePair theme, boolean updateIni)
|
||||||
{
|
{
|
||||||
if (plaf == null)
|
if (plaf == null)
|
||||||
return;
|
return;
|
||||||
log.config(plaf + (theme == null ? "" : (" - " + theme)));
|
log.config(plaf + (theme == null ? "" : (" - " + theme)));
|
||||||
|
|
||||||
// Look & Feel
|
// Look & Feel
|
||||||
try
|
Class lafClass = null;
|
||||||
{
|
try {
|
||||||
UIManager.setLookAndFeel(plaf.getValue());
|
lafClass = Class.forName(plaf.getValue());
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
log.severe(e.getMessage());
|
log.severe(e.getMessage());
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
LookAndFeel laf = UIManager.getLookAndFeel();
|
|
||||||
Ini.setProperty(Ini.P_UI_LOOK, plaf.getName());
|
|
||||||
|
|
||||||
|
if ( updateIni ) {
|
||||||
|
Ini.setProperty(Ini.P_UI_LOOK, plaf.getName());
|
||||||
// Optional Theme
|
// Optional Theme
|
||||||
Ini.setProperty(Ini.P_UI_THEME, "");
|
Ini.setProperty(Ini.P_UI_THEME, "");
|
||||||
// Default Theme
|
|
||||||
if (theme == null && laf instanceof MetalLookAndFeel)
|
|
||||||
{
|
|
||||||
String className = laf.getClass().getName();
|
|
||||||
if (className.equals("javax.swing.plaf.metal.MetalLookAndFeel"))
|
|
||||||
theme = s_vp_metalTheme;
|
|
||||||
else if (className.equals("org.compiere.plaf.CompiereLookAndFeel"))
|
|
||||||
theme = s_vp_adempiereTheme;
|
|
||||||
else if (className.equals("com.incors.plaf.kunststoff.KunststoffLookAndFeel"))
|
|
||||||
theme = s_vp_kunststoffTheme;
|
|
||||||
//e-evolution vpj-cd
|
|
||||||
else if (className.equals("org.adempiere.plaf.AdempiereLookAndFeel"))
|
|
||||||
theme = s_vp_jgoodiesTheme;
|
|
||||||
//e-evolution vpj-cd
|
|
||||||
}
|
}
|
||||||
if (theme != null && laf instanceof MetalLookAndFeel && theme.getValue().length() > 0)
|
|
||||||
|
// Default Theme
|
||||||
|
boolean metal = MetalLookAndFeel.class.isAssignableFrom(lafClass);
|
||||||
|
boolean plastic = PlasticLookAndFeel.class.isAssignableFrom(lafClass);
|
||||||
|
boolean adempiere = AdempiereLookAndFeel.class.isAssignableFrom(lafClass);
|
||||||
|
boolean compiere = CompiereLookAndFeel.class.isAssignableFrom(lafClass);
|
||||||
|
if (theme == null && metal)
|
||||||
|
{
|
||||||
|
if (compiere)
|
||||||
|
theme = s_vp_compiereTheme;
|
||||||
|
else if (adempiere)
|
||||||
|
theme = s_vp_adempiereTheme;
|
||||||
|
else if (plastic)
|
||||||
|
theme = s_vp_plasticTheme;
|
||||||
|
else
|
||||||
|
theme = s_vp_metalTheme;
|
||||||
|
}
|
||||||
|
if (theme != null && metal && theme.getValue().length() > 0)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Class c = Class.forName(theme.getValue());
|
Class c = Class.forName(theme.getValue());
|
||||||
MetalTheme t = (MetalTheme)c.newInstance();
|
MetalTheme t = (MetalTheme)c.newInstance();
|
||||||
if (t instanceof CompiereTheme)
|
if (compiere)
|
||||||
AdempiereThemeInnova.load();
|
|
||||||
if (laf instanceof CompiereLookAndFeel)
|
|
||||||
CompiereLookAndFeel.setCurrentTheme(t);
|
CompiereLookAndFeel.setCurrentTheme(t);
|
||||||
else
|
else if (adempiere)
|
||||||
|
AdempiereLookAndFeel.setCurrentTheme(t);
|
||||||
|
else {
|
||||||
|
if (plastic && t instanceof PlasticTheme) {
|
||||||
|
PlasticLookAndFeel.setPlasticTheme((PlasticTheme)t);
|
||||||
|
} else {
|
||||||
MetalLookAndFeel.setCurrentTheme(t);
|
MetalLookAndFeel.setCurrentTheme(t);
|
||||||
|
}
|
||||||
|
}
|
||||||
//
|
//
|
||||||
boolean flat = Ini.isPropertyBool(Ini.P_UI_FLAT);
|
if (updateIni)
|
||||||
CompiereTheme.setTheme(t, flat); // copies it if not AdempiereTheme
|
|
||||||
Ini.setProperty(Ini.P_UI_THEME, theme.getName());
|
Ini.setProperty(Ini.P_UI_THEME, theme.getName());
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
|
@ -473,7 +520,14 @@ public final class AdempierePLAF
|
||||||
log.severe("Theme - " + e.getMessage());
|
log.severe("Theme - " + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
updateUI (win);
|
try
|
||||||
|
{
|
||||||
|
UIManager.setLookAndFeel((LookAndFeel)lafClass.newInstance());
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
log.severe(e.getMessage());
|
||||||
|
}
|
||||||
log.config(plaf + " - " + theme);
|
log.config(plaf + " - " + theme);
|
||||||
// printPLAFDefaults();
|
// printPLAFDefaults();
|
||||||
} // setPLAF
|
} // setPLAF
|
||||||
|
@ -501,13 +555,11 @@ public final class AdempierePLAF
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reset PLAF Settings
|
* Reset PLAF Settings
|
||||||
* @param win Window to be reset
|
|
||||||
*/
|
*/
|
||||||
public static void reset (Window win)
|
public static void reset ()
|
||||||
{
|
{
|
||||||
// Clean Theme Properties
|
// Clean Theme Properties
|
||||||
AdempiereThemeInnova.reset (); // sets properties
|
AdempierePLAF.setPLAF ();
|
||||||
AdempierePLAF.setPLAF (win);
|
|
||||||
} // reset
|
} // reset
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -538,7 +590,7 @@ public final class AdempierePLAF
|
||||||
*/
|
*/
|
||||||
public static boolean isActive()
|
public static boolean isActive()
|
||||||
{
|
{
|
||||||
return UIManager.getLookAndFeel() instanceof CompiereLookAndFeel;
|
return UIManager.getLookAndFeel() instanceof AdempiereLookAndFeel;
|
||||||
} // isActive
|
} // isActive
|
||||||
|
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
@ -585,9 +637,29 @@ public final class AdempierePLAF
|
||||||
window.setVisible(true);
|
window.setVisible(true);
|
||||||
} // showCenterScreen
|
} // showCenterScreen
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Invoke the correct method to set current metal based theme.
|
||||||
|
* Supported look and feel are Metal, Plastic and Compiere.
|
||||||
|
* @param laf Metal based look and feel
|
||||||
|
* @param theme Metal based theme
|
||||||
|
*/
|
||||||
|
public static void setCurrentMetalTheme(MetalLookAndFeel laf, MetalTheme theme)
|
||||||
|
{
|
||||||
|
if (laf instanceof CompiereLookAndFeel)
|
||||||
|
CompiereLookAndFeel.setCurrentTheme(theme);
|
||||||
|
else if (laf instanceof AdempiereLookAndFeel)
|
||||||
|
AdempiereLookAndFeel.setCurrentTheme(theme);
|
||||||
|
else {
|
||||||
|
if (laf instanceof PlasticLookAndFeel && theme instanceof PlasticTheme) {
|
||||||
|
PlasticLookAndFeel.setPlasticTheme((PlasticTheme)theme);
|
||||||
|
} else {
|
||||||
|
MetalLookAndFeel.setCurrentTheme(theme);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* Start Class With Adempiere Look or Adempiere PLAF Editor
|
* Start Class With Adempiere Look
|
||||||
* @param args first parameter is class to start, if none start PLAF Editor
|
* @param args first parameter is class to start, if none start PLAF Editor
|
||||||
*/
|
*/
|
||||||
public static void main (String[] args)
|
public static void main (String[] args)
|
||||||
|
@ -604,12 +676,10 @@ public final class AdempierePLAF
|
||||||
|
|
||||||
// set the defined PLAF
|
// set the defined PLAF
|
||||||
Ini.loadProperties (true);
|
Ini.loadProperties (true);
|
||||||
AdempiereThemeInnova.load ();
|
setPLAF ();
|
||||||
setPLAF (null);
|
|
||||||
//
|
//
|
||||||
if (args.length == 0)
|
if (args.length == 0)
|
||||||
{
|
{
|
||||||
AdempierePLAFFrame frame = new AdempierePLAFFrame();
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -663,34 +733,3 @@ public final class AdempierePLAF
|
||||||
} // main
|
} // main
|
||||||
|
|
||||||
} // AdempierePLAF
|
} // AdempierePLAF
|
||||||
|
|
||||||
/**
|
|
||||||
* Frame to display Editor
|
|
||||||
*/
|
|
||||||
class AdempierePLAFFrame extends CFrame
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Frame to display Editor
|
|
||||||
*/
|
|
||||||
public AdempierePLAFFrame()
|
|
||||||
{
|
|
||||||
super("AdempierePLAF");
|
|
||||||
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
|
||||||
setIconImage(Toolkit.getDefaultToolkit().getImage(AdempierePLAF.class.getResource("icons/CL16.gif")));
|
|
||||||
AdempierePLAF.showCenterScreen(this);
|
|
||||||
} // AdempierePLAFFrame
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Show Editor
|
|
||||||
* @param e event
|
|
||||||
*/
|
|
||||||
protected void processWindowEvent (WindowEvent e)
|
|
||||||
{
|
|
||||||
super.processWindowEvent(e);
|
|
||||||
if (e.getID() == WindowEvent.WINDOW_OPENED)
|
|
||||||
{
|
|
||||||
AdempierePLAFEditor ed = new AdempierePLAFEditor(this, true);
|
|
||||||
dispose();
|
|
||||||
}
|
|
||||||
} // processWindowEvents
|
|
||||||
} // AdempierePLAFFrame
|
|
|
@ -11,6 +11,8 @@ import javax.swing.plaf.ColorUIResource;
|
||||||
import javax.swing.plaf.FontUIResource;
|
import javax.swing.plaf.FontUIResource;
|
||||||
|
|
||||||
//import org.compiere.plaf.ColorBlind;
|
//import org.compiere.plaf.ColorBlind;
|
||||||
|
import org.compiere.swing.ColorBlind;
|
||||||
|
import org.compiere.swing.ExtendedTheme;
|
||||||
import org.compiere.util.Ini;
|
import org.compiere.util.Ini;
|
||||||
|
|
||||||
import com.jgoodies.looks.plastic.PlasticScrollBarUI;
|
import com.jgoodies.looks.plastic.PlasticScrollBarUI;
|
||||||
|
@ -25,7 +27,7 @@ import com.jgoodies.looks.plastic.theme.*;
|
||||||
* @author vpj-cd
|
* @author vpj-cd
|
||||||
* @version $Revision: 1.0 $
|
* @version $Revision: 1.0 $
|
||||||
*/
|
*/
|
||||||
public class AdempiereTheme extends com.jgoodies.looks.plastic.theme.DesertBluer {
|
public class AdempiereTheme extends com.jgoodies.looks.plastic.PlasticTheme {
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -55,47 +57,6 @@ public class AdempiereTheme extends com.jgoodies.looks.plastic.theme.DesertBluer
|
||||||
s_theme = new org.adempiere.plaf.AdempiereTheme();
|
s_theme = new org.adempiere.plaf.AdempiereTheme();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Set Theme to current Metal Theme and copy it
|
|
||||||
*/
|
|
||||||
public static void setTheme ()
|
|
||||||
{
|
|
||||||
log.fine("");
|
|
||||||
org.adempiere.plaf.AdempiereTheme copyFrom = new org.adempiere.plaf.AdempiereTheme();
|
|
||||||
boolean flat = Ini.isPropertyBool(Ini.P_UI_FLAT);
|
|
||||||
setTheme (copyFrom, flat);
|
|
||||||
} // setTheme
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set Theme to current Metal Theme and copy it
|
|
||||||
* @param copyFrom theme
|
|
||||||
* @param flat flat colors
|
|
||||||
*/
|
|
||||||
public static void setTheme (org.adempiere.plaf.AdempiereTheme copyFrom, boolean flat)
|
|
||||||
{
|
|
||||||
if (copyFrom == null || copyFrom instanceof org.adempiere.plaf.AdempiereTheme)
|
|
||||||
return;
|
|
||||||
log.fine(copyFrom.getName() + " - Flat=" + flat);
|
|
||||||
// May not be correct, if Themes overwrites default methods
|
|
||||||
primary1 = copyFrom.getPrimaryControlDarkShadow();
|
|
||||||
primary2 = copyFrom.getPrimaryControlShadow();
|
|
||||||
primary3 = copyFrom.getPrimaryControl();
|
|
||||||
secondary1 = copyFrom.getControlDarkShadow();
|
|
||||||
secondary2 = copyFrom.getControlShadow();
|
|
||||||
secondary3 = copyFrom.getControl();
|
|
||||||
org.compiere.plaf.AdempierePanelUI.setDefaultBackground(new org.compiere.plaf.AdempiereColor(secondary3, flat));
|
|
||||||
white = copyFrom.getPrimaryControlHighlight();
|
|
||||||
black = copyFrom.getPrimaryControlInfo();
|
|
||||||
//
|
|
||||||
controlFont = copyFrom.getControlTextFont();
|
|
||||||
systemFont = copyFrom.getSystemTextFont();
|
|
||||||
userFont = copyFrom.getUserTextFont();
|
|
||||||
smallFont = copyFrom.getSubTextFont();
|
|
||||||
menuFont = copyFrom.getMenuTextFont();
|
|
||||||
windowFont = copyFrom.getWindowTitleFont();
|
|
||||||
} // setTheme
|
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
/** Theme Name */
|
/** Theme Name */
|
||||||
protected static String s_name = "Adempiere Theme";
|
protected static String s_name = "Adempiere Theme";
|
||||||
|
@ -173,15 +134,15 @@ public class AdempiereTheme extends com.jgoodies.looks.plastic.theme.DesertBluer
|
||||||
*/
|
*/
|
||||||
public ColorUIResource getPrimary1()
|
public ColorUIResource getPrimary1()
|
||||||
{
|
{
|
||||||
return AdempiereColorBlind.getDichromatColorUIResource(primary1);
|
return ColorBlind.getDichromatColorUIResource(primary1);
|
||||||
}
|
}
|
||||||
public ColorUIResource getPrimary2()
|
public ColorUIResource getPrimary2()
|
||||||
{
|
{
|
||||||
return AdempiereColorBlind.getDichromatColorUIResource(primary2);
|
return ColorBlind.getDichromatColorUIResource(primary2);
|
||||||
}
|
}
|
||||||
public ColorUIResource getPrimary3()
|
public ColorUIResource getPrimary3()
|
||||||
{
|
{
|
||||||
return AdempiereColorBlind.getDichromatColorUIResource(primary3);
|
return ColorBlind.getDichromatColorUIResource(primary3);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -190,32 +151,32 @@ public class AdempiereTheme extends com.jgoodies.looks.plastic.theme.DesertBluer
|
||||||
*/
|
*/
|
||||||
public ColorUIResource getSecondary0()
|
public ColorUIResource getSecondary0()
|
||||||
{
|
{
|
||||||
return AdempiereColorBlind.getDichromatColorUIResource(secondary0);
|
return ColorBlind.getDichromatColorUIResource(secondary0);
|
||||||
}
|
}
|
||||||
public ColorUIResource getSecondary1()
|
public ColorUIResource getSecondary1()
|
||||||
{
|
{
|
||||||
return AdempiereColorBlind.getDichromatColorUIResource(secondary1);
|
return ColorBlind.getDichromatColorUIResource(secondary1);
|
||||||
}
|
}
|
||||||
public ColorUIResource getSecondary2()
|
public ColorUIResource getSecondary2()
|
||||||
{
|
{
|
||||||
return AdempiereColorBlind.getDichromatColorUIResource(secondary2);
|
return ColorBlind.getDichromatColorUIResource(secondary2);
|
||||||
}
|
}
|
||||||
public ColorUIResource getSecondary3()
|
public ColorUIResource getSecondary3()
|
||||||
{
|
{
|
||||||
return AdempiereColorBlind.getDichromatColorUIResource(secondary3);
|
return ColorBlind.getDichromatColorUIResource(secondary3);
|
||||||
}
|
}
|
||||||
public ColorUIResource getSecondary4()
|
public ColorUIResource getSecondary4()
|
||||||
{
|
{
|
||||||
return AdempiereColorBlind.getDichromatColorUIResource(secondary4);
|
return ColorBlind.getDichromatColorUIResource(secondary4);
|
||||||
}
|
}
|
||||||
|
|
||||||
public ColorUIResource getBlack()
|
public ColorUIResource getBlack()
|
||||||
{
|
{
|
||||||
return AdempiereColorBlind.getDichromatColorUIResource(black);
|
return ColorBlind.getDichromatColorUIResource(black);
|
||||||
}
|
}
|
||||||
public ColorUIResource getWhite()
|
public ColorUIResource getWhite()
|
||||||
{
|
{
|
||||||
return AdempiereColorBlind.getDichromatColorUIResource(white);
|
return ColorBlind.getDichromatColorUIResource(white);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -350,65 +311,6 @@ public class AdempiereTheme extends com.jgoodies.looks.plastic.theme.DesertBluer
|
||||||
}
|
}
|
||||||
public FontUIResource getSubTextFont() {return _getSubTextFont();}
|
public FontUIResource getSubTextFont() {return _getSubTextFont();}
|
||||||
|
|
||||||
// Static property info
|
|
||||||
|
|
||||||
private static final String P_Primary1 = "#ColorPrimary1";
|
|
||||||
private static final String P_Primary2 = "#ColorPrimary2";
|
|
||||||
private static final String P_Primary3 = "#ColorPrimary3";
|
|
||||||
private static final String P_Secondary1 = "#ColorSecondary1";
|
|
||||||
private static final String P_Secondary2 = "#ColorSecondary2";
|
|
||||||
private static final String P_Secondary3 = "#ColorSecondary3";
|
|
||||||
private static final String P_Black = "#ColorBlack";
|
|
||||||
private static final String P_White = "#ColorWhite";
|
|
||||||
private static final String P_Error = "#ColorError";
|
|
||||||
private static final String P_Info = "#ColorInfo";
|
|
||||||
private static final String P_Mandatory = "#ColorMandatory";
|
|
||||||
private static final String P_Inactive = "#ColorInactive";
|
|
||||||
private static final String P_Txt_OK = "#ColorTextOK";
|
|
||||||
private static final String P_Txt_Error = "#ColorTextError";
|
|
||||||
//
|
|
||||||
private static final String P_Control = "#FontControl";
|
|
||||||
private static final String P_System = "#FontSystem";
|
|
||||||
private static final String P_User = "#FontUser";
|
|
||||||
private static final String P_Small = "#FontSmall";
|
|
||||||
private static final String P_Window = "#FontWindow";
|
|
||||||
private static final String P_Menu = "#FontMenu";
|
|
||||||
/** Background Color */
|
|
||||||
protected static final String P_AdempiereColor = "#AdempiereColor";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Save information in Properties
|
|
||||||
*/
|
|
||||||
public static void save ()
|
|
||||||
{
|
|
||||||
//log.config(AdempiereColor.getDefaultBackground().toString());
|
|
||||||
//
|
|
||||||
Ini.setProperty(P_Primary1, getColorAsString(primary1));
|
|
||||||
Ini.setProperty(P_Primary2, getColorAsString(primary2));
|
|
||||||
Ini.setProperty(P_Primary3, getColorAsString(primary3));
|
|
||||||
Ini.setProperty(P_Secondary1, getColorAsString(secondary1));
|
|
||||||
Ini.setProperty(P_Secondary2, getColorAsString(secondary2));
|
|
||||||
Ini.setProperty(P_Secondary3, getColorAsString(secondary3));
|
|
||||||
Ini.setProperty(P_Error, getColorAsString(error));
|
|
||||||
Ini.setProperty(P_Info, getColorAsString(info));
|
|
||||||
Ini.setProperty(P_Mandatory, getColorAsString(mandatory));
|
|
||||||
Ini.setProperty(P_Inactive, getColorAsString(inactive));
|
|
||||||
Ini.setProperty(P_White, getColorAsString(white));
|
|
||||||
Ini.setProperty(P_Black, getColorAsString(black));
|
|
||||||
Ini.setProperty(P_Txt_OK, getColorAsString(txt_ok));
|
|
||||||
Ini.setProperty(P_Txt_Error, getColorAsString(txt_error));
|
|
||||||
//
|
|
||||||
Ini.setProperty(P_Control, ((Font)controlFont).toString());
|
|
||||||
Ini.setProperty(P_System, ((Font)systemFont).toString());
|
|
||||||
Ini.setProperty(P_User, ((Font)userFont).toString());
|
|
||||||
Ini.setProperty(P_Small, ((Font)smallFont).toString());
|
|
||||||
Ini.setProperty(P_Window, ((Font)windowFont).toString());
|
|
||||||
Ini.setProperty(P_Menu, ((Font)menuFont).toString());
|
|
||||||
//
|
|
||||||
//AdempiereColor cc = org.adempiere.plaf.AdempiereColor.getDefaultBackground();
|
|
||||||
//Ini.setProperty(P_CompiereColor, cc.toString());
|
|
||||||
} // save
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parses Color into String representation.
|
* Parses Color into String representation.
|
||||||
* Required as SystemColors and Alpha Colors have different formats
|
* Required as SystemColors and Alpha Colors have different formats
|
||||||
|
@ -429,37 +331,6 @@ public class AdempiereTheme extends com.jgoodies.looks.plastic.theme.DesertBluer
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
} // getColorAsString
|
} // getColorAsString
|
||||||
|
|
||||||
/**
|
|
||||||
* Load Properties from Ini
|
|
||||||
*/
|
|
||||||
public static void load ()
|
|
||||||
{
|
|
||||||
primary1 = parseColor (Ini.getProperty(P_Primary1), primary1);
|
|
||||||
primary2 = parseColor (Ini.getProperty(P_Primary2), primary2);
|
|
||||||
primary3 = parseColor (Ini.getProperty(P_Primary3), primary3);
|
|
||||||
secondary1 = parseColor (Ini.getProperty(P_Secondary1), secondary1);
|
|
||||||
secondary2 = parseColor (Ini.getProperty(P_Secondary2), secondary2);
|
|
||||||
secondary3 = parseColor (Ini.getProperty(P_Secondary3), secondary3);
|
|
||||||
error = parseColor(Ini.getProperty(P_Error), error);
|
|
||||||
info = parseColor(Ini.getProperty(P_Info), info);
|
|
||||||
mandatory = parseColor(Ini.getProperty(P_Mandatory), mandatory);
|
|
||||||
inactive = parseColor(Ini.getProperty(P_Inactive), inactive);
|
|
||||||
white = parseColor(Ini.getProperty(P_White), white);
|
|
||||||
black = parseColor(Ini.getProperty(P_Black), black);
|
|
||||||
txt_ok = parseColor(Ini.getProperty(P_Txt_OK), txt_ok);
|
|
||||||
txt_error = parseColor(Ini.getProperty(P_Txt_Error), txt_error);
|
|
||||||
//
|
|
||||||
controlFont = parseFont(Ini.getProperty(P_Control), controlFont);
|
|
||||||
systemFont = parseFont(Ini.getProperty(P_System), systemFont);
|
|
||||||
userFont = parseFont(Ini.getProperty(P_User), userFont);
|
|
||||||
smallFont = parseFont(Ini.getProperty(P_Small), smallFont);
|
|
||||||
windowFont = parseFont(Ini.getProperty(P_Window), windowFont);
|
|
||||||
menuFont = parseFont(Ini.getProperty(P_Menu), menuFont);
|
|
||||||
//
|
|
||||||
//AdempiereColor cc = AdempiereColor.parse(Ini.getProperty(P_AdempiereColor));
|
|
||||||
//AdempiereColor.setDefaultBackground(cc);
|
|
||||||
} // load
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set Default Colors
|
* Set Default Colors
|
||||||
*/
|
*/
|
||||||
|
@ -467,132 +338,6 @@ public class AdempiereTheme extends com.jgoodies.looks.plastic.theme.DesertBluer
|
||||||
{
|
{
|
||||||
} // setDefault
|
} // setDefault
|
||||||
|
|
||||||
/**
|
|
||||||
* Reset Info in Properties
|
|
||||||
*/
|
|
||||||
public static void reset ()
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
Ini.remove (P_Primary1);
|
|
||||||
Ini.remove (P_Primary2);
|
|
||||||
Ini.remove (P_Primary3);
|
|
||||||
Ini.remove (P_Secondary1);
|
|
||||||
Ini.remove (P_Secondary2);
|
|
||||||
Ini.remove (P_Secondary3);
|
|
||||||
Ini.remove (P_Error);
|
|
||||||
Ini.remove (P_Info);
|
|
||||||
Ini.remove (P_Mandatory);
|
|
||||||
Ini.remove (P_Inactive);
|
|
||||||
Ini.remove (P_White);
|
|
||||||
Ini.remove (P_Black);
|
|
||||||
Ini.remove (P_Txt_OK);
|
|
||||||
Ini.remove (P_Txt_Error);
|
|
||||||
//
|
|
||||||
Ini.remove (P_Control);
|
|
||||||
Ini.remove (P_System);
|
|
||||||
Ini.remove (P_User);
|
|
||||||
Ini.remove (P_Small);
|
|
||||||
Ini.remove (P_Window);
|
|
||||||
Ini.remove (P_Menu);
|
|
||||||
// CompiereColor
|
|
||||||
Ini.remove(P_CompiereColor);
|
|
||||||
**/
|
|
||||||
// Initialize
|
|
||||||
Ini.setProperty(Ini.P_UI_LOOK, org.adempiere.plaf.AdempiereLookAndFeel.NAME);
|
|
||||||
Ini.setProperty(Ini.P_UI_THEME, s_name);
|
|
||||||
//
|
|
||||||
if (s_theme != null)
|
|
||||||
s_theme.setDefault();
|
|
||||||
|
|
||||||
// Background
|
|
||||||
// CompiereColor cc = new CompiereColor(SystemColor.control); // flat Windows 212-208-200
|
|
||||||
// CompiereColor cc = new CompiereColor(secondary3); // flat Metal 204-204-204
|
|
||||||
//AdempiereColor cc = new AdempiereColor(secondary3, false);
|
|
||||||
//AdempiereColor.setDefaultBackground (cc);
|
|
||||||
//
|
|
||||||
save(); // save properties
|
|
||||||
} // reset
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Parse Color.
|
|
||||||
* <p>
|
|
||||||
* Color - [r=102,g=102,b=153,a=0]
|
|
||||||
*
|
|
||||||
* @param information string information to be parsed
|
|
||||||
* @param stdColor color used if info cannot parsed
|
|
||||||
* @return color
|
|
||||||
* @see #getColorAsString
|
|
||||||
*/
|
|
||||||
protected static ColorUIResource parseColor (String information, ColorUIResource stdColor)
|
|
||||||
{
|
|
||||||
if (information == null
|
|
||||||
|| information.length() == 0
|
|
||||||
|| information.trim().length() == 0)
|
|
||||||
return stdColor;
|
|
||||||
// System.out.print("ParseColor=" + info);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
int r = Integer.parseInt(information.substring(information.indexOf("r=")+2, information.indexOf(",g=")));
|
|
||||||
int g = Integer.parseInt(information.substring(information.indexOf("g=")+2, information.indexOf(",b=")));
|
|
||||||
int b = 0;
|
|
||||||
int a = 255;
|
|
||||||
if (information.indexOf("a=") == -1)
|
|
||||||
b = Integer.parseInt(information.substring(information.indexOf("b=")+2, information.indexOf("]")));
|
|
||||||
else
|
|
||||||
{
|
|
||||||
b = Integer.parseInt(information.substring(information.indexOf("b=")+2, information.indexOf(",a=")));
|
|
||||||
a = Integer.parseInt(information.substring(information.indexOf("a=")+2, information.indexOf("]")));
|
|
||||||
}
|
|
||||||
ColorUIResource retValue = new ColorUIResource(new Color(r, g, b, a));
|
|
||||||
// System.out.println(" - " + retValue.toString());
|
|
||||||
return retValue;
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
log.config(information + " - cannot parse: " + e.toString());
|
|
||||||
}
|
|
||||||
return stdColor;
|
|
||||||
} // parseColor
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Parse Font
|
|
||||||
* <p>
|
|
||||||
* javax.swing.plaf.FontUIResource[family=dialog.bold,name=Dialog,style=bold,size=12]
|
|
||||||
*
|
|
||||||
* @param information string information to be parsed
|
|
||||||
* @param stdFont font used if info cannot be parsed
|
|
||||||
* @return font
|
|
||||||
*/
|
|
||||||
private static FontUIResource parseFont(String information, FontUIResource stdFont)
|
|
||||||
{
|
|
||||||
if (information == null
|
|
||||||
|| information.length() == 0
|
|
||||||
|| information.trim().length() == 0)
|
|
||||||
return stdFont;
|
|
||||||
// System.out.print("ParseFont=" + info);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
String name = information.substring(information.indexOf("name=")+5, information.indexOf(",style="));
|
|
||||||
String s = information.substring(information.indexOf("style=")+6, information.indexOf(",size="));
|
|
||||||
int style = Font.PLAIN;
|
|
||||||
if (s.equals("bold"))
|
|
||||||
style = Font.BOLD;
|
|
||||||
else if (s.equals("italic"))
|
|
||||||
style = Font.ITALIC;
|
|
||||||
else if (s.equals("bolditalic"))
|
|
||||||
style = Font.BOLD | Font.ITALIC;
|
|
||||||
int size = Integer.parseInt(information.substring(information.indexOf(",size=")+6, information.lastIndexOf("]")));
|
|
||||||
FontUIResource retValue = new FontUIResource(name,style,size);
|
|
||||||
// System.out.println(" - " + retValue.toString());
|
|
||||||
return retValue;
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
log.config(information + " - cannot parse: " + e.toString());
|
|
||||||
}
|
|
||||||
return stdFont;
|
|
||||||
} // parseFont
|
|
||||||
|
|
||||||
//-----------------------------------------------------
|
//-----------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
|
@ -630,9 +375,17 @@ public class AdempiereTheme extends com.jgoodies.looks.plastic.theme.DesertBluer
|
||||||
PlasticScrollBarUI.MAX_BUMPS_WIDTH_KEY, new Integer(30),
|
PlasticScrollBarUI.MAX_BUMPS_WIDTH_KEY, new Integer(30),
|
||||||
//"TabbedPane.selected", getWhite(),
|
//"TabbedPane.selected", getWhite(),
|
||||||
"TabbedPane.selectHighlight", new ColorUIResource(231, 218, 188),
|
"TabbedPane.selectHighlight", new ColorUIResource(231, 218, 188),
|
||||||
|
ExtendedTheme.ERROR_BG_KEY,
|
||||||
|
error,
|
||||||
|
ExtendedTheme.ERROR_FG_KEY,
|
||||||
|
txt_error,
|
||||||
|
ExtendedTheme.INACTIVE_BG_KEY,
|
||||||
|
inactive,
|
||||||
|
ExtendedTheme.INFO_BG_KEY,
|
||||||
|
info,
|
||||||
|
ExtendedTheme.MANDATORY_BG_KEY,
|
||||||
|
mandatory
|
||||||
};
|
};
|
||||||
|
|
||||||
table.putDefaults(uiDefaults);
|
table.putDefaults(uiDefaults);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||||
* or via info@compiere.org or http://www.compiere.org/license.html *
|
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
package org.compiere.plaf;
|
package org.adempiere.plaf;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import javax.swing.plaf.*;
|
import javax.swing.plaf.*;
|
|
@ -14,7 +14,7 @@
|
||||||
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||||
* or via info@compiere.org or http://www.compiere.org/license.html *
|
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
package org.compiere.plaf;
|
package org.adempiere.plaf;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.event.*;
|
import java.awt.event.*;
|
||||||
|
@ -23,8 +23,13 @@ import java.util.logging.*;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.border.*;
|
import javax.swing.border.*;
|
||||||
import javax.swing.plaf.metal.*;
|
import javax.swing.plaf.metal.*;
|
||||||
|
|
||||||
|
import org.compiere.plaf.CompiereColor;
|
||||||
|
import org.compiere.plaf.CompiereLookAndFeel;
|
||||||
|
import org.compiere.plaf.CompiereThemeEditor;
|
||||||
import org.compiere.swing.*;
|
import org.compiere.swing.*;
|
||||||
import org.compiere.util.*;
|
import org.compiere.util.*;
|
||||||
|
|
||||||
import sun.awt.*;
|
import sun.awt.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -35,53 +40,53 @@ import sun.awt.*;
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: AdempierePLAFEditor.java,v 1.3 2006/07/30 00:52:24 jjanke Exp $
|
* @version $Id: AdempierePLAFEditor.java,v 1.3 2006/07/30 00:52:24 jjanke Exp $
|
||||||
*/
|
*/
|
||||||
public class AdempierePLAFEditor extends JDialog
|
public class PLAFEditor extends JDialog
|
||||||
implements ActionListener
|
implements ActionListener
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Default Constructor
|
* Default Constructor
|
||||||
* Don't Show Example
|
* Don't Show Example
|
||||||
*/
|
*/
|
||||||
public AdempierePLAFEditor()
|
public PLAFEditor()
|
||||||
{
|
{
|
||||||
super();
|
super();
|
||||||
init(false);
|
init(false);
|
||||||
} // AdempierePLAFEditor
|
} // PLAFEditor
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
* @param showExample if true, show Example
|
* @param showExample if true, show Example
|
||||||
*/
|
*/
|
||||||
public AdempierePLAFEditor (boolean showExample)
|
public PLAFEditor (boolean showExample)
|
||||||
{
|
{
|
||||||
super();
|
super();
|
||||||
init(showExample);
|
init(true);
|
||||||
} // AdempierePLAFEditor
|
} // PLAFEditor
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Modal Dialog Constructor
|
* Modal Dialog Constructor
|
||||||
* @param owner
|
* @param owner
|
||||||
* @param showExample if true, show Example
|
* @param showExample if true, show Example
|
||||||
*/
|
*/
|
||||||
public AdempierePLAFEditor(Dialog owner, boolean showExample)
|
public PLAFEditor(Dialog owner, boolean showExample)
|
||||||
{
|
{
|
||||||
super(owner, "", true);
|
super(owner, "", true);
|
||||||
init(showExample);
|
init(true);
|
||||||
} // AdempierePLAFEditor
|
} // PLAFEditor
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Modal Frame Constructor
|
* Modal Frame Constructor
|
||||||
* @param owner
|
* @param owner
|
||||||
* @param showExample if true, show Example
|
* @param showExample if true, show Example
|
||||||
*/
|
*/
|
||||||
public AdempierePLAFEditor(Frame owner, boolean showExample)
|
public PLAFEditor(Frame owner, boolean showExample)
|
||||||
{
|
{
|
||||||
super(owner, "", true);
|
super(owner, "", true);
|
||||||
init(showExample);
|
init(true);
|
||||||
} // AdempierePLAFEditor
|
} // PLAFEditor
|
||||||
|
|
||||||
/** Logger */
|
/** Logger */
|
||||||
private static Logger log = Logger.getLogger(AdempierePLAFEditor.class.getName());
|
private static Logger log = Logger.getLogger(PLAFEditor.class.getName());
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -105,7 +110,6 @@ public class AdempierePLAFEditor extends JDialog
|
||||||
{
|
{
|
||||||
log.log(Level.SEVERE, "", e);
|
log.log(Level.SEVERE, "", e);
|
||||||
}
|
}
|
||||||
// AdempiereUtils.setNotBuffered(this);
|
|
||||||
} // PLAFEditor
|
} // PLAFEditor
|
||||||
|
|
||||||
/** Diable Theme Field */
|
/** Diable Theme Field */
|
||||||
|
@ -135,13 +139,9 @@ public class AdempierePLAFEditor extends JDialog
|
||||||
private CComboBox lfField = new CComboBox(AdempierePLAF.getPLAFs());
|
private CComboBox lfField = new CComboBox(AdempierePLAF.getPLAFs());
|
||||||
private CLabel themeLabel = new CLabel();
|
private CLabel themeLabel = new CLabel();
|
||||||
private CComboBox themeField = new CComboBox(AdempierePLAF.getThemes());
|
private CComboBox themeField = new CComboBox(AdempierePLAF.getThemes());
|
||||||
private CButton cButton = new CButton();
|
|
||||||
private FlowLayout southLayout = new FlowLayout();
|
private FlowLayout southLayout = new FlowLayout();
|
||||||
private CButton rButton = new CButton();
|
private CButton rButton = new CButton();
|
||||||
private CButton bSetColor = new CButton();
|
|
||||||
private CCheckBox cDefault = new CCheckBox();
|
|
||||||
private CComboBox blindField = new CComboBox(ColorBlind.COLORBLIND_TYPE);
|
private CComboBox blindField = new CComboBox(ColorBlind.COLORBLIND_TYPE);
|
||||||
private CCheckBox flatField = new CCheckBox();
|
|
||||||
private CLabel blindLabel = new CLabel();
|
private CLabel blindLabel = new CLabel();
|
||||||
private BorderLayout mainLayout = new BorderLayout();
|
private BorderLayout mainLayout = new BorderLayout();
|
||||||
//
|
//
|
||||||
|
@ -168,10 +168,10 @@ public class AdempierePLAFEditor extends JDialog
|
||||||
private JScrollPane jScrollPane2 = new JScrollPane();
|
private JScrollPane jScrollPane2 = new JScrollPane();
|
||||||
private JTable jTable1 = new JTable(s_data, s_columns);
|
private JTable jTable1 = new JTable(s_data, s_columns);
|
||||||
private GridBagLayout gridBagLayout1 = new GridBagLayout();
|
private GridBagLayout gridBagLayout1 = new GridBagLayout();
|
||||||
private CPanel jPanelFlat = new CPanel(new AdempiereColor(new Color(255,205,255), true));
|
private CPanel jPanelFlat = new CPanel(new CompiereColor(new Color(255,205,255), true));
|
||||||
private CPanel jPanelGradient = new CPanel(new AdempiereColor(new Color(233,210,210), new Color(217,210,233)));
|
private CPanel jPanelGradient = new CPanel(new CompiereColor(new Color(233,210,210), new Color(217,210,233)));
|
||||||
private CPanel jPanelTexture = new CPanel(new AdempiereColor(AdempiereColor.class.getResource("vincent.jpg"), Color.lightGray, 0.7f));
|
private CPanel jPanelTexture = new CPanel(new CompiereColor(CompiereColor.class.getResource("vincent.jpg"), Color.lightGray, 0.7f));
|
||||||
private CPanel jPanelLines = new CPanel(new AdempiereColor(new Color(178,181,205), new Color(193,193,205), 1.0f, 5));
|
private CPanel jPanelLines = new CPanel(new CompiereColor(new Color(178,181,205), new Color(193,193,205), 1.0f, 5));
|
||||||
private JButton jButtonFlat = new JButton();
|
private JButton jButtonFlat = new JButton();
|
||||||
private CButton jButtonGardient = new CButton();
|
private CButton jButtonGardient = new CButton();
|
||||||
private JButton jButtonTexture = new JButton();
|
private JButton jButtonTexture = new JButton();
|
||||||
|
@ -200,7 +200,7 @@ public class AdempierePLAFEditor extends JDialog
|
||||||
private void jbInit() throws Exception
|
private void jbInit() throws Exception
|
||||||
{
|
{
|
||||||
this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
|
this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
|
||||||
this.setTitle(s_res.getString("LookAndFeelEditor") + " " + AdempierePLAF.VERSION);
|
this.setTitle(s_res.getString("LookAndFeelEditor"));
|
||||||
mainPanel.setLayout(mainLayout);
|
mainPanel.setLayout(mainLayout);
|
||||||
mainLayout.setHgap(5);
|
mainLayout.setHgap(5);
|
||||||
mainLayout.setVgap(5);
|
mainLayout.setVgap(5);
|
||||||
|
@ -216,25 +216,15 @@ public class AdempierePLAFEditor extends JDialog
|
||||||
jPanelTexture.setToolTipText("Indented Level 2");
|
jPanelTexture.setToolTipText("Indented Level 2");
|
||||||
jPanelLines.setToolTipText("Indented Level 1");
|
jPanelLines.setToolTipText("Indented Level 1");
|
||||||
this.getContentPane().add(mainPanel, BorderLayout.CENTER);
|
this.getContentPane().add(mainPanel, BorderLayout.CENTER);
|
||||||
AdempiereColor.setBackground(this);
|
|
||||||
//
|
//
|
||||||
lfLabel.setText(s_res.getString("LookAndFeel"));
|
lfLabel.setText(s_res.getString("LookAndFeel"));
|
||||||
lfField.addActionListener(this);
|
lfField.addActionListener(this);
|
||||||
themeLabel.setText(s_res.getString("Theme"));
|
themeLabel.setText(s_res.getString("Theme"));
|
||||||
themeField.addActionListener(this);
|
themeField.addActionListener(this);
|
||||||
cButton.setText(s_res.getString("EditAdempiereTheme"));
|
|
||||||
cButton.addActionListener(this);
|
|
||||||
rButton.setText(s_res.getString("Reset"));
|
rButton.setText(s_res.getString("Reset"));
|
||||||
rButton.addActionListener(this);
|
rButton.addActionListener(this);
|
||||||
cDefault.setText(s_res.getString("SetDefault"));
|
|
||||||
cDefault.addActionListener(this);
|
|
||||||
bSetColor.setText(s_res.getString("SetDefaultColor"));
|
|
||||||
bSetColor.addActionListener(this);
|
|
||||||
blindLabel.setText(s_res.getString("ColorBlind"));
|
blindLabel.setText(s_res.getString("ColorBlind"));
|
||||||
blindField.addActionListener(this);
|
blindField.addActionListener(this);
|
||||||
flatField.setText(s_res.getString("FlatColor"));
|
|
||||||
flatField.setSelected(Ini.isPropertyBool(Ini.P_UI_FLAT));
|
|
||||||
flatField.addActionListener(this);
|
|
||||||
//
|
//
|
||||||
bOK.addActionListener(this);
|
bOK.addActionListener(this);
|
||||||
bCancel.addActionListener(this);
|
bCancel.addActionListener(this);
|
||||||
|
@ -282,16 +272,8 @@ public class AdempierePLAFEditor extends JDialog
|
||||||
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 12, 5, 5), 0, 0));
|
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 12, 5, 5), 0, 0));
|
||||||
northPanel.add(themeField, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0
|
northPanel.add(themeField, new GridBagConstraints(1, 1, 1, 1, 0.0, 0.0
|
||||||
,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 12), 0, 0));
|
,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 5, 12), 0, 0));
|
||||||
northPanel.add(cButton, new GridBagConstraints(1, 2, 1, 1, 0.0, 0.0
|
|
||||||
,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 12), 0, 0));
|
|
||||||
northPanel.add(rButton, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0
|
northPanel.add(rButton, new GridBagConstraints(0, 2, 1, 1, 0.0, 0.0
|
||||||
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 12, 5, 5), 0, 0));
|
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 12, 5, 5), 0, 0));
|
||||||
northPanel.add(bSetColor, new GridBagConstraints(1, 3, 1, 1, 0.0, 0.0
|
|
||||||
,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 0, 5, 12), 0, 0));
|
|
||||||
northPanel.add(cDefault, new GridBagConstraints(0, 3, 1, 1, 0.0, 0.0
|
|
||||||
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 12, 5, 5), 0, 0));
|
|
||||||
northPanel.add(flatField, new GridBagConstraints(1, 4, 1, 1, 0.0, 0.0
|
|
||||||
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 5, 12), 0, 0));
|
|
||||||
northPanel.add(blindLabel, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0
|
northPanel.add(blindLabel, new GridBagConstraints(0, 5, 1, 1, 0.0, 0.0
|
||||||
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 12, 5, 5), 0, 0));
|
,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(5, 12, 5, 5), 0, 0));
|
||||||
northPanel.add(blindField, new GridBagConstraints(1, 5, 1, 1, 0.0, 0.0
|
northPanel.add(blindField, new GridBagConstraints(1, 5, 1, 1, 0.0, 0.0
|
||||||
|
@ -366,7 +348,7 @@ public class AdempierePLAFEditor extends JDialog
|
||||||
*/
|
*/
|
||||||
private void dynInit()
|
private void dynInit()
|
||||||
{
|
{
|
||||||
// setLFSelection();
|
setLFSelection();
|
||||||
//
|
//
|
||||||
jPanelGradient.setTabLevel(1);
|
jPanelGradient.setTabLevel(1);
|
||||||
jPanelTexture.setTabLevel(2);
|
jPanelTexture.setTabLevel(2);
|
||||||
|
@ -383,7 +365,6 @@ public class AdempierePLAFEditor extends JDialog
|
||||||
jButtonTexture.addActionListener(this);
|
jButtonTexture.addActionListener(this);
|
||||||
jButtonLines.addActionListener(this);
|
jButtonLines.addActionListener(this);
|
||||||
//
|
//
|
||||||
AdempierePLAF.setPLAF(this);
|
|
||||||
} // dynInit
|
} // dynInit
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -451,7 +432,6 @@ public class AdempierePLAFEditor extends JDialog
|
||||||
// OK - Save & Finish
|
// OK - Save & Finish
|
||||||
if (e.getSource() == bOK)
|
if (e.getSource() == bOK)
|
||||||
{
|
{
|
||||||
CompiereTheme.save();
|
|
||||||
Ini.saveProperties(true);
|
Ini.saveProperties(true);
|
||||||
dispose();
|
dispose();
|
||||||
}
|
}
|
||||||
|
@ -470,58 +450,28 @@ public class AdempierePLAFEditor extends JDialog
|
||||||
{
|
{
|
||||||
m_setting = true; // disable Theme setting
|
m_setting = true; // disable Theme setting
|
||||||
// set new theme
|
// set new theme
|
||||||
AdempierePLAF.setPLAF((ValueNamePair)lfField.getSelectedItem(), null, this);
|
AdempierePLAF.setPLAF((ValueNamePair)lfField.getSelectedItem(), null, true);
|
||||||
|
AdempierePLAF.updateUI(this);
|
||||||
setLFSelection();
|
setLFSelection();
|
||||||
setBackgroundToTheme();
|
|
||||||
AdempierePLAF.setPLAF(this); // twice ??
|
|
||||||
m_setting = false; // enable Theme setting
|
m_setting = false; // enable Theme setting
|
||||||
}
|
}
|
||||||
// Theme Field Changed
|
// Theme Field Changed
|
||||||
else if (e.getSource() == themeField && !m_setting)
|
else if (e.getSource() == themeField && !m_setting)
|
||||||
{
|
{
|
||||||
Ini.setProperty(Ini.P_UI_THEME, themeField.getSelectedItem().toString());
|
Ini.setProperty(Ini.P_UI_THEME, themeField.getSelectedItem().toString());
|
||||||
AdempierePLAF.setPLAF((ValueNamePair)lfField.getSelectedItem(), (ValueNamePair)themeField.getSelectedItem(), this);
|
AdempierePLAF.setPLAF((ValueNamePair)lfField.getSelectedItem(), (ValueNamePair)themeField.getSelectedItem(),true);
|
||||||
CompiereTheme.setTheme(); // copy Theme
|
AdempierePLAF.updateUI(this);
|
||||||
setBackgroundToTheme();
|
|
||||||
AdempierePLAF.setPLAF(this); // twice (??)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Start Adempiere Theme Editor
|
|
||||||
else if (e.getSource() == cButton)
|
|
||||||
{
|
|
||||||
new AdempiereThemeEditor(this);
|
|
||||||
setBackgroundToTheme();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reset PLAFs
|
// Reset PLAFs
|
||||||
else if (e.getSource() == rButton)
|
else if (e.getSource() == rButton)
|
||||||
{
|
{
|
||||||
AdempierePLAF.reset(this);
|
AdempierePLAF.reset();
|
||||||
|
AdempierePLAF.updateUI(this);
|
||||||
setLFSelection();
|
setLFSelection();
|
||||||
ColorBlind.setColorType(ColorBlind.NORMAL);
|
ColorBlind.setColorType(ColorBlind.NORMAL);
|
||||||
AdempierePLAF.setPLAF(this); // twice ??
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set Default Background Color
|
|
||||||
else if (e.getSource() == bSetColor)
|
|
||||||
{
|
|
||||||
AdempiereColor cc = AdempiereColorEditor.showDialog(this, AdempierePanelUI.getDefaultBackground());
|
|
||||||
AdempierePanelUI.setDefaultBackground(cc);
|
|
||||||
AdempierePLAF.updateUI(this);
|
|
||||||
Ini.setProperty(CompiereTheme.P_AdempiereColor, cc.toString());
|
|
||||||
}
|
|
||||||
// Set Background as Default
|
|
||||||
else if (e.getSource() == cDefault)
|
|
||||||
{
|
|
||||||
AdempierePanelUI.setSetDefault(cDefault.isSelected());
|
|
||||||
AdempierePLAF.updateUI(this);
|
|
||||||
}
|
|
||||||
// Flat
|
|
||||||
else if (e.getSource() == flatField)
|
|
||||||
{
|
|
||||||
Ini.setProperty(Ini.P_UI_FLAT, flatField.isSelected());
|
|
||||||
setBackgroundToTheme();
|
|
||||||
}
|
|
||||||
// ColorBlind
|
// ColorBlind
|
||||||
else if (e.getSource() == blindField)
|
else if (e.getSource() == blindField)
|
||||||
{
|
{
|
||||||
|
@ -542,7 +492,6 @@ public class AdempierePLAFEditor extends JDialog
|
||||||
}
|
}
|
||||||
ColorBlind.setColorType(sel);
|
ColorBlind.setColorType(sel);
|
||||||
AdempierePLAF.updateUI(this);
|
AdempierePLAF.updateUI(this);
|
||||||
AdempierePLAF.setPLAF(this); // twice (??)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -585,7 +534,6 @@ public class AdempierePLAFEditor extends JDialog
|
||||||
themeField.setEnabled(metal);
|
themeField.setEnabled(metal);
|
||||||
themeLabel.setEnabled(metal);
|
themeLabel.setEnabled(metal);
|
||||||
boolean adempiere = UIManager.getLookAndFeel() instanceof CompiereLookAndFeel;
|
boolean adempiere = UIManager.getLookAndFeel() instanceof CompiereLookAndFeel;
|
||||||
flatField.setEnabled(adempiere);
|
|
||||||
|
|
||||||
// ColorBlind - only with Adempiere L&F & Theme
|
// ColorBlind - only with Adempiere L&F & Theme
|
||||||
boolean enableBlind = adempiere
|
boolean enableBlind = adempiere
|
||||||
|
@ -600,20 +548,6 @@ public class AdempierePLAFEditor extends JDialog
|
||||||
setCursor(Cursor.getDefaultCursor());
|
setCursor(Cursor.getDefaultCursor());
|
||||||
} // actionPerformed
|
} // actionPerformed
|
||||||
|
|
||||||
/**
|
|
||||||
* Set AdempiereColor Background to Theme Background
|
|
||||||
*/
|
|
||||||
private void setBackgroundToTheme()
|
|
||||||
{
|
|
||||||
// Not flat for Adempiere L&F
|
|
||||||
boolean flat = Ini.isPropertyBool(Ini.P_UI_FLAT);
|
|
||||||
AdempiereColor cc = new AdempiereColor(CompiereTheme.secondary3, flat);
|
|
||||||
AdempierePanelUI.setDefaultBackground(cc);
|
|
||||||
Ini.setProperty(CompiereTheme.P_AdempiereColor, cc.toString());
|
|
||||||
AdempierePLAF.updateUI(this);
|
|
||||||
} // setBackgroundToTheme
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Dispose
|
* Dispose
|
||||||
* Exit, if there is no real owning parent (not modal) - shortcut
|
* Exit, if there is no real owning parent (not modal) - shortcut
|
|
@ -0,0 +1,445 @@
|
||||||
|
/******************************************************************************
|
||||||
|
* Product: Adempiere ERP & CRM Smart Business Solution *
|
||||||
|
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
|
||||||
|
* This program is free software; you can redistribute it and/or modify it *
|
||||||
|
* under the terms version 2 of the GNU General Public License as published *
|
||||||
|
* by the Free Software Foundation. This program is distributed in the hope *
|
||||||
|
* that it will be useful, but WITHOUT ANY WARRANTY; without even the implied *
|
||||||
|
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
|
||||||
|
* See the GNU General Public License for more details. *
|
||||||
|
* You should have received a copy of the GNU General Public License along *
|
||||||
|
* with this program; if not, write to the Free Software Foundation, Inc., *
|
||||||
|
* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. *
|
||||||
|
* For the text or an alternative of this public license, you may reach us *
|
||||||
|
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||||
|
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||||
|
*****************************************************************************/
|
||||||
|
package org.adempiere.plaf;
|
||||||
|
|
||||||
|
import java.awt.BorderLayout;
|
||||||
|
import java.awt.Cursor;
|
||||||
|
import java.awt.Font;
|
||||||
|
import java.awt.Graphics;
|
||||||
|
import java.awt.GridBagConstraints;
|
||||||
|
import java.awt.GridBagLayout;
|
||||||
|
import java.awt.GridLayout;
|
||||||
|
import java.awt.Insets;
|
||||||
|
import java.awt.event.FocusAdapter;
|
||||||
|
import java.awt.event.KeyAdapter;
|
||||||
|
import java.awt.event.MouseAdapter;
|
||||||
|
import java.awt.image.BufferedImage;
|
||||||
|
import java.util.ResourceBundle;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
import javax.swing.BorderFactory;
|
||||||
|
import javax.swing.BoxLayout;
|
||||||
|
import javax.swing.DefaultComboBoxModel;
|
||||||
|
import javax.swing.JComponent;
|
||||||
|
import javax.swing.JLabel;
|
||||||
|
import javax.swing.JList;
|
||||||
|
import javax.swing.JRadioButton;
|
||||||
|
import javax.swing.JRootPane;
|
||||||
|
import javax.swing.JScrollPane;
|
||||||
|
import javax.swing.JSplitPane;
|
||||||
|
import javax.swing.JTable;
|
||||||
|
import javax.swing.JTree;
|
||||||
|
import javax.swing.LookAndFeel;
|
||||||
|
import javax.swing.SwingUtilities;
|
||||||
|
import javax.swing.UIManager;
|
||||||
|
import javax.swing.UnsupportedLookAndFeelException;
|
||||||
|
import javax.swing.event.ListSelectionEvent;
|
||||||
|
import javax.swing.event.ListSelectionListener;
|
||||||
|
import javax.swing.plaf.SplitPaneUI;
|
||||||
|
import javax.swing.plaf.basic.BasicSplitPaneUI;
|
||||||
|
import javax.swing.plaf.metal.MetalLookAndFeel;
|
||||||
|
import javax.swing.plaf.metal.MetalTheme;
|
||||||
|
|
||||||
|
import org.compiere.swing.CButton;
|
||||||
|
import org.compiere.swing.CCheckBox;
|
||||||
|
import org.compiere.swing.CComboBox;
|
||||||
|
import org.compiere.swing.CLabel;
|
||||||
|
import org.compiere.swing.CPanel;
|
||||||
|
import org.compiere.swing.CTabbedPane;
|
||||||
|
import org.compiere.swing.CTextField;
|
||||||
|
import org.compiere.util.ValueNamePair;
|
||||||
|
|
||||||
|
import sun.awt.AppContext;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Look and feel selection panel.
|
||||||
|
* @author Low Heng Sin
|
||||||
|
* @version 2006-11-27
|
||||||
|
*/
|
||||||
|
public class PLAFEditorPanel extends CPanel {
|
||||||
|
/** Logger */
|
||||||
|
private static Logger log = Logger.getLogger(PLAFEditor.class.getName());
|
||||||
|
|
||||||
|
static ResourceBundle s_res = ResourceBundle.getBundle("org.compiere.plaf.PlafRes");
|
||||||
|
static Object[] s_columns = new Object[] {"-0-", "-1-"};
|
||||||
|
static Object[][] s_data = new Object[][] {
|
||||||
|
{"-00-", "-01-"},
|
||||||
|
{"-10-", "-11-"},
|
||||||
|
{"-20-", "-21-"},
|
||||||
|
{"-30-", "-31-"},
|
||||||
|
{"-O0-", "-O1-"},
|
||||||
|
{"-l0-", "-l1-"}};
|
||||||
|
|
||||||
|
private PreviewPanel previewPanel = new PreviewPanel();
|
||||||
|
private JList lookList = new JList(AdempierePLAF.getPLAFs());
|
||||||
|
private JList themeList = new JList();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Instance variable to disable list event handling when updating list with value
|
||||||
|
* from UIManager
|
||||||
|
*/
|
||||||
|
private boolean m_setting;
|
||||||
|
|
||||||
|
//preview components
|
||||||
|
private CTextField error = new CTextField(s_res.getString("Error"));
|
||||||
|
private CTextField mandatory = new CTextField(s_res.getString("Mandatory"));
|
||||||
|
CButton button = new CButton("Button");
|
||||||
|
CPanel tabPage1 = new CPanel();
|
||||||
|
|
||||||
|
public PLAFEditorPanel() {
|
||||||
|
init();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void init() {
|
||||||
|
setupUI();
|
||||||
|
setupPreview();
|
||||||
|
setLFSelection();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create and layout UI components
|
||||||
|
*/
|
||||||
|
private void setupUI() {
|
||||||
|
this.setLayout(new BorderLayout());
|
||||||
|
|
||||||
|
//splitpane for the selection and preview panel
|
||||||
|
JSplitPane splitPane = new JSplitPane();
|
||||||
|
splitPane.setBorder(BorderFactory.createEmptyBorder());
|
||||||
|
splitPane.setOrientation(JSplitPane.VERTICAL_SPLIT);
|
||||||
|
add(splitPane, BorderLayout.CENTER);
|
||||||
|
|
||||||
|
CPanel selectionPanel = new CPanel();
|
||||||
|
CPanel previewPart = new CPanel();
|
||||||
|
|
||||||
|
splitPane.setTopComponent(selectionPanel);
|
||||||
|
splitPane.setBottomComponent(previewPart);
|
||||||
|
splitPane.setDividerLocation(0.50);
|
||||||
|
splitPane.setDividerSize(0);
|
||||||
|
//disable divider
|
||||||
|
SplitPaneUI splitPaneUI = splitPane.getUI();
|
||||||
|
if (splitPaneUI instanceof BasicSplitPaneUI) {
|
||||||
|
((BasicSplitPaneUI)splitPaneUI).getDivider().setEnabled(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
//setup look and theme selection component
|
||||||
|
selectionPanel.setLayout(new GridBagLayout());
|
||||||
|
CLabel label = new CLabel(s_res.getString("LookAndFeel"));
|
||||||
|
label.setForeground(AdempierePLAF.getPrimary1());
|
||||||
|
label.setFont(label.getFont().deriveFont(Font.BOLD));
|
||||||
|
selectionPanel.add(label, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
|
||||||
|
GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 0), 0, 0));
|
||||||
|
label = new CLabel(s_res.getString("Theme"));
|
||||||
|
label.setForeground(AdempierePLAF.getPrimary1());
|
||||||
|
label.setFont(label.getFont().deriveFont(Font.BOLD));
|
||||||
|
selectionPanel.add(label, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0,
|
||||||
|
GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 0, 0, 0), 0, 0));
|
||||||
|
|
||||||
|
lookList.setVisibleRowCount(12);
|
||||||
|
JScrollPane scrollPane = new JScrollPane(lookList);
|
||||||
|
scrollPane.setBorder(BorderFactory.createLineBorder(AdempierePLAF.getSecondary1(), 1));
|
||||||
|
selectionPanel.add(scrollPane, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0,
|
||||||
|
GridBagConstraints.NORTHWEST, GridBagConstraints.VERTICAL, new Insets(0, 5, 2, 2), 100, 0));
|
||||||
|
|
||||||
|
themeList.setVisibleRowCount(12);
|
||||||
|
scrollPane = new JScrollPane(themeList);
|
||||||
|
scrollPane.setBorder(BorderFactory.createLineBorder(AdempierePLAF.getSecondary1(), 1));
|
||||||
|
selectionPanel.add(scrollPane, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0,
|
||||||
|
GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(0, 2, 2, 5), 0, 0));
|
||||||
|
|
||||||
|
previewPart.setBorder(BorderFactory.createEmptyBorder());
|
||||||
|
previewPart.setLayout(new GridBagLayout());
|
||||||
|
label = new CLabel(s_res.getString("Preview"));
|
||||||
|
label.setForeground(AdempierePLAF.getPrimary1());
|
||||||
|
label.setFont(label.getFont().deriveFont(Font.BOLD));
|
||||||
|
previewPart.add(label, new GridBagConstraints(0, 0, 1, 1, 1.0, 0.0,
|
||||||
|
GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 0, 0), 0, 0));
|
||||||
|
previewPart.add(previewPanel, new GridBagConstraints(0, 1, 2, 1, 1.0, 1.0,
|
||||||
|
GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, new Insets(0, 5, 5, 5), 0, 0));
|
||||||
|
|
||||||
|
lookList.addListSelectionListener(new ListSelectionListener() {
|
||||||
|
public void valueChanged(ListSelectionEvent e) {
|
||||||
|
lookAndFeelSelectionChanged(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
themeList.addListSelectionListener(new ListSelectionListener() {
|
||||||
|
public void valueChanged(ListSelectionEvent e) {
|
||||||
|
themeSelectionChanged(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void themeSelectionChanged(ListSelectionEvent e) {
|
||||||
|
if (m_setting) return;
|
||||||
|
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
|
||||||
|
ValueNamePair laf = (ValueNamePair)lookList.getSelectedValue();
|
||||||
|
ValueNamePair theme = (ValueNamePair)themeList.getSelectedValue();
|
||||||
|
LookAndFeel currentLaf = UIManager.getLookAndFeel();
|
||||||
|
MetalTheme currentTheme = MetalLookAndFeel.getCurrentTheme();
|
||||||
|
AdempierePLAF.setPLAF(laf, theme, false);
|
||||||
|
previewPanel.refresh(currentLaf,currentTheme);
|
||||||
|
SwingUtilities.updateComponentTreeUI(previewPanel);
|
||||||
|
updatePreviewComponents();
|
||||||
|
setLFSelection();
|
||||||
|
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
|
||||||
|
this.repaint();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Handle look and feel selection changed
|
||||||
|
* @param e
|
||||||
|
*/
|
||||||
|
protected void lookAndFeelSelectionChanged(ListSelectionEvent e) {
|
||||||
|
if (m_setting) return;
|
||||||
|
setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR));
|
||||||
|
ValueNamePair laf = (ValueNamePair)lookList.getSelectedValue();
|
||||||
|
LookAndFeel currentLaf = UIManager.getLookAndFeel();
|
||||||
|
MetalTheme currentTheme = MetalLookAndFeel.getCurrentTheme();
|
||||||
|
AdempierePLAF.setPLAF(laf, null, false);
|
||||||
|
previewPanel.refresh(currentLaf,currentTheme);
|
||||||
|
SwingUtilities.updateComponentTreeUI(previewPanel);
|
||||||
|
updatePreviewComponents();
|
||||||
|
setLFSelection();
|
||||||
|
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR));
|
||||||
|
this.repaint();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void updatePreviewComponents() {
|
||||||
|
error.setBackground(true);
|
||||||
|
mandatory.setMandatory(true);
|
||||||
|
button.setOpaque(true);
|
||||||
|
tabPage1.setOpaque(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create the preview UI components
|
||||||
|
*/
|
||||||
|
private void setupPreview() {
|
||||||
|
JRootPane rootPane = new JRootPane();
|
||||||
|
previewPanel.setLayout(new BorderLayout());
|
||||||
|
previewPanel.add(rootPane, BorderLayout.CENTER);
|
||||||
|
previewPanel.setBorder(BorderFactory.createLineBorder(AdempierePLAF.getSecondary1(), 1));
|
||||||
|
GridLayout gridLayout = new GridLayout(1, 3);
|
||||||
|
gridLayout.setHgap(4);
|
||||||
|
rootPane.getContentPane().setLayout(gridLayout);
|
||||||
|
rootPane.setGlassPane(new GlassPane());
|
||||||
|
rootPane.getGlassPane().setVisible(true);
|
||||||
|
CPanel column1 = new CPanel();
|
||||||
|
rootPane.getContentPane().add(column1);
|
||||||
|
CPanel column2 = new CPanel();
|
||||||
|
rootPane.getContentPane().add(column2);
|
||||||
|
CPanel column3 = new CPanel();
|
||||||
|
rootPane.getContentPane().add(column3);
|
||||||
|
|
||||||
|
column1.setLayout(new GridBagLayout());
|
||||||
|
JTree jtree = new JTree();
|
||||||
|
jtree.setFocusable(false);
|
||||||
|
jtree.setBorder(BorderFactory.createLineBorder(AdempierePLAF.getSecondary1(), 1));
|
||||||
|
column1.add(jtree, new GridBagConstraints(0, 0, 2, 1, 1.0, 1.0,
|
||||||
|
GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(5,5,2,2),0,0));
|
||||||
|
CTextField normal = new CTextField("Text Field");
|
||||||
|
normal.setFocusable(false);
|
||||||
|
column1.add(normal, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0,
|
||||||
|
GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2,5,5,2),0,0));
|
||||||
|
error.setBackground(true);
|
||||||
|
error.setFocusable(false);
|
||||||
|
column1.add(error, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0,
|
||||||
|
GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2,2,5,2),0,0));
|
||||||
|
|
||||||
|
column2.setLayout(new GridBagLayout());
|
||||||
|
JTable jtable = new JTable(s_data, s_columns);
|
||||||
|
JScrollPane scrollPane = new JScrollPane(jtable);
|
||||||
|
jtable.setFocusable(false);
|
||||||
|
scrollPane.setPreferredSize(jtable.getPreferredSize());
|
||||||
|
column2.add(scrollPane, new GridBagConstraints(0, 0, 2, 1, 1.0, 1.0,
|
||||||
|
GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(5,2,2,2),0,0));
|
||||||
|
mandatory.setMandatory(true);
|
||||||
|
mandatory.setFocusable(false);
|
||||||
|
column2.add(mandatory, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0,
|
||||||
|
GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2,2,5,2),0,0));
|
||||||
|
CTextField inactive = new CTextField(s_res.getString("Inactive"));
|
||||||
|
inactive.setEnabled(false);
|
||||||
|
column2.add(inactive, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0,
|
||||||
|
GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2,2,5,2),0,0));
|
||||||
|
|
||||||
|
column3.setLayout(new GridBagLayout());
|
||||||
|
CTabbedPane tab = new CTabbedPane();
|
||||||
|
column3.add(tab, new GridBagConstraints(0, 0, 2, 1, 1.0, 1.0,
|
||||||
|
GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(5,2,2,5),0,0));
|
||||||
|
CComboBox editable = new CComboBox(new Object[]{"Editable"});
|
||||||
|
editable.setEditable(true);
|
||||||
|
editable.setFocusable(false);
|
||||||
|
column3.add(editable, new GridBagConstraints(0, 1, 1, 1, 1.0, 0.0,
|
||||||
|
GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2,2,5,2),0,0));
|
||||||
|
CComboBox choice = new CComboBox(new Object[]{"Choice"});
|
||||||
|
choice.setEditable(false);
|
||||||
|
choice.setFocusable(false);
|
||||||
|
column3.add(choice, new GridBagConstraints(1, 1, 1, 1, 1.0, 0.0,
|
||||||
|
GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(2,2,5,5),0,0));
|
||||||
|
|
||||||
|
tabPage1.setLayout(new BoxLayout(tabPage1, BoxLayout.Y_AXIS));
|
||||||
|
JRadioButton radio = new JRadioButton("Radio");
|
||||||
|
radio.setSelected(true);
|
||||||
|
radio.setMargin(new Insets(5,5,5,5));
|
||||||
|
radio.setFocusable(false);
|
||||||
|
radio.setOpaque(false);
|
||||||
|
tabPage1.add(radio);
|
||||||
|
CCheckBox checkBox = new CCheckBox("Checkbox");
|
||||||
|
checkBox.setSelected(true);
|
||||||
|
checkBox.setMargin(new Insets(5,5,5,5));
|
||||||
|
checkBox.setFocusable(false);
|
||||||
|
tabPage1.add(checkBox);
|
||||||
|
CLabel label = new CLabel("Label");
|
||||||
|
label.setHorizontalAlignment(JLabel.LEFT);
|
||||||
|
label.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
|
||||||
|
tabPage1.add(label);
|
||||||
|
button.setMargin(new Insets(5,5,5,5));
|
||||||
|
button.setFocusable(false);
|
||||||
|
tabPage1.add(button);
|
||||||
|
tab.add(tabPage1, "tab1");
|
||||||
|
tab.add(new CPanel(), "tab2");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Update the look list and theme list to show the current selection
|
||||||
|
*/
|
||||||
|
private void setLFSelection()
|
||||||
|
{
|
||||||
|
m_setting = true;
|
||||||
|
// Search for PLAF
|
||||||
|
ValueNamePair plaf = null;
|
||||||
|
LookAndFeel lookFeel = UIManager.getLookAndFeel();
|
||||||
|
String look = lookFeel.getClass().getName();
|
||||||
|
for (int i = 0; i < AdempierePLAF.getPLAFs().length; i++)
|
||||||
|
{
|
||||||
|
ValueNamePair vp = AdempierePLAF.getPLAFs()[i];
|
||||||
|
if (vp.getValue().equals(look))
|
||||||
|
{
|
||||||
|
plaf = vp;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (plaf != null)
|
||||||
|
lookList.setSelectedValue(plaf, true);
|
||||||
|
|
||||||
|
|
||||||
|
// Search for Theme
|
||||||
|
MetalTheme metalTheme = null;
|
||||||
|
ValueNamePair theme = null;
|
||||||
|
boolean metal = UIManager.getLookAndFeel() instanceof MetalLookAndFeel;
|
||||||
|
themeList.setModel(new DefaultComboBoxModel(AdempierePLAF.getThemes()));
|
||||||
|
if (metal)
|
||||||
|
{
|
||||||
|
theme = null;
|
||||||
|
AppContext context = AppContext.getAppContext();
|
||||||
|
metalTheme = (MetalTheme)context.get("currentMetalTheme");
|
||||||
|
if (metalTheme != null)
|
||||||
|
{
|
||||||
|
String lookTheme = metalTheme.getName();
|
||||||
|
for (int i = 0; i < AdempierePLAF.getThemes().length; i++)
|
||||||
|
{
|
||||||
|
ValueNamePair vp = AdempierePLAF.getThemes()[i];
|
||||||
|
if (vp.getName().equals(lookTheme))
|
||||||
|
{
|
||||||
|
theme = vp;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (theme != null)
|
||||||
|
themeList.setSelectedValue(theme, true);
|
||||||
|
}
|
||||||
|
m_setting = false;
|
||||||
|
log.info(lookFeel + " - " + metalTheme);
|
||||||
|
} // setLFSelection
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get look and feel selected by user
|
||||||
|
* @return selected look and feel
|
||||||
|
*/
|
||||||
|
public ValueNamePair getSelectedLook() {
|
||||||
|
return (ValueNamePair)lookList.getSelectedValue();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get theme selected by user
|
||||||
|
* @return selected theme
|
||||||
|
*/
|
||||||
|
public ValueNamePair getSelectedTheme() {
|
||||||
|
return (ValueNamePair)themeList.getSelectedValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Glass pane to block input and mouse event from the preview components
|
||||||
|
* @author Low Heng Sin
|
||||||
|
*/
|
||||||
|
class GlassPane extends JComponent {
|
||||||
|
GlassPane() {
|
||||||
|
addMouseListener(new MouseAdapter() {});
|
||||||
|
addKeyListener(new KeyAdapter() {});
|
||||||
|
addFocusListener(new FocusAdapter() {});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A custom panel, only repaint when look and feel or theme changed.
|
||||||
|
* @author Low Heng Sin
|
||||||
|
*/
|
||||||
|
class PreviewPanel extends CPanel {
|
||||||
|
private boolean capture = true;
|
||||||
|
private LookAndFeel laf = null;
|
||||||
|
private MetalTheme theme = null;
|
||||||
|
private BufferedImage image;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void paint(Graphics g) {
|
||||||
|
if (capture) {
|
||||||
|
//capture preview image
|
||||||
|
image = (BufferedImage)createImage(this.getWidth(),this.getHeight());
|
||||||
|
super.paint(image.createGraphics());
|
||||||
|
g.drawImage(image, 0, 0, null);
|
||||||
|
capture = false;
|
||||||
|
if (laf != null) {
|
||||||
|
//reset to origianl setting
|
||||||
|
if (laf instanceof MetalLookAndFeel)
|
||||||
|
AdempierePLAF.setCurrentMetalTheme((MetalLookAndFeel)laf, theme);
|
||||||
|
try {
|
||||||
|
UIManager.setLookAndFeel(laf);
|
||||||
|
} catch (UnsupportedLookAndFeelException e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
//draw preview image
|
||||||
|
if (image != null)
|
||||||
|
g.drawImage(image, 0, 0, null);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Refresh look and feel preview, reset to original setting after
|
||||||
|
* refresh.
|
||||||
|
* @param currentLaf Current Look and feel
|
||||||
|
* @param currentTheme Current Theme
|
||||||
|
*/
|
||||||
|
public void refresh(LookAndFeel currentLaf, MetalTheme currentTheme) {
|
||||||
|
this.laf = currentLaf;
|
||||||
|
this.theme = currentTheme;
|
||||||
|
capture = true;
|
||||||
|
}
|
||||||
|
}
|
|
@ -28,13 +28,13 @@ import javax.swing.plaf.basic.*;
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: AdempiereButtonListener.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
* @version $Id: AdempiereButtonListener.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
||||||
*/
|
*/
|
||||||
public class AdempiereButtonListener extends BasicButtonListener
|
public class CompiereButtonListener extends BasicButtonListener
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Adempiere Button Listener
|
* Adempiere Button Listener
|
||||||
* @param b button
|
* @param b button
|
||||||
*/
|
*/
|
||||||
public AdempiereButtonListener (AbstractButton b)
|
public CompiereButtonListener (AbstractButton b)
|
||||||
{
|
{
|
||||||
super (b);
|
super (b);
|
||||||
} // AdempiereButtonListener
|
} // AdempiereButtonListener
|
|
@ -28,7 +28,7 @@ import javax.swing.plaf.metal.*;
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: AdempiereButtonUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
* @version $Id: AdempiereButtonUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
||||||
*/
|
*/
|
||||||
public class AdempiereButtonUI extends MetalButtonUI
|
public class CompiereButtonUI extends MetalButtonUI
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Static Create UI
|
* Static Create UI
|
||||||
|
@ -41,7 +41,7 @@ public class AdempiereButtonUI extends MetalButtonUI
|
||||||
} // createUI
|
} // createUI
|
||||||
|
|
||||||
/** UI shared */
|
/** UI shared */
|
||||||
private static AdempiereButtonUI s_buttonUI = new AdempiereButtonUI();
|
private static CompiereButtonUI s_buttonUI = new CompiereButtonUI();
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -73,7 +73,7 @@ public class AdempiereButtonUI extends MetalButtonUI
|
||||||
{
|
{
|
||||||
// System.out.println(c.getClass() + " ** " + ((JButton)c).getText() + " ** " + c.isOpaque());
|
// System.out.println(c.getClass() + " ** " + ((JButton)c).getText() + " ** " + c.isOpaque());
|
||||||
if (c.isOpaque())
|
if (c.isOpaque())
|
||||||
AdempiereUtils.fillRectange((Graphics2D)g, c, CompiereLookAndFeel.ROUND);
|
CompiereUtils.fillRectange((Graphics2D)g, c, CompiereLookAndFeel.ROUND);
|
||||||
paint (g, c);
|
paint (g, c);
|
||||||
} // update
|
} // update
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ public class AdempiereButtonUI extends MetalButtonUI
|
||||||
boolean in = model.isPressed() || model.isSelected();
|
boolean in = model.isPressed() || model.isSelected();
|
||||||
//
|
//
|
||||||
if (b.isBorderPainted())
|
if (b.isBorderPainted())
|
||||||
AdempiereUtils.paint3Deffect((Graphics2D)g, c, CompiereLookAndFeel.ROUND, !in);
|
CompiereUtils.paint3Deffect((Graphics2D)g, c, CompiereLookAndFeel.ROUND, !in);
|
||||||
} // paint
|
} // paint
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -126,7 +126,7 @@ public class AdempiereButtonUI extends MetalButtonUI
|
||||||
*/
|
*/
|
||||||
protected BasicButtonListener createButtonListener (AbstractButton b)
|
protected BasicButtonListener createButtonListener (AbstractButton b)
|
||||||
{
|
{
|
||||||
return new AdempiereButtonListener(b);
|
return new CompiereButtonListener(b);
|
||||||
} // createButtonListener
|
} // createButtonListener
|
||||||
|
|
||||||
} // AdempiereButtonUI
|
} // AdempiereButtonUI
|
|
@ -26,7 +26,7 @@ import javax.swing.plaf.basic.*;
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: AdempiereCheckBoxMenuItemUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
* @version $Id: AdempiereCheckBoxMenuItemUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
||||||
*/
|
*/
|
||||||
public class AdempiereCheckBoxMenuItemUI extends BasicCheckBoxMenuItemUI
|
public class CompiereCheckBoxMenuItemUI extends BasicCheckBoxMenuItemUI
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Create own instance
|
* Create own instance
|
||||||
|
@ -35,7 +35,7 @@ public class AdempiereCheckBoxMenuItemUI extends BasicCheckBoxMenuItemUI
|
||||||
*/
|
*/
|
||||||
public static ComponentUI createUI(JComponent c)
|
public static ComponentUI createUI(JComponent c)
|
||||||
{
|
{
|
||||||
return new AdempiereMenuItemUI();
|
return new CompiereMenuItemUI();
|
||||||
} // createUI
|
} // createUI
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -28,7 +28,7 @@ import javax.swing.plaf.metal.MetalCheckBoxUI;
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: AdempiereCheckBoxUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
* @version $Id: AdempiereCheckBoxUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
||||||
*/
|
*/
|
||||||
public class AdempiereCheckBoxUI extends MetalCheckBoxUI
|
public class CompiereCheckBoxUI extends MetalCheckBoxUI
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Create UI
|
* Create UI
|
||||||
|
@ -41,7 +41,7 @@ public class AdempiereCheckBoxUI extends MetalCheckBoxUI
|
||||||
} // createUI
|
} // createUI
|
||||||
|
|
||||||
/** UI shared */
|
/** UI shared */
|
||||||
private static AdempiereCheckBoxUI s_checkBoxUI = new AdempiereCheckBoxUI();
|
private static CompiereCheckBoxUI s_checkBoxUI = new CompiereCheckBoxUI();
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -61,7 +61,7 @@ public class AdempiereCheckBoxUI extends MetalCheckBoxUI
|
||||||
*/
|
*/
|
||||||
protected BasicButtonListener createButtonListener (AbstractButton b)
|
protected BasicButtonListener createButtonListener (AbstractButton b)
|
||||||
{
|
{
|
||||||
return new AdempiereButtonListener(b);
|
return new CompiereButtonListener(b);
|
||||||
} // createButtonListener
|
} // createButtonListener
|
||||||
|
|
||||||
} // AdempiereCheckBoxUI
|
} // AdempiereCheckBoxUI
|
|
@ -24,6 +24,10 @@ import java.util.*;
|
||||||
import java.util.logging.*;
|
import java.util.logging.*;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.plaf.*;
|
import javax.swing.plaf.*;
|
||||||
|
|
||||||
|
import org.adempiere.plaf.AdempierePLAF;
|
||||||
|
import org.compiere.swing.ColorBlind;
|
||||||
|
import org.compiere.swing.ThemeUtils;
|
||||||
import org.compiere.util.*;
|
import org.compiere.util.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -32,7 +36,7 @@ import org.compiere.util.*;
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: AdempiereColor.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
* @version $Id: AdempiereColor.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
||||||
*/
|
*/
|
||||||
public class AdempiereColor implements Serializable
|
public class CompiereColor implements Serializable
|
||||||
{
|
{
|
||||||
/** Background type Flat */
|
/** Background type Flat */
|
||||||
public static final String TYPE_FLAT = "F";
|
public static final String TYPE_FLAT = "F";
|
||||||
|
@ -100,7 +104,7 @@ public class AdempiereColor implements Serializable
|
||||||
*/
|
*/
|
||||||
public static void setBackground (JComponent c)
|
public static void setBackground (JComponent c)
|
||||||
{
|
{
|
||||||
setBackground (c, AdempierePanelUI.getDefaultBackground());
|
setBackground (c, new CompiereColor(AdempierePLAF.getFormBackground()));
|
||||||
} // setBackground
|
} // setBackground
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -108,9 +112,9 @@ public class AdempiereColor implements Serializable
|
||||||
* @param c Component
|
* @param c Component
|
||||||
* @param cc Color
|
* @param cc Color
|
||||||
*/
|
*/
|
||||||
public static void setBackground (JComponent c, AdempiereColor cc)
|
public static void setBackground (JComponent c, CompiereColor cc)
|
||||||
{
|
{
|
||||||
c.putClientProperty(AdempierePLAF.BACKGROUND, cc);
|
c.putClientProperty(CompiereLookAndFeel.BACKGROUND, cc);
|
||||||
} // setBackground
|
} // setBackground
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -118,12 +122,12 @@ public class AdempiereColor implements Serializable
|
||||||
* @param c JComponent
|
* @param c JComponent
|
||||||
* @return Color
|
* @return Color
|
||||||
*/
|
*/
|
||||||
public static AdempiereColor getBackground (JComponent c)
|
public static CompiereColor getBackground (JComponent c)
|
||||||
{
|
{
|
||||||
AdempiereColor bg = null;
|
CompiereColor bg = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
bg = (AdempiereColor)c.getClientProperty(AdempierePLAF.BACKGROUND);
|
bg = (CompiereColor)c.getClientProperty(CompiereLookAndFeel.BACKGROUND);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -138,7 +142,7 @@ public class AdempiereColor implements Serializable
|
||||||
*/
|
*/
|
||||||
public static void setBackground (Window win)
|
public static void setBackground (Window win)
|
||||||
{
|
{
|
||||||
setBackground (win, AdempierePanelUI.getDefaultBackground());
|
setBackground (win, new CompiereColor(AdempierePLAF.getFormBackground()));
|
||||||
} // setBackground
|
} // setBackground
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -146,73 +150,43 @@ public class AdempiereColor implements Serializable
|
||||||
* @param win window
|
* @param win window
|
||||||
* @param cc adempiere color
|
* @param cc adempiere color
|
||||||
*/
|
*/
|
||||||
public static void setBackground (Window win, AdempiereColor cc)
|
public static void setBackground (Window win, CompiereColor cc)
|
||||||
{
|
{
|
||||||
if (win instanceof JDialog)
|
if (win instanceof JDialog)
|
||||||
{
|
{
|
||||||
((JPanel)((JDialog)win).getContentPane()).putClientProperty(AdempierePLAF.BACKGROUND, cc);
|
((JPanel)((JDialog)win).getContentPane()).putClientProperty(CompiereLookAndFeel.BACKGROUND, cc);
|
||||||
// ((JPanel)((JDialog)win).getContentPane()).setName("contentPane");
|
// ((JPanel)((JDialog)win).getContentPane()).setName("contentPane");
|
||||||
}
|
}
|
||||||
else if (win instanceof JFrame)
|
else if (win instanceof JFrame)
|
||||||
{
|
{
|
||||||
((JPanel)((JFrame)win).getContentPane()).putClientProperty(AdempierePLAF.BACKGROUND, cc);
|
((JPanel)((JFrame)win).getContentPane()).putClientProperty(CompiereLookAndFeel.BACKGROUND, cc);
|
||||||
// ((JPanel)((JFrame)win).getContentPane()).setName("contentPane");
|
// ((JPanel)((JFrame)win).getContentPane()).setName("contentPane");
|
||||||
}
|
}
|
||||||
else if (win instanceof JWindow)
|
else if (win instanceof JWindow)
|
||||||
{
|
{
|
||||||
((JPanel)((JWindow)win).getContentPane()).putClientProperty(AdempierePLAF.BACKGROUND, cc);
|
((JPanel)((JWindow)win).getContentPane()).putClientProperty(CompiereLookAndFeel.BACKGROUND, cc);
|
||||||
// ((JPanel)((JWindow)win).getContentPane()).setName("contentPane");
|
// ((JPanel)((JWindow)win).getContentPane()).setName("contentPane");
|
||||||
}
|
}
|
||||||
} // setBackground
|
} // setBackground
|
||||||
|
|
||||||
/**
|
|
||||||
* Set Default Background
|
|
||||||
* @param bg Background Color
|
|
||||||
* @see AdempierePanelUI#setDefaultBackground
|
|
||||||
*/
|
|
||||||
public static void setDefaultBackground (AdempiereColor bg)
|
|
||||||
{
|
|
||||||
AdempierePanelUI.setDefaultBackground(bg);
|
|
||||||
} // setDefaultBackground
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Default Background
|
* Get Default Background
|
||||||
* @return Background
|
* @return Background
|
||||||
* @see AdempierePanelUI#getDefaultBackground
|
* @see CompierePanelUI#getDefaultBackground
|
||||||
*/
|
*/
|
||||||
public static AdempiereColor getDefaultBackground()
|
public static CompiereColor getDefaultBackground()
|
||||||
{
|
{
|
||||||
return AdempierePanelUI.getDefaultBackground();
|
return new CompiereColor(AdempierePLAF.getFormBackground());
|
||||||
} // getDefaultBackground
|
} // getDefaultBackground
|
||||||
|
|
||||||
/**
|
|
||||||
* Set Default Background
|
|
||||||
* @param setDefault if true, the background will be set to the default color
|
|
||||||
* @see AdempierePanelUI#setSetDefault
|
|
||||||
*/
|
|
||||||
public static void setSetDefault (boolean setDefault)
|
|
||||||
{
|
|
||||||
AdempierePanelUI.setSetDefault(setDefault);
|
|
||||||
} // setSetDefault
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Is the Default Background set by default
|
|
||||||
* @return true if default background is set
|
|
||||||
* @see AdempierePanelUI#isSetDefault
|
|
||||||
*/
|
|
||||||
public static boolean isSetDefault()
|
|
||||||
{
|
|
||||||
return AdempierePanelUI.isSetDefault();
|
|
||||||
} // isSetDefault
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parse attributes and return AdempiereColor
|
* Parse attributes and return AdempiereColor
|
||||||
* @param attributes attributes
|
* @param attributes attributes
|
||||||
* @return AdempiereColor
|
* @return AdempiereColor
|
||||||
*/
|
*/
|
||||||
public static AdempiereColor parse (String attributes)
|
public static CompiereColor parse (String attributes)
|
||||||
{
|
{
|
||||||
AdempiereColor cc = new AdempiereColor ();
|
CompiereColor cc = new CompiereColor ();
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (attributes != null && attributes.length() > 0)
|
if (attributes != null && attributes.length() > 0)
|
||||||
|
@ -229,7 +203,7 @@ public class AdempiereColor implements Serializable
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* Create Gradient Background Color (Window System Color - White)
|
* Create Gradient Background Color (Window System Color - White)
|
||||||
*/
|
*/
|
||||||
public AdempiereColor()
|
public CompiereColor()
|
||||||
{
|
{
|
||||||
this (TYPE_GRADIENT);
|
this (TYPE_GRADIENT);
|
||||||
} // AdempiereColor
|
} // AdempiereColor
|
||||||
|
@ -238,7 +212,7 @@ public class AdempiereColor implements Serializable
|
||||||
* Create Default Background Colors of Type
|
* Create Default Background Colors of Type
|
||||||
* @param type Background type (see constants TYPE_*)
|
* @param type Background type (see constants TYPE_*)
|
||||||
*/
|
*/
|
||||||
public AdempiereColor (String type)
|
public CompiereColor (String type)
|
||||||
{
|
{
|
||||||
if (type == null)
|
if (type == null)
|
||||||
new java.lang.IllegalArgumentException (EXCEPTION_TEXT);
|
new java.lang.IllegalArgumentException (EXCEPTION_TEXT);
|
||||||
|
@ -255,7 +229,7 @@ public class AdempiereColor implements Serializable
|
||||||
* Create Flat Background Color
|
* Create Flat Background Color
|
||||||
* @param bg background
|
* @param bg background
|
||||||
*/
|
*/
|
||||||
public AdempiereColor (Color bg)
|
public CompiereColor (Color bg)
|
||||||
{
|
{
|
||||||
this (bg, true);
|
this (bg, true);
|
||||||
} // AdempiereColor
|
} // AdempiereColor
|
||||||
|
@ -265,7 +239,7 @@ public class AdempiereColor implements Serializable
|
||||||
* @param bg Color
|
* @param bg Color
|
||||||
* @param flat if true create Flat color otherwise Gradient color with white lower color
|
* @param flat if true create Flat color otherwise Gradient color with white lower color
|
||||||
*/
|
*/
|
||||||
public AdempiereColor (Color bg, boolean flat)
|
public CompiereColor (Color bg, boolean flat)
|
||||||
{
|
{
|
||||||
if (bg == null)
|
if (bg == null)
|
||||||
new java.lang.IllegalArgumentException (EXCEPTION_TEXT);
|
new java.lang.IllegalArgumentException (EXCEPTION_TEXT);
|
||||||
|
@ -280,7 +254,7 @@ public class AdempiereColor implements Serializable
|
||||||
* @param startPoint Starting point - e.g. SOUTH_WEST see SwingConstants, default NORTH_WEST
|
* @param startPoint Starting point - e.g. SOUTH_WEST see SwingConstants, default NORTH_WEST
|
||||||
* @param repeatDistance X/Y Distance to repeat gradient in points - 0 no repeats
|
* @param repeatDistance X/Y Distance to repeat gradient in points - 0 no repeats
|
||||||
*/
|
*/
|
||||||
public AdempiereColor (Color upperColor, Color lowerColor, int startPoint, int repeatDistance)
|
public CompiereColor (Color upperColor, Color lowerColor, int startPoint, int repeatDistance)
|
||||||
{
|
{
|
||||||
if (upperColor == null || lowerColor == null)
|
if (upperColor == null || lowerColor == null)
|
||||||
new java.lang.IllegalArgumentException (EXCEPTION_TEXT);
|
new java.lang.IllegalArgumentException (EXCEPTION_TEXT);
|
||||||
|
@ -297,7 +271,7 @@ public class AdempiereColor implements Serializable
|
||||||
* @param upperColor upper color
|
* @param upperColor upper color
|
||||||
* @param lowerColor lower color
|
* @param lowerColor lower color
|
||||||
*/
|
*/
|
||||||
public AdempiereColor (Color upperColor, Color lowerColor)
|
public CompiereColor (Color upperColor, Color lowerColor)
|
||||||
{
|
{
|
||||||
this (upperColor, lowerColor, SwingConstants.NORTH_WEST, 100);
|
this (upperColor, lowerColor, SwingConstants.NORTH_WEST, 100);
|
||||||
} // AdempiereColor
|
} // AdempiereColor
|
||||||
|
@ -309,7 +283,7 @@ public class AdempiereColor implements Serializable
|
||||||
* @param taint Color to taint the texture (use white for not tainting it)
|
* @param taint Color to taint the texture (use white for not tainting it)
|
||||||
* @param compositeAlpha Value from 0(no) to 1(full) taining
|
* @param compositeAlpha Value from 0(no) to 1(full) taining
|
||||||
*/
|
*/
|
||||||
public AdempiereColor (URL textureURL, Color taint, float compositeAlpha)
|
public CompiereColor (URL textureURL, Color taint, float compositeAlpha)
|
||||||
{
|
{
|
||||||
if (textureURL == null || taint == null)
|
if (textureURL == null || taint == null)
|
||||||
new java.lang.IllegalArgumentException (EXCEPTION_TEXT);
|
new java.lang.IllegalArgumentException (EXCEPTION_TEXT);
|
||||||
|
@ -326,7 +300,7 @@ public class AdempiereColor implements Serializable
|
||||||
* @param taint Color to taint the texture (use white for not tainting it)
|
* @param taint Color to taint the texture (use white for not tainting it)
|
||||||
* @param compositeAlpha Tainting value from 0 (no - FullGraph) to 1 (full - NoGraph)
|
* @param compositeAlpha Tainting value from 0 (no - FullGraph) to 1 (full - NoGraph)
|
||||||
*/
|
*/
|
||||||
public AdempiereColor (String textureURL, Color taint, float compositeAlpha)
|
public CompiereColor (String textureURL, Color taint, float compositeAlpha)
|
||||||
{
|
{
|
||||||
if (textureURL == null || taint == null)
|
if (textureURL == null || taint == null)
|
||||||
new java.lang.IllegalArgumentException (EXCEPTION_TEXT);
|
new java.lang.IllegalArgumentException (EXCEPTION_TEXT);
|
||||||
|
@ -344,7 +318,7 @@ public class AdempiereColor implements Serializable
|
||||||
* @param lineWidth Stroke width in point
|
* @param lineWidth Stroke width in point
|
||||||
* @param lineDistance Distance between lines in points
|
* @param lineDistance Distance between lines in points
|
||||||
*/
|
*/
|
||||||
public AdempiereColor (Color lineColor, Color backColor, float lineWidth, int lineDistance)
|
public CompiereColor (Color lineColor, Color backColor, float lineWidth, int lineDistance)
|
||||||
{
|
{
|
||||||
if (lineColor == null || backColor == null)
|
if (lineColor == null || backColor == null)
|
||||||
new java.lang.IllegalArgumentException (EXCEPTION_TEXT);
|
new java.lang.IllegalArgumentException (EXCEPTION_TEXT);
|
||||||
|
@ -359,7 +333,7 @@ public class AdempiereColor implements Serializable
|
||||||
* Copy Color
|
* Copy Color
|
||||||
* @param cc color
|
* @param cc color
|
||||||
*/
|
*/
|
||||||
public AdempiereColor (AdempiereColor cc)
|
public CompiereColor (CompiereColor cc)
|
||||||
{
|
{
|
||||||
if (cc == null)
|
if (cc == null)
|
||||||
return;
|
return;
|
||||||
|
@ -401,7 +375,7 @@ public class AdempiereColor implements Serializable
|
||||||
/** Diry marker for repaining Background */
|
/** Diry marker for repaining Background */
|
||||||
private boolean m_dirty = true;
|
private boolean m_dirty = true;
|
||||||
/** Logger */
|
/** Logger */
|
||||||
private static Logger log = Logger.getLogger(AdempiereColor.class.getName());
|
private static Logger log = Logger.getLogger(CompiereColor.class.getName());
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* Get BackgroundType (Flat, Gradient, Lines, Texture)
|
* Get BackgroundType (Flat, Gradient, Lines, Texture)
|
||||||
|
@ -596,7 +570,7 @@ public class AdempiereColor implements Serializable
|
||||||
if (!isTexture())
|
if (!isTexture())
|
||||||
return null;
|
return null;
|
||||||
if (m_textureURL == null)
|
if (m_textureURL == null)
|
||||||
m_textureURL = AdempiereColor.class.getResource("Adempiere00x100.gif");
|
m_textureURL = CompiereColor.class.getResource("Adempiere00x100.gif");
|
||||||
return m_textureURL;
|
return m_textureURL;
|
||||||
} // getTextureURL
|
} // getTextureURL
|
||||||
|
|
||||||
|
@ -609,7 +583,7 @@ public class AdempiereColor implements Serializable
|
||||||
if (m_image == null)
|
if (m_image == null)
|
||||||
{
|
{
|
||||||
URL url = getTextureURL();
|
URL url = getTextureURL();
|
||||||
m_image = AdempiereUtils.loadBufferedImage(url, BufferedImage.TYPE_INT_ARGB_PRE);
|
m_image = CompiereUtils.loadBufferedImage(url, BufferedImage.TYPE_INT_ARGB_PRE);
|
||||||
}
|
}
|
||||||
return m_image;
|
return m_image;
|
||||||
} // getTextureImage
|
} // getTextureImage
|
||||||
|
@ -856,7 +830,7 @@ public class AdempiereColor implements Serializable
|
||||||
* Set AdempiereColor from AdempiereColor
|
* Set AdempiereColor from AdempiereColor
|
||||||
* @param cc AdempiereColor
|
* @param cc AdempiereColor
|
||||||
*/
|
*/
|
||||||
public void setColor (AdempiereColor cc)
|
public void setColor (CompiereColor cc)
|
||||||
{
|
{
|
||||||
if (cc == null)
|
if (cc == null)
|
||||||
return;
|
return;
|
||||||
|
@ -946,23 +920,23 @@ public class AdempiereColor implements Serializable
|
||||||
StringBuffer sb = new StringBuffer ("AdempiereColor[");
|
StringBuffer sb = new StringBuffer ("AdempiereColor[");
|
||||||
if (isFlat())
|
if (isFlat())
|
||||||
sb.append("Flat")
|
sb.append("Flat")
|
||||||
.append(" ").append(CompiereTheme.getColorAsString(getFlatColor()));
|
.append(" ").append(ThemeUtils.getColorAsString(getFlatColor()));
|
||||||
else if (isGradient())
|
else if (isGradient())
|
||||||
sb.append("Gradient")
|
sb.append("Gradient")
|
||||||
.append(" Upper=").append(CompiereTheme.getColorAsString(getGradientUpperColor()))
|
.append(" Upper=").append(ThemeUtils.getColorAsString(getGradientUpperColor()))
|
||||||
.append(",Lower=").append(CompiereTheme.getColorAsString(getGradientLowerColor()))
|
.append(",Lower=").append(ThemeUtils.getColorAsString(getGradientLowerColor()))
|
||||||
.append(",Start=").append(getGradientStartPoint())
|
.append(",Start=").append(getGradientStartPoint())
|
||||||
.append(",RDistance=").append(getGradientRepeatDistance());
|
.append(",RDistance=").append(getGradientRepeatDistance());
|
||||||
else if (isLine())
|
else if (isLine())
|
||||||
sb.append("Line")
|
sb.append("Line")
|
||||||
.append(" Color=").append(CompiereTheme.getColorAsString(getLineColor()))
|
.append(" Color=").append(ThemeUtils.getColorAsString(getLineColor()))
|
||||||
.append(",BackColor=").append(CompiereTheme.getColorAsString(getLineBackColor()))
|
.append(",BackColor=").append(ThemeUtils.getColorAsString(getLineBackColor()))
|
||||||
.append(",Width=").append(getLineWidth())
|
.append(",Width=").append(getLineWidth())
|
||||||
.append(",Distance=").append(getLineDistance());
|
.append(",Distance=").append(getLineDistance());
|
||||||
else if (isTexture())
|
else if (isTexture())
|
||||||
sb.append("Texture")
|
sb.append("Texture")
|
||||||
.append(" GraphURL=").append(getTextureURL())
|
.append(" GraphURL=").append(getTextureURL())
|
||||||
.append(",Taint=").append(CompiereTheme.getColorAsString(getTextureTaintColor()))
|
.append(",Taint=").append(ThemeUtils.getColorAsString(getTextureTaintColor()))
|
||||||
.append(",Alpha=").append(getTextureCompositeAlpha());
|
.append(",Alpha=").append(getTextureCompositeAlpha());
|
||||||
sb.append("]");
|
sb.append("]");
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
|
@ -977,15 +951,15 @@ public class AdempiereColor implements Serializable
|
||||||
if (str.indexOf("[Flat ") != -1)
|
if (str.indexOf("[Flat ") != -1)
|
||||||
{
|
{
|
||||||
m_type = TYPE_FLAT;
|
m_type = TYPE_FLAT;
|
||||||
m_primaryColor = CompiereTheme.parseColor(str,
|
m_primaryColor = ThemeUtils.parseColor(str,
|
||||||
new ColorUIResource(m_primaryColor));
|
new ColorUIResource(m_primaryColor));
|
||||||
}
|
}
|
||||||
else if (str.indexOf("[Gradient ") != -1)
|
else if (str.indexOf("[Gradient ") != -1)
|
||||||
{
|
{
|
||||||
m_type = TYPE_GRADIENT;
|
m_type = TYPE_GRADIENT;
|
||||||
m_primaryColor = CompiereTheme.parseColor(str.substring(str.indexOf(" Upper=")+7, str.indexOf(",Lower=")),
|
m_primaryColor = ThemeUtils.parseColor(str.substring(str.indexOf(" Upper=")+7, str.indexOf(",Lower=")),
|
||||||
new ColorUIResource(m_primaryColor));
|
new ColorUIResource(m_primaryColor));
|
||||||
m_secondaryColor = CompiereTheme.parseColor(str.substring(str.indexOf(",Lower=")+7, str.indexOf(",Start=")),
|
m_secondaryColor = ThemeUtils.parseColor(str.substring(str.indexOf(",Lower=")+7, str.indexOf(",Start=")),
|
||||||
new ColorUIResource(m_secondaryColor));
|
new ColorUIResource(m_secondaryColor));
|
||||||
m_startPoint = Integer.parseInt(str.substring(str.indexOf(",Start=")+7, str.indexOf(",RDistance=")));
|
m_startPoint = Integer.parseInt(str.substring(str.indexOf(",Start=")+7, str.indexOf(",RDistance=")));
|
||||||
setGradientRepeatDistance(str.substring(str.indexOf(",RDistance=")+11, str.lastIndexOf("]")));
|
setGradientRepeatDistance(str.substring(str.indexOf(",RDistance=")+11, str.lastIndexOf("]")));
|
||||||
|
@ -993,9 +967,9 @@ public class AdempiereColor implements Serializable
|
||||||
else if (str.indexOf("[Line ") != -1)
|
else if (str.indexOf("[Line ") != -1)
|
||||||
{
|
{
|
||||||
m_type = TYPE_LINES;
|
m_type = TYPE_LINES;
|
||||||
m_primaryColor = CompiereTheme.parseColor(str.substring(str.indexOf(" Color=")+7, str.indexOf(",BackColor=")),
|
m_primaryColor = ThemeUtils.parseColor(str.substring(str.indexOf(" Color=")+7, str.indexOf(",BackColor=")),
|
||||||
new ColorUIResource(m_primaryColor));
|
new ColorUIResource(m_primaryColor));
|
||||||
m_secondaryColor = CompiereTheme.parseColor(str.substring(str.indexOf(",BackColor=")+11, str.indexOf(",Width=")),
|
m_secondaryColor = ThemeUtils.parseColor(str.substring(str.indexOf(",BackColor=")+11, str.indexOf(",Width=")),
|
||||||
new ColorUIResource(m_secondaryColor));
|
new ColorUIResource(m_secondaryColor));
|
||||||
setLineWidth(str.substring(str.indexOf(",Width=")+7, str.indexOf(",Distance=")));
|
setLineWidth(str.substring(str.indexOf(",Width=")+7, str.indexOf(",Distance=")));
|
||||||
setLineDistance(str.substring(str.indexOf(",Distance=")+10, str.lastIndexOf("]")));
|
setLineDistance(str.substring(str.indexOf(",Distance=")+10, str.lastIndexOf("]")));
|
||||||
|
@ -1004,7 +978,7 @@ public class AdempiereColor implements Serializable
|
||||||
{
|
{
|
||||||
m_type = TYPE_TEXTURE;
|
m_type = TYPE_TEXTURE;
|
||||||
setTextureURL (str.substring(str.indexOf(" GraphURL=")+10, str.indexOf(",Taint=")));
|
setTextureURL (str.substring(str.indexOf(" GraphURL=")+10, str.indexOf(",Taint=")));
|
||||||
m_primaryColor = CompiereTheme.parseColor(str.substring(str.indexOf(",Taint=")+7, str.indexOf(",Alpha=")),
|
m_primaryColor = ThemeUtils.parseColor(str.substring(str.indexOf(",Taint=")+7, str.indexOf(",Alpha=")),
|
||||||
new ColorUIResource(m_primaryColor));
|
new ColorUIResource(m_primaryColor));
|
||||||
setTextureCompositeAlpha (str.substring(str.indexOf(",Alpha=")+7, str.lastIndexOf("]")));
|
setTextureCompositeAlpha (str.substring(str.indexOf(",Alpha=")+7, str.lastIndexOf("]")));
|
||||||
}
|
}
|
|
@ -30,7 +30,7 @@ import javax.swing.plaf.metal.*;
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: AdempiereComboBoxUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
* @version $Id: AdempiereComboBoxUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
||||||
*/
|
*/
|
||||||
public class AdempiereComboBoxUI extends MetalComboBoxUI
|
public class CompiereComboBoxUI extends MetalComboBoxUI
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Create UI
|
* Create UI
|
||||||
|
@ -39,7 +39,7 @@ public class AdempiereComboBoxUI extends MetalComboBoxUI
|
||||||
*/
|
*/
|
||||||
public static ComponentUI createUI(JComponent c)
|
public static ComponentUI createUI(JComponent c)
|
||||||
{
|
{
|
||||||
return new AdempiereComboBoxUI();
|
return new CompiereComboBoxUI();
|
||||||
} // CreateUI
|
} // CreateUI
|
||||||
|
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
@ -102,7 +102,7 @@ public class AdempiereComboBoxUI extends MetalComboBoxUI
|
||||||
*/
|
*/
|
||||||
protected ComboPopup createPopup()
|
protected ComboPopup createPopup()
|
||||||
{
|
{
|
||||||
AdempiereComboPopup newPopup = new AdempiereComboPopup( comboBox );
|
CompiereComboPopup newPopup = new CompiereComboPopup( comboBox );
|
||||||
newPopup.getAccessibleContext().setAccessibleParent(comboBox);
|
newPopup.getAccessibleContext().setAccessibleParent(comboBox);
|
||||||
return newPopup;
|
return newPopup;
|
||||||
} // createPopup
|
} // createPopup
|
|
@ -26,13 +26,13 @@ import org.compiere.swing.*;
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: AdempiereComboPopup.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
* @version $Id: AdempiereComboPopup.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
||||||
*/
|
*/
|
||||||
public class AdempiereComboPopup extends BasicComboPopup
|
public class CompiereComboPopup extends BasicComboPopup
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
* @param combo
|
* @param combo
|
||||||
*/
|
*/
|
||||||
public AdempiereComboPopup(JComboBox combo)
|
public CompiereComboPopup(JComboBox combo)
|
||||||
{
|
{
|
||||||
super(combo);
|
super(combo);
|
||||||
} // AdempiereComboPopup
|
} // AdempiereComboPopup
|
|
@ -30,17 +30,17 @@ import sun.swing.*;
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: AdempiereLabelUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
* @version $Id: AdempiereLabelUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
||||||
*/
|
*/
|
||||||
public class AdempiereLabelUI extends MetalLabelUI
|
public class CompiereLabelUI extends MetalLabelUI
|
||||||
{
|
{
|
||||||
/** Singleton */
|
/** Singleton */
|
||||||
protected static AdempiereLabelUI adempiereLabelUI = new AdempiereLabelUI();
|
protected static CompiereLabelUI adempiereLabelUI = new CompiereLabelUI();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create UI
|
* Create UI
|
||||||
* @param c component
|
* @param c component
|
||||||
* @return singleton
|
* @return singleton
|
||||||
*/
|
*/
|
||||||
public static AdempiereLabelUI createUI(JComponent c)
|
public static CompiereLabelUI createUI(JComponent c)
|
||||||
{
|
{
|
||||||
return adempiereLabelUI;
|
return adempiereLabelUI;
|
||||||
} // createUI
|
} // createUI
|
|
@ -22,7 +22,7 @@ import javax.swing.*;
|
||||||
import javax.swing.plaf.metal.*;
|
import javax.swing.plaf.metal.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adempiere Look & Feel.
|
* Compiere Look & Feel.
|
||||||
* We wanted a nice UI not the battleship gray based stuff.
|
* We wanted a nice UI not the battleship gray based stuff.
|
||||||
* I guess a matter of taste.
|
* I guess a matter of taste.
|
||||||
* <code>
|
* <code>
|
||||||
|
@ -49,12 +49,22 @@ public class CompiereLookAndFeel extends MetalLookAndFeel
|
||||||
public static final String NAME = "Compiere";
|
public static final String NAME = "Compiere";
|
||||||
|
|
||||||
/** The Theme */
|
/** The Theme */
|
||||||
private static CompiereTheme s_adempiereTheme = new CompiereThemeBlueMetal();
|
private static CompiereTheme s_compiereTheme = new CompiereThemeBlueMetal();
|
||||||
private static MetalTheme s_theme = s_adempiereTheme;
|
private static MetalTheme s_theme = s_compiereTheme;
|
||||||
|
|
||||||
/** Paint Round Corners */
|
/** Paint Round Corners */
|
||||||
protected static boolean ROUND = false;
|
protected static boolean ROUND = false;
|
||||||
|
|
||||||
|
/** Key of Client Property to paint in CompiereColor */
|
||||||
|
public static final String BACKGROUND = "CompiereBackground";
|
||||||
|
/** Key of Client Property for Rectangle Items - if exists, the standard background is used */
|
||||||
|
public static final String BACKGROUND_FILL = "CompiereBackgroundFill";
|
||||||
|
/** Key of Client Property for CPanel */
|
||||||
|
public static final String TABLEVEL = "CompiereTabLevel";
|
||||||
|
|
||||||
|
/** Version tag */
|
||||||
|
public static final String VERSION = "R1.4.0";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The Name
|
* The Name
|
||||||
* @return Name
|
* @return Name
|
||||||
|
@ -79,7 +89,7 @@ public class CompiereLookAndFeel extends MetalLookAndFeel
|
||||||
*/
|
*/
|
||||||
public String getDescription()
|
public String getDescription()
|
||||||
{
|
{
|
||||||
return "Adempiere Look & Feel - (c) 2001-2005 Jorg Janke";
|
return "Compiere Look & Feel - (c) 2001-2005 Jorg Janke";
|
||||||
} // getDescription
|
} // getDescription
|
||||||
|
|
||||||
|
|
||||||
|
@ -89,7 +99,6 @@ public class CompiereLookAndFeel extends MetalLookAndFeel
|
||||||
*/
|
*/
|
||||||
public UIDefaults getDefaults()
|
public UIDefaults getDefaults()
|
||||||
{
|
{
|
||||||
// System.out.println("AdempiereLookAndFeel.getDefaults");
|
|
||||||
// Theme already created/set
|
// Theme already created/set
|
||||||
MetalLookAndFeel.setCurrentTheme(s_theme);
|
MetalLookAndFeel.setCurrentTheme(s_theme);
|
||||||
UIDefaults defaults = super.getDefaults(); // calls init..Defaults
|
UIDefaults defaults = super.getDefaults(); // calls init..Defaults
|
||||||
|
@ -105,7 +114,6 @@ public class CompiereLookAndFeel extends MetalLookAndFeel
|
||||||
*/
|
*/
|
||||||
protected void initClassDefaults(UIDefaults table)
|
protected void initClassDefaults(UIDefaults table)
|
||||||
{
|
{
|
||||||
// System.out.println("AdempiereLookAndFeel.initClassDefaults");
|
|
||||||
super.initClassDefaults( table);
|
super.initClassDefaults( table);
|
||||||
// Overwrite
|
// Overwrite
|
||||||
putDefault (table, "PanelUI");
|
putDefault (table, "PanelUI");
|
||||||
|
@ -140,7 +148,7 @@ public class CompiereLookAndFeel extends MetalLookAndFeel
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
String className = "org.compiere.plaf.Adempiere" + uiKey;
|
String className = "org.compiere.plaf.Compiere" + uiKey;
|
||||||
table.put(uiKey, className);
|
table.put(uiKey, className);
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
@ -155,11 +163,7 @@ public class CompiereLookAndFeel extends MetalLookAndFeel
|
||||||
*/
|
*/
|
||||||
protected void initSystemColorDefaults (UIDefaults table)
|
protected void initSystemColorDefaults (UIDefaults table)
|
||||||
{
|
{
|
||||||
// System.out.println("AdempiereLookAndFeel.initSystemColorDefaults");
|
|
||||||
super.initSystemColorDefaults( table);
|
super.initSystemColorDefaults( table);
|
||||||
|
|
||||||
// we made the color a bit darker
|
|
||||||
// table.put("textHighlight", AdempiereUtils.getTranslucentColor(getTextHighlightColor(), 128));
|
|
||||||
} // initSystemColorDefaults
|
} // initSystemColorDefaults
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -168,7 +172,6 @@ public class CompiereLookAndFeel extends MetalLookAndFeel
|
||||||
*/
|
*/
|
||||||
protected void initComponentDefaults (UIDefaults table)
|
protected void initComponentDefaults (UIDefaults table)
|
||||||
{
|
{
|
||||||
// System.out.println("AdempiereLookAndFeel.initComponentDefaults");
|
|
||||||
super.initComponentDefaults( table);
|
super.initComponentDefaults( table);
|
||||||
|
|
||||||
// ComboBox defaults
|
// ComboBox defaults
|
||||||
|
@ -207,12 +210,12 @@ public class CompiereLookAndFeel extends MetalLookAndFeel
|
||||||
} // getCurrentTheme
|
} // getCurrentTheme
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Adempiere Theme
|
* Get Compiere Theme
|
||||||
* @return Metal Theme
|
* @return Metal Theme
|
||||||
*/
|
*/
|
||||||
public static CompiereTheme getAdempiereTheme()
|
public static CompiereTheme getCompiereTheme()
|
||||||
{
|
{
|
||||||
return s_adempiereTheme;
|
return s_compiereTheme;
|
||||||
} // getCurrentTheme
|
} // getCurrentTheme
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -28,7 +28,7 @@ import javax.swing.plaf.metal.*;
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: AdempiereMenuBarUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
* @version $Id: AdempiereMenuBarUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
||||||
*/
|
*/
|
||||||
public class AdempiereMenuBarUI extends MetalMenuBarUI
|
public class CompiereMenuBarUI extends MetalMenuBarUI
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Create own instance
|
* Create own instance
|
||||||
|
@ -37,7 +37,7 @@ public class AdempiereMenuBarUI extends MetalMenuBarUI
|
||||||
*/
|
*/
|
||||||
public static ComponentUI createUI (JComponent x)
|
public static ComponentUI createUI (JComponent x)
|
||||||
{
|
{
|
||||||
return new AdempiereMenuBarUI();
|
return new CompiereMenuBarUI();
|
||||||
} // createUI
|
} // createUI
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -60,7 +60,7 @@ public class AdempiereMenuBarUI extends MetalMenuBarUI
|
||||||
if (c.isOpaque())
|
if (c.isOpaque())
|
||||||
{
|
{
|
||||||
// Get AdempiereColor
|
// Get AdempiereColor
|
||||||
AdempiereColor bg = AdempiereColor.getDefaultBackground();
|
CompiereColor bg = CompiereColor.getDefaultBackground();
|
||||||
bg.paint (g, c);
|
bg.paint (g, c);
|
||||||
}
|
}
|
||||||
else
|
else
|
|
@ -27,7 +27,7 @@ import javax.swing.plaf.basic.*;
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: AdempiereMenuItemUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
* @version $Id: AdempiereMenuItemUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
||||||
*/
|
*/
|
||||||
public class AdempiereMenuItemUI extends BasicMenuItemUI
|
public class CompiereMenuItemUI extends BasicMenuItemUI
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Create own instance
|
* Create own instance
|
||||||
|
@ -36,7 +36,7 @@ public class AdempiereMenuItemUI extends BasicMenuItemUI
|
||||||
*/
|
*/
|
||||||
public static ComponentUI createUI(JComponent c)
|
public static ComponentUI createUI(JComponent c)
|
||||||
{
|
{
|
||||||
return new AdempiereMenuItemUI();
|
return new CompiereMenuItemUI();
|
||||||
} // createUI
|
} // createUI
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -58,7 +58,7 @@ public class AdempiereMenuItemUI extends BasicMenuItemUI
|
||||||
{
|
{
|
||||||
if (c.isOpaque())
|
if (c.isOpaque())
|
||||||
{
|
{
|
||||||
AdempiereColor bg = AdempiereColor.getDefaultBackground();
|
CompiereColor bg = CompiereColor.getDefaultBackground();
|
||||||
bg.paint (g, c);
|
bg.paint (g, c);
|
||||||
//
|
//
|
||||||
// g.setColor(c.getBackground());
|
// g.setColor(c.getBackground());
|
||||||
|
@ -80,7 +80,7 @@ public class AdempiereMenuItemUI extends BasicMenuItemUI
|
||||||
super.paintBackground (g, menuItem, bgColor);
|
super.paintBackground (g, menuItem, bgColor);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AdempiereColor bg = AdempiereColor.getDefaultBackground();
|
CompiereColor bg = CompiereColor.getDefaultBackground();
|
||||||
bg.paint (g, menuItem);
|
bg.paint (g, menuItem);
|
||||||
}
|
}
|
||||||
} // paintBackground
|
} // paintBackground
|
|
@ -27,7 +27,7 @@ import javax.swing.plaf.basic.BasicMenuUI;
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: AdempiereMenuUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
* @version $Id: AdempiereMenuUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
||||||
*/
|
*/
|
||||||
public class AdempiereMenuUI extends BasicMenuUI
|
public class CompiereMenuUI extends BasicMenuUI
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Create own instance
|
* Create own instance
|
||||||
|
@ -36,7 +36,7 @@ public class AdempiereMenuUI extends BasicMenuUI
|
||||||
*/
|
*/
|
||||||
public static ComponentUI createUI(JComponent x)
|
public static ComponentUI createUI(JComponent x)
|
||||||
{
|
{
|
||||||
return new AdempiereMenuUI();
|
return new CompiereMenuUI();
|
||||||
} // createUI
|
} // createUI
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -21,6 +21,8 @@ import javax.swing.*;
|
||||||
import javax.swing.plaf.*;
|
import javax.swing.plaf.*;
|
||||||
import javax.swing.plaf.basic.*;
|
import javax.swing.plaf.basic.*;
|
||||||
|
|
||||||
|
import org.adempiere.plaf.AdempierePLAF;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Panel UI.
|
* Panel UI.
|
||||||
* The default properties can be set via
|
* The default properties can be set via
|
||||||
|
@ -37,7 +39,7 @@ import javax.swing.plaf.basic.*;
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: AdempierePanelUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
* @version $Id: AdempierePanelUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
||||||
*/
|
*/
|
||||||
public class AdempierePanelUI extends BasicPanelUI
|
public class CompierePanelUI extends BasicPanelUI
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Static Create UI
|
* Static Create UI
|
||||||
|
@ -51,7 +53,7 @@ public class AdempierePanelUI extends BasicPanelUI
|
||||||
} // createUI
|
} // createUI
|
||||||
|
|
||||||
/** UI */
|
/** UI */
|
||||||
private static AdempierePanelUI s_panelUI = new AdempierePanelUI();
|
private static CompierePanelUI s_panelUI = new CompierePanelUI();
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -104,10 +106,10 @@ public class AdempierePanelUI extends BasicPanelUI
|
||||||
// System.out.print(" - Background: ");
|
// System.out.print(" - Background: ");
|
||||||
|
|
||||||
// Get AdempiereColor
|
// Get AdempiereColor
|
||||||
AdempiereColor bg = null;
|
CompiereColor bg = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
bg = (AdempiereColor)c.getClientProperty(AdempierePLAF.BACKGROUND);
|
bg = (CompiereColor)c.getClientProperty(CompiereLookAndFeel.BACKGROUND);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -130,48 +132,5 @@ public class AdempierePanelUI extends BasicPanelUI
|
||||||
|
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
/** Default Background */
|
|
||||||
private static AdempiereColor s_default = new AdempiereColor();
|
|
||||||
/** Set Background to default setting */
|
|
||||||
private static boolean s_setDefault = false;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set Default Background
|
|
||||||
* @param bg Background Color
|
|
||||||
*/
|
|
||||||
public static void setDefaultBackground (AdempiereColor bg)
|
|
||||||
{
|
|
||||||
if (bg == null)
|
|
||||||
return;
|
|
||||||
s_default.setColor(bg);
|
|
||||||
} // setBackground
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get Default Background
|
|
||||||
* @return Background
|
|
||||||
*/
|
|
||||||
public static AdempiereColor getDefaultBackground()
|
|
||||||
{
|
|
||||||
return s_default;
|
|
||||||
} // getBackground
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set Default Background
|
|
||||||
* @param setDefault if true, the background will be set to the default color
|
|
||||||
*/
|
|
||||||
public static void setSetDefault (boolean setDefault)
|
|
||||||
{
|
|
||||||
s_setDefault = setDefault;
|
|
||||||
} // setSetDefault
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Is the Default Background set by default
|
|
||||||
* @return true if default background is set
|
|
||||||
*/
|
|
||||||
public static boolean isSetDefault()
|
|
||||||
{
|
|
||||||
return s_setDefault;
|
|
||||||
} // isSetDefault
|
|
||||||
|
|
||||||
} // AdempierePanel
|
} // AdempierePanel
|
|
@ -26,7 +26,7 @@ import javax.swing.plaf.metal.*;
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: AdempiereRadioButtonUI.java,v 1.2 2006/07/30 00:52:23 jjanke Exp $
|
* @version $Id: AdempiereRadioButtonUI.java,v 1.2 2006/07/30 00:52:23 jjanke Exp $
|
||||||
*/
|
*/
|
||||||
public class AdempiereRadioButtonUI extends MetalRadioButtonUI
|
public class CompiereRadioButtonUI extends MetalRadioButtonUI
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Create UI
|
* Create UI
|
||||||
|
@ -39,7 +39,7 @@ public class AdempiereRadioButtonUI extends MetalRadioButtonUI
|
||||||
} // createUI
|
} // createUI
|
||||||
|
|
||||||
/** UI */
|
/** UI */
|
||||||
private static final AdempiereRadioButtonUI s_radioButtonUI = new AdempiereRadioButtonUI();
|
private static final CompiereRadioButtonUI s_radioButtonUI = new CompiereRadioButtonUI();
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
|
@ -24,7 +24,7 @@ import javax.swing.plaf.metal.MetalRootPaneUI;
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: AdempiereRootPaneUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
* @version $Id: AdempiereRootPaneUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
||||||
*/
|
*/
|
||||||
public class AdempiereRootPaneUI extends MetalRootPaneUI
|
public class CompiereRootPaneUI extends MetalRootPaneUI
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* MetalTitlePane does the Layout & Painting of the Window including System MenuBar
|
* MetalTitlePane does the Layout & Painting of the Window including System MenuBar
|
|
@ -26,7 +26,7 @@ import javax.swing.plaf.metal.*;
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: AdempiereScrollPaneUI.java,v 1.2 2006/07/30 00:52:23 jjanke Exp $
|
* @version $Id: AdempiereScrollPaneUI.java,v 1.2 2006/07/30 00:52:23 jjanke Exp $
|
||||||
*/
|
*/
|
||||||
public class AdempiereScrollPaneUI extends MetalScrollPaneUI
|
public class CompiereScrollPaneUI extends MetalScrollPaneUI
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Create UI (not shared)
|
* Create UI (not shared)
|
||||||
|
@ -35,7 +35,7 @@ public class AdempiereScrollPaneUI extends MetalScrollPaneUI
|
||||||
*/
|
*/
|
||||||
public static ComponentUI createUI(JComponent x)
|
public static ComponentUI createUI(JComponent x)
|
||||||
{
|
{
|
||||||
return new AdempiereScrollPaneUI();
|
return new CompiereScrollPaneUI();
|
||||||
} // createUI
|
} // createUI
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -25,13 +25,13 @@ import javax.swing.plaf.basic.*;
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: AdempiereSplitPaneDivider.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
* @version $Id: AdempiereSplitPaneDivider.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
||||||
*/
|
*/
|
||||||
class AdempiereSplitPaneDivider extends BasicSplitPaneDivider
|
class CompiereSplitPaneDivider extends BasicSplitPaneDivider
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
* @param ui
|
* @param ui
|
||||||
*/
|
*/
|
||||||
public AdempiereSplitPaneDivider (BasicSplitPaneUI ui)
|
public CompiereSplitPaneDivider (BasicSplitPaneUI ui)
|
||||||
{
|
{
|
||||||
super (ui);
|
super (ui);
|
||||||
// BasicBorders$SplitPaneDividerBorder - ignored set after constructor
|
// BasicBorders$SplitPaneDividerBorder - ignored set after constructor
|
|
@ -27,7 +27,7 @@ import javax.swing.plaf.basic.*;
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: AdempiereSplitPaneUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
* @version $Id: AdempiereSplitPaneUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
||||||
*/
|
*/
|
||||||
public class AdempiereSplitPaneUI extends BasicSplitPaneUI
|
public class CompiereSplitPaneUI extends BasicSplitPaneUI
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Creates a new MetalSplitPaneUI instance
|
* Creates a new MetalSplitPaneUI instance
|
||||||
|
@ -36,7 +36,7 @@ public class AdempiereSplitPaneUI extends BasicSplitPaneUI
|
||||||
*/
|
*/
|
||||||
public static ComponentUI createUI (JComponent x)
|
public static ComponentUI createUI (JComponent x)
|
||||||
{
|
{
|
||||||
return new AdempiereSplitPaneUI();
|
return new CompiereSplitPaneUI();
|
||||||
} // createUI
|
} // createUI
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -45,7 +45,7 @@ public class AdempiereSplitPaneUI extends BasicSplitPaneUI
|
||||||
*/
|
*/
|
||||||
public BasicSplitPaneDivider createDefaultDivider()
|
public BasicSplitPaneDivider createDefaultDivider()
|
||||||
{
|
{
|
||||||
return new AdempiereSplitPaneDivider (this);
|
return new CompiereSplitPaneDivider (this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -22,15 +22,17 @@ import javax.swing.plaf.*;
|
||||||
import javax.swing.plaf.basic.*;
|
import javax.swing.plaf.basic.*;
|
||||||
import javax.swing.plaf.metal.*;
|
import javax.swing.plaf.metal.*;
|
||||||
|
|
||||||
|
import org.adempiere.plaf.AdempierePLAF;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Same implementation detail as in AdempierePanelUI.
|
* Same implementation detail as in AdempierePanelUI.
|
||||||
* Additional handling of dwawing tabs.
|
* Additional handling of dwawing tabs.
|
||||||
* @see AdempierePanelUI
|
* @see CompierePanelUI
|
||||||
*
|
*
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: AdempiereTabbedPaneUI.java,v 1.3 2006/07/30 00:52:23 jjanke Exp $
|
* @version $Id: AdempiereTabbedPaneUI.java,v 1.3 2006/07/30 00:52:23 jjanke Exp $
|
||||||
*/
|
*/
|
||||||
public class AdempiereTabbedPaneUI extends MetalTabbedPaneUI
|
public class CompiereTabbedPaneUI extends MetalTabbedPaneUI
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Static Create UI
|
* Static Create UI
|
||||||
|
@ -39,7 +41,7 @@ public class AdempiereTabbedPaneUI extends MetalTabbedPaneUI
|
||||||
*/
|
*/
|
||||||
public static ComponentUI createUI(JComponent c)
|
public static ComponentUI createUI(JComponent c)
|
||||||
{
|
{
|
||||||
return new AdempiereTabbedPaneUI();
|
return new CompiereTabbedPaneUI();
|
||||||
} // createUI
|
} // createUI
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -82,7 +84,7 @@ public class AdempiereTabbedPaneUI extends MetalTabbedPaneUI
|
||||||
// System.out.println("Tab: Bounds=" + c.getBounds() + " - " + c.getClass().getName());
|
// System.out.println("Tab: Bounds=" + c.getBounds() + " - " + c.getClass().getName());
|
||||||
|
|
||||||
if (c.isOpaque())
|
if (c.isOpaque())
|
||||||
AdempierePanelUI.updateIt (g, c); // tabAreaBackground
|
CompierePanelUI.updateIt (g, c); // tabAreaBackground
|
||||||
paint (g, c);
|
paint (g, c);
|
||||||
} // update
|
} // update
|
||||||
|
|
||||||
|
@ -172,13 +174,13 @@ public class AdempiereTabbedPaneUI extends MetalTabbedPaneUI
|
||||||
Component comp = tabPane.getComponentAt(tabIndex);
|
Component comp = tabPane.getComponentAt(tabIndex);
|
||||||
// System.out.println("Tab " + tabIndex + " Comp=" + comp.getName() + " " + comp.getClass().getName() + " x=" + x + ", y=" + y + ", w=" +w + ", h=" + h);
|
// System.out.println("Tab " + tabIndex + " Comp=" + comp.getName() + " " + comp.getClass().getName() + " x=" + x + ", y=" + y + ", w=" +w + ", h=" + h);
|
||||||
g2D.setPaint(comp.getBackground());
|
g2D.setPaint(comp.getBackground());
|
||||||
AdempiereColor bg = AdempiereColor.getDefaultBackground();
|
CompiereColor bg = CompiereColor.getDefaultBackground();
|
||||||
if (comp instanceof JPanel)
|
if (comp instanceof JPanel)
|
||||||
{
|
{
|
||||||
JPanel jp = (JPanel)comp;
|
JPanel jp = (JPanel)comp;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
bg = (AdempiereColor)jp.getClientProperty(AdempierePLAF.BACKGROUND);
|
bg = (CompiereColor)jp.getClientProperty(CompiereLookAndFeel.BACKGROUND);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -188,7 +190,7 @@ public class AdempiereTabbedPaneUI extends MetalTabbedPaneUI
|
||||||
|
|
||||||
if (bg == null) // No Background
|
if (bg == null) // No Background
|
||||||
{
|
{
|
||||||
if (AdempiereUtils.isLeftToRight(tabPane))
|
if (CompiereUtils.isLeftToRight(tabPane))
|
||||||
{
|
{
|
||||||
switch (tabPlacement)
|
switch (tabPlacement)
|
||||||
{
|
{
|
||||||
|
@ -236,7 +238,7 @@ public class AdempiereTabbedPaneUI extends MetalTabbedPaneUI
|
||||||
}
|
}
|
||||||
else // we have a background
|
else // we have a background
|
||||||
{
|
{
|
||||||
if (AdempiereUtils.isLeftToRight(tabPane))
|
if (CompiereUtils.isLeftToRight(tabPane))
|
||||||
{
|
{
|
||||||
switch (tabPlacement)
|
switch (tabPlacement)
|
||||||
{
|
{
|
||||||
|
@ -298,8 +300,8 @@ public class AdempiereTabbedPaneUI extends MetalTabbedPaneUI
|
||||||
new int[] {y, y, y+6, y+(h/2), y+(h/2) }, 5);
|
new int[] {y, y, y+6, y+(h/2), y+(h/2) }, 5);
|
||||||
// lighter
|
// lighter
|
||||||
GradientPaint paint = new GradientPaint (
|
GradientPaint paint = new GradientPaint (
|
||||||
x, y, AdempiereUtils.COL_1TOP,
|
x, y, CompiereUtils.COL_1TOP,
|
||||||
x, y+(h/2), AdempiereUtils.COL_1END);
|
x, y+(h/2), CompiereUtils.COL_1END);
|
||||||
g2D.setPaint(paint);
|
g2D.setPaint(paint);
|
||||||
g2D.fill(top);
|
g2D.fill(top);
|
||||||
}
|
}
|
||||||
|
@ -314,8 +316,8 @@ public class AdempiereTabbedPaneUI extends MetalTabbedPaneUI
|
||||||
new int[] {y+(h/2), y+(h/2), y+h, y+h, y+h-6 }, 5);
|
new int[] {y+(h/2), y+(h/2), y+h, y+h, y+h-6 }, 5);
|
||||||
// darker
|
// darker
|
||||||
GradientPaint paint = new GradientPaint (
|
GradientPaint paint = new GradientPaint (
|
||||||
x, y+(h/2), AdempiereUtils.COL_2TOP,
|
x, y+(h/2), CompiereUtils.COL_2TOP,
|
||||||
x, y+h, AdempiereUtils.COL_2END);
|
x, y+h, CompiereUtils.COL_2END);
|
||||||
g2D.setPaint(paint);
|
g2D.setPaint(paint);
|
||||||
g2D.fill(end);
|
g2D.fill(end);
|
||||||
}
|
}
|
||||||
|
@ -367,11 +369,11 @@ public class AdempiereTabbedPaneUI extends MetalTabbedPaneUI
|
||||||
if (comp != null && comp instanceof JComponent)
|
if (comp != null && comp instanceof JComponent)
|
||||||
{
|
{
|
||||||
JComponent jc = (JComponent)comp;
|
JComponent jc = (JComponent)comp;
|
||||||
AdempiereColor bg = null;
|
CompiereColor bg = null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (jc != null)
|
if (jc != null)
|
||||||
bg = (AdempiereColor)jc.getClientProperty(AdempierePLAF.BACKGROUND);
|
bg = (CompiereColor)jc.getClientProperty(CompiereLookAndFeel.BACKGROUND);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -379,8 +381,8 @@ public class AdempiereTabbedPaneUI extends MetalTabbedPaneUI
|
||||||
}
|
}
|
||||||
if (bg == null)
|
if (bg == null)
|
||||||
{
|
{
|
||||||
bg = new AdempiereColor(jc.getBackground());
|
bg = new CompiereColor(jc.getBackground());
|
||||||
jc.putClientProperty(AdempierePLAF.BACKGROUND, bg);
|
jc.putClientProperty(CompiereLookAndFeel.BACKGROUND, bg);
|
||||||
}
|
}
|
||||||
bg.paintRect(g, jc, x,y, w,h);
|
bg.paintRect(g, jc, x,y, w,h);
|
||||||
}
|
}
|
||||||
|
@ -444,7 +446,7 @@ public class AdempiereTabbedPaneUI extends MetalTabbedPaneUI
|
||||||
protected void paintContentBorderBottomEdge (Graphics g, int tabPlacement,
|
protected void paintContentBorderBottomEdge (Graphics g, int tabPlacement,
|
||||||
int selectedIndex, int x, int y, int w, int h)
|
int selectedIndex, int x, int y, int w, int h)
|
||||||
{
|
{
|
||||||
boolean leftToRight = AdempiereUtils.isLeftToRight(tabPane);
|
boolean leftToRight = CompiereUtils.isLeftToRight(tabPane);
|
||||||
int bottom = y + h - 1;
|
int bottom = y + h - 1;
|
||||||
int right = x + w - 1;
|
int right = x + w - 1;
|
||||||
Rectangle selRect = selectedIndex < 0 ? null : getTabBounds(selectedIndex, calcRect);
|
Rectangle selRect = selectedIndex < 0 ? null : getTabBounds(selectedIndex, calcRect);
|
||||||
|
@ -566,7 +568,7 @@ public class AdempiereTabbedPaneUI extends MetalTabbedPaneUI
|
||||||
int currentRun = getRunForTab( tabPane.getTabCount(), tabIndex );
|
int currentRun = getRunForTab( tabPane.getTabCount(), tabIndex );
|
||||||
int lastIndex = lastTabInRun( tabPane.getTabCount(), currentRun );
|
int lastIndex = lastTabInRun( tabPane.getTabCount(), currentRun );
|
||||||
int firstIndex = tabRuns[ currentRun ];
|
int firstIndex = tabRuns[ currentRun ];
|
||||||
boolean leftToRight = AdempiereUtils.isLeftToRight(tabPane);
|
boolean leftToRight = CompiereUtils.isLeftToRight(tabPane);
|
||||||
int bottom = h - 1;
|
int bottom = h - 1;
|
||||||
int right = w - 1;
|
int right = w - 1;
|
||||||
|
|
||||||
|
@ -1021,7 +1023,7 @@ public class AdempiereTabbedPaneUI extends MetalTabbedPaneUI
|
||||||
JComponent jc = (JComponent)comp;
|
JComponent jc = (JComponent)comp;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Integer ll = (Integer)jc.getClientProperty(AdempierePLAF.TABLEVEL);
|
Integer ll = (Integer)jc.getClientProperty(CompiereLookAndFeel.TABLEVEL);
|
||||||
if (ll != null)
|
if (ll != null)
|
||||||
level = ll.intValue();
|
level = ll.intValue();
|
||||||
}
|
}
|
|
@ -30,7 +30,7 @@ import javax.swing.plaf.basic.BasicTableHeaderUI;
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: AdempiereTableHeaderUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
* @version $Id: AdempiereTableHeaderUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
||||||
*/
|
*/
|
||||||
public class AdempiereTableHeaderUI extends BasicTableHeaderUI
|
public class CompiereTableHeaderUI extends BasicTableHeaderUI
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Static Create UI
|
* Static Create UI
|
||||||
|
@ -39,7 +39,7 @@ public class AdempiereTableHeaderUI extends BasicTableHeaderUI
|
||||||
*/
|
*/
|
||||||
public static ComponentUI createUI(JComponent c)
|
public static ComponentUI createUI(JComponent c)
|
||||||
{
|
{
|
||||||
return new AdempiereTableHeaderUI();
|
return new CompiereTableHeaderUI();
|
||||||
} // createUI
|
} // createUI
|
||||||
|
|
||||||
|
|
||||||
|
@ -52,8 +52,8 @@ public class AdempiereTableHeaderUI extends BasicTableHeaderUI
|
||||||
super.installUI(c);
|
super.installUI(c);
|
||||||
// TableHeader is in JViewpoiunt, which is Opaque
|
// TableHeader is in JViewpoiunt, which is Opaque
|
||||||
// When UI created, TableHeader not added to viewpoint
|
// When UI created, TableHeader not added to viewpoint
|
||||||
c.setOpaque(true);
|
//c.setOpaque(true);
|
||||||
c.putClientProperty(AdempierePLAF.BACKGROUND_FILL, "Y");
|
//c.putClientProperty(AdempierePLAF.BACKGROUND_FILL, "Y");
|
||||||
} // installUI
|
} // installUI
|
||||||
|
|
||||||
|
|
||||||
|
@ -76,7 +76,7 @@ public class AdempiereTableHeaderUI extends BasicTableHeaderUI
|
||||||
{
|
{
|
||||||
// AdempiereUtils.printParents (c); // Parent is JViewpoint
|
// AdempiereUtils.printParents (c); // Parent is JViewpoint
|
||||||
if (c.isOpaque()) // flat
|
if (c.isOpaque()) // flat
|
||||||
AdempiereUtils.fillRectange((Graphics2D)g, c, CompiereLookAndFeel.ROUND);
|
CompiereUtils.fillRectange((Graphics2D)g, c, CompiereLookAndFeel.ROUND);
|
||||||
//
|
//
|
||||||
paint (g, c);
|
paint (g, c);
|
||||||
} // update
|
} // update
|
||||||
|
@ -89,7 +89,7 @@ public class AdempiereTableHeaderUI extends BasicTableHeaderUI
|
||||||
public void paint(Graphics g, JComponent c)
|
public void paint(Graphics g, JComponent c)
|
||||||
{
|
{
|
||||||
super.paint( g, c);
|
super.paint( g, c);
|
||||||
AdempiereUtils.paint3Deffect((Graphics2D)g, c, CompiereLookAndFeel.ROUND, true);
|
CompiereUtils.paint3Deffect((Graphics2D)g, c, CompiereLookAndFeel.ROUND, true);
|
||||||
} // paint
|
} // paint
|
||||||
|
|
||||||
} // AdempiereTableHeader
|
} // AdempiereTableHeader
|
|
@ -26,7 +26,7 @@ import javax.swing.plaf.basic.*;
|
||||||
import javax.swing.text.*;
|
import javax.swing.text.*;
|
||||||
|
|
||||||
|
|
||||||
public class AdempiereTextAreaUI extends BasicTextAreaUI
|
public class CompiereTextAreaUI extends BasicTextAreaUI
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Creates a UI for a JTextArea.
|
* Creates a UI for a JTextArea.
|
||||||
|
@ -37,14 +37,14 @@ public class AdempiereTextAreaUI extends BasicTextAreaUI
|
||||||
*/
|
*/
|
||||||
public static ComponentUI createUI(JComponent ta)
|
public static ComponentUI createUI(JComponent ta)
|
||||||
{
|
{
|
||||||
return new AdempiereTextAreaUI(ta);
|
return new CompiereTextAreaUI(ta);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
* @param ta text area
|
* @param ta text area
|
||||||
*/
|
*/
|
||||||
public AdempiereTextAreaUI (JComponent ta)
|
public CompiereTextAreaUI (JComponent ta)
|
||||||
{
|
{
|
||||||
if (ta instanceof JTextComponent)
|
if (ta instanceof JTextComponent)
|
||||||
m_editor = (JTextComponent)ta;
|
m_editor = (JTextComponent)ta;
|
|
@ -18,13 +18,19 @@ package org.compiere.plaf;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.util.logging.*;
|
import java.util.logging.*;
|
||||||
|
|
||||||
|
import javax.swing.UIDefaults;
|
||||||
import javax.swing.plaf.*;
|
import javax.swing.plaf.*;
|
||||||
import javax.swing.plaf.metal.*;
|
import javax.swing.plaf.metal.*;
|
||||||
|
|
||||||
|
import org.compiere.swing.ColorBlind;
|
||||||
|
import org.compiere.swing.ExtendedTheme;
|
||||||
import org.compiere.util.*;
|
import org.compiere.util.*;
|
||||||
|
|
||||||
import sun.awt.*;
|
import sun.awt.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adempiere User definable Theme (if used in Metal L&F).
|
* Compiere User definable Theme (if used in Metal L&F).
|
||||||
* In other Environments, it provides UI extensions (e.g. Error Color)
|
* In other Environments, it provides UI extensions (e.g. Error Color)
|
||||||
*
|
*
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
|
@ -135,49 +141,6 @@ public class CompiereTheme extends MetalTheme
|
||||||
public static final int FONT_SIZE = 12;
|
public static final int FONT_SIZE = 12;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set Theme to current Metal Theme and copy it
|
|
||||||
*/
|
|
||||||
public static void setTheme ()
|
|
||||||
{
|
|
||||||
log.fine("");
|
|
||||||
AppContext context = AppContext.getAppContext();
|
|
||||||
MetalTheme copyFrom = (MetalTheme)context.get("currentMetalTheme");
|
|
||||||
boolean flat = Ini.isPropertyBool(Ini.P_UI_FLAT);
|
|
||||||
setTheme (copyFrom, flat);
|
|
||||||
} // setTheme
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Set Theme to current Metal Theme and copy it
|
|
||||||
* @param copyFrom theme
|
|
||||||
* @param flat flat colors
|
|
||||||
*/
|
|
||||||
public static void setTheme (MetalTheme copyFrom, boolean flat)
|
|
||||||
{
|
|
||||||
if (copyFrom == null || copyFrom instanceof CompiereTheme)
|
|
||||||
return;
|
|
||||||
log.fine(copyFrom.getName() + " - Flat=" + flat);
|
|
||||||
// May not be correct, if Themes overwrites default methods
|
|
||||||
primary1 = copyFrom.getPrimaryControlDarkShadow();
|
|
||||||
primary2 = copyFrom.getPrimaryControlShadow();
|
|
||||||
primary3 = copyFrom.getPrimaryControl();
|
|
||||||
secondary1 = copyFrom.getControlDarkShadow();
|
|
||||||
secondary2 = copyFrom.getControlShadow();
|
|
||||||
secondary3 = copyFrom.getControl();
|
|
||||||
AdempierePanelUI.setDefaultBackground(new AdempiereColor(secondary3, flat));
|
|
||||||
white = copyFrom.getPrimaryControlHighlight();
|
|
||||||
black = copyFrom.getPrimaryControlInfo();
|
|
||||||
//
|
|
||||||
controlFont = copyFrom.getControlTextFont();
|
|
||||||
systemFont = copyFrom.getSystemTextFont();
|
|
||||||
userFont = copyFrom.getUserTextFont();
|
|
||||||
smallFont = copyFrom.getSubTextFont();
|
|
||||||
menuFont = copyFrom.getMenuTextFont();
|
|
||||||
windowFont = copyFrom.getWindowTitleFont();
|
|
||||||
} // setTheme
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* Get Primary 1 (blue in default Metal Theme)
|
* Get Primary 1 (blue in default Metal Theme)
|
||||||
* @return color
|
* @return color
|
||||||
|
@ -361,241 +324,22 @@ public class CompiereTheme extends MetalTheme
|
||||||
}
|
}
|
||||||
public FontUIResource getSubTextFont() {return _getSubTextFont();}
|
public FontUIResource getSubTextFont() {return _getSubTextFont();}
|
||||||
|
|
||||||
// Static property info
|
@Override
|
||||||
|
public void addCustomEntriesToTable(UIDefaults table) {
|
||||||
private static final String P_Primary1 = "#ColorPrimary1";
|
super.addCustomEntriesToTable(table);
|
||||||
private static final String P_Primary2 = "#ColorPrimary2";
|
Object[] defaults =
|
||||||
private static final String P_Primary3 = "#ColorPrimary3";
|
|
||||||
private static final String P_Secondary1 = "#ColorSecondary1";
|
|
||||||
private static final String P_Secondary2 = "#ColorSecondary2";
|
|
||||||
private static final String P_Secondary3 = "#ColorSecondary3";
|
|
||||||
private static final String P_Black = "#ColorBlack";
|
|
||||||
private static final String P_White = "#ColorWhite";
|
|
||||||
private static final String P_Error = "#ColorError";
|
|
||||||
private static final String P_Info = "#ColorInfo";
|
|
||||||
private static final String P_Mandatory = "#ColorMandatory";
|
|
||||||
private static final String P_Inactive = "#ColorInactive";
|
|
||||||
private static final String P_Txt_OK = "#ColorTextOK";
|
|
||||||
private static final String P_Txt_Error = "#ColorTextError";
|
|
||||||
//
|
|
||||||
private static final String P_Control = "#FontControl";
|
|
||||||
private static final String P_System = "#FontSystem";
|
|
||||||
private static final String P_User = "#FontUser";
|
|
||||||
private static final String P_Small = "#FontSmall";
|
|
||||||
private static final String P_Window = "#FontWindow";
|
|
||||||
private static final String P_Menu = "#FontMenu";
|
|
||||||
/** Background Color */
|
|
||||||
protected static final String P_AdempiereColor = "#AdempiereColor";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Save information in Properties
|
|
||||||
*/
|
|
||||||
public static void save ()
|
|
||||||
{
|
{
|
||||||
log.config(AdempiereColor.getDefaultBackground().toString());
|
ExtendedTheme.ERROR_BG_KEY,
|
||||||
//
|
error,
|
||||||
Ini.setProperty(P_Primary1, getColorAsString(primary1));
|
ExtendedTheme.ERROR_FG_KEY,
|
||||||
Ini.setProperty(P_Primary2, getColorAsString(primary2));
|
txt_error,
|
||||||
Ini.setProperty(P_Primary3, getColorAsString(primary3));
|
ExtendedTheme.INACTIVE_BG_KEY,
|
||||||
Ini.setProperty(P_Secondary1, getColorAsString(secondary1));
|
inactive,
|
||||||
Ini.setProperty(P_Secondary2, getColorAsString(secondary2));
|
ExtendedTheme.INFO_BG_KEY,
|
||||||
Ini.setProperty(P_Secondary3, getColorAsString(secondary3));
|
info,
|
||||||
Ini.setProperty(P_Error, getColorAsString(error));
|
ExtendedTheme.MANDATORY_BG_KEY,
|
||||||
Ini.setProperty(P_Info, getColorAsString(info));
|
mandatory
|
||||||
Ini.setProperty(P_Mandatory, getColorAsString(mandatory));
|
};
|
||||||
Ini.setProperty(P_Inactive, getColorAsString(inactive));
|
table.putDefaults(defaults);
|
||||||
Ini.setProperty(P_White, getColorAsString(white));
|
|
||||||
Ini.setProperty(P_Black, getColorAsString(black));
|
|
||||||
Ini.setProperty(P_Txt_OK, getColorAsString(txt_ok));
|
|
||||||
Ini.setProperty(P_Txt_Error, getColorAsString(txt_error));
|
|
||||||
//
|
|
||||||
Ini.setProperty(P_Control, ((Font)controlFont).toString());
|
|
||||||
Ini.setProperty(P_System, ((Font)systemFont).toString());
|
|
||||||
Ini.setProperty(P_User, ((Font)userFont).toString());
|
|
||||||
Ini.setProperty(P_Small, ((Font)smallFont).toString());
|
|
||||||
Ini.setProperty(P_Window, ((Font)windowFont).toString());
|
|
||||||
Ini.setProperty(P_Menu, ((Font)menuFont).toString());
|
|
||||||
//
|
|
||||||
AdempiereColor cc = AdempiereColor.getDefaultBackground();
|
|
||||||
Ini.setProperty(P_AdempiereColor, cc.toString());
|
|
||||||
} // save
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Parses Color into String representation.
|
|
||||||
* Required as SystemColors and Alpha Colors have different formats
|
|
||||||
* @param c Color
|
|
||||||
* @return [r=102,g=102,b=153,a=255]
|
|
||||||
* @see #parseColor
|
|
||||||
*/
|
|
||||||
public static String getColorAsString (Color c)
|
|
||||||
{
|
|
||||||
if (c == null)
|
|
||||||
c = SystemColor.control;
|
|
||||||
StringBuffer sb = new StringBuffer("[r=").append(c.getRed())
|
|
||||||
.append(",g=").append(c.getGreen())
|
|
||||||
.append(",b=").append(c.getBlue())
|
|
||||||
.append(",a=").append(c.getAlpha())
|
|
||||||
.append("]");
|
|
||||||
// System.out.println(sb.toString());
|
|
||||||
return sb.toString();
|
|
||||||
} // getColorAsString
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Load Properties from Ini
|
|
||||||
*/
|
|
||||||
public static void load ()
|
|
||||||
{
|
|
||||||
primary1 = parseColor (Ini.getProperty(P_Primary1), primary1);
|
|
||||||
primary2 = parseColor (Ini.getProperty(P_Primary2), primary2);
|
|
||||||
primary3 = parseColor (Ini.getProperty(P_Primary3), primary3);
|
|
||||||
secondary1 = parseColor (Ini.getProperty(P_Secondary1), secondary1);
|
|
||||||
secondary2 = parseColor (Ini.getProperty(P_Secondary2), secondary2);
|
|
||||||
secondary3 = parseColor (Ini.getProperty(P_Secondary3), secondary3);
|
|
||||||
error = parseColor(Ini.getProperty(P_Error), error);
|
|
||||||
info = parseColor(Ini.getProperty(P_Info), info);
|
|
||||||
mandatory = parseColor(Ini.getProperty(P_Mandatory), mandatory);
|
|
||||||
inactive = parseColor(Ini.getProperty(P_Inactive), inactive);
|
|
||||||
white = parseColor(Ini.getProperty(P_White), white);
|
|
||||||
black = parseColor(Ini.getProperty(P_Black), black);
|
|
||||||
txt_ok = parseColor(Ini.getProperty(P_Txt_OK), txt_ok);
|
|
||||||
txt_error = parseColor(Ini.getProperty(P_Txt_Error), txt_error);
|
|
||||||
//
|
|
||||||
controlFont = parseFont(Ini.getProperty(P_Control), controlFont);
|
|
||||||
systemFont = parseFont(Ini.getProperty(P_System), systemFont);
|
|
||||||
userFont = parseFont(Ini.getProperty(P_User), userFont);
|
|
||||||
smallFont = parseFont(Ini.getProperty(P_Small), smallFont);
|
|
||||||
windowFont = parseFont(Ini.getProperty(P_Window), windowFont);
|
|
||||||
menuFont = parseFont(Ini.getProperty(P_Menu), menuFont);
|
|
||||||
//
|
|
||||||
AdempiereColor cc = AdempiereColor.parse(Ini.getProperty(P_AdempiereColor));
|
|
||||||
AdempiereColor.setDefaultBackground(cc);
|
|
||||||
} // load
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reset Info in Properties
|
|
||||||
*/
|
|
||||||
public static void reset ()
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
Ini.remove (P_Primary1);
|
|
||||||
Ini.remove (P_Primary2);
|
|
||||||
Ini.remove (P_Primary3);
|
|
||||||
Ini.remove (P_Secondary1);
|
|
||||||
Ini.remove (P_Secondary2);
|
|
||||||
Ini.remove (P_Secondary3);
|
|
||||||
Ini.remove (P_Error);
|
|
||||||
Ini.remove (P_Info);
|
|
||||||
Ini.remove (P_Mandatory);
|
|
||||||
Ini.remove (P_Inactive);
|
|
||||||
Ini.remove (P_White);
|
|
||||||
Ini.remove (P_Black);
|
|
||||||
Ini.remove (P_Txt_OK);
|
|
||||||
Ini.remove (P_Txt_Error);
|
|
||||||
//
|
|
||||||
Ini.remove (P_Control);
|
|
||||||
Ini.remove (P_System);
|
|
||||||
Ini.remove (P_User);
|
|
||||||
Ini.remove (P_Small);
|
|
||||||
Ini.remove (P_Window);
|
|
||||||
Ini.remove (P_Menu);
|
|
||||||
// AdempiereColor
|
|
||||||
Ini.remove(P_AdempiereColor);
|
|
||||||
**/
|
|
||||||
// Initialize
|
|
||||||
Ini.setProperty(Ini.P_UI_LOOK, CompiereLookAndFeel.NAME);
|
|
||||||
Ini.setProperty(Ini.P_UI_THEME, s_name);
|
|
||||||
//
|
|
||||||
if (s_theme != null)
|
|
||||||
s_theme.setDefault();
|
|
||||||
|
|
||||||
// Background
|
|
||||||
// AdempiereColor cc = new AdempiereColor(SystemColor.control); // flat Windows 212-208-200
|
|
||||||
// AdempiereColor cc = new AdempiereColor(secondary3); // flat Metal 204-204-204
|
|
||||||
AdempiereColor cc = new AdempiereColor(secondary3, false);
|
|
||||||
AdempiereColor.setDefaultBackground (cc);
|
|
||||||
//
|
|
||||||
save(); // save properties
|
|
||||||
} // reset
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Parse Color.
|
|
||||||
* <p>
|
|
||||||
* Color - [r=102,g=102,b=153,a=0]
|
|
||||||
*
|
|
||||||
* @param information string information to be parsed
|
|
||||||
* @param stdColor color used if info cannot parsed
|
|
||||||
* @return color
|
|
||||||
* @see #getColorAsString
|
|
||||||
*/
|
|
||||||
protected static ColorUIResource parseColor (String information, ColorUIResource stdColor)
|
|
||||||
{
|
|
||||||
if (information == null
|
|
||||||
|| information.length() == 0
|
|
||||||
|| information.trim().length() == 0)
|
|
||||||
return stdColor;
|
|
||||||
// System.out.print("ParseColor=" + info);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
int r = Integer.parseInt(information.substring(information.indexOf("r=")+2, information.indexOf(",g=")));
|
|
||||||
int g = Integer.parseInt(information.substring(information.indexOf("g=")+2, information.indexOf(",b=")));
|
|
||||||
int b = 0;
|
|
||||||
int a = 255;
|
|
||||||
if (information.indexOf("a=") == -1)
|
|
||||||
b = Integer.parseInt(information.substring(information.indexOf("b=")+2, information.indexOf("]")));
|
|
||||||
else
|
|
||||||
{
|
|
||||||
b = Integer.parseInt(information.substring(information.indexOf("b=")+2, information.indexOf(",a=")));
|
|
||||||
a = Integer.parseInt(information.substring(information.indexOf("a=")+2, information.indexOf("]")));
|
|
||||||
}
|
}
|
||||||
ColorUIResource retValue = new ColorUIResource(new Color(r, g, b, a));
|
|
||||||
// System.out.println(" - " + retValue.toString());
|
|
||||||
return retValue;
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
log.config(information + " - cannot parse: " + e.toString());
|
|
||||||
}
|
|
||||||
return stdColor;
|
|
||||||
} // parseColor
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Parse Font
|
|
||||||
* <p>
|
|
||||||
* javax.swing.plaf.FontUIResource[family=dialog.bold,name=Dialog,style=bold,size=12]
|
|
||||||
*
|
|
||||||
* @param information string information to be parsed
|
|
||||||
* @param stdFont font used if info cannot be parsed
|
|
||||||
* @return font
|
|
||||||
*/
|
|
||||||
private static FontUIResource parseFont(String information, FontUIResource stdFont)
|
|
||||||
{
|
|
||||||
if (information == null
|
|
||||||
|| information.length() == 0
|
|
||||||
|| information.trim().length() == 0)
|
|
||||||
return stdFont;
|
|
||||||
// System.out.print("ParseFont=" + info);
|
|
||||||
try
|
|
||||||
{
|
|
||||||
String name = information.substring(information.indexOf("name=")+5, information.indexOf(",style="));
|
|
||||||
String s = information.substring(information.indexOf("style=")+6, information.indexOf(",size="));
|
|
||||||
int style = Font.PLAIN;
|
|
||||||
if (s.equals("bold"))
|
|
||||||
style = Font.BOLD;
|
|
||||||
else if (s.equals("italic"))
|
|
||||||
style = Font.ITALIC;
|
|
||||||
else if (s.equals("bolditalic"))
|
|
||||||
style = Font.BOLD | Font.ITALIC;
|
|
||||||
int size = Integer.parseInt(information.substring(information.indexOf(",size=")+6, information.lastIndexOf("]")));
|
|
||||||
FontUIResource retValue = new FontUIResource(name,style,size);
|
|
||||||
// System.out.println(" - " + retValue.toString());
|
|
||||||
return retValue;
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
log.config(information + " - cannot parse: " + e.toString());
|
|
||||||
}
|
|
||||||
return stdFont;
|
|
||||||
} // parseFont
|
|
||||||
|
|
||||||
} // AdempiereTheme
|
} // AdempiereTheme
|
||||||
|
|
|
@ -17,6 +17,8 @@
|
||||||
package org.compiere.plaf;
|
package org.compiere.plaf;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
|
import javax.swing.UIDefaults;
|
||||||
import javax.swing.plaf.*;
|
import javax.swing.plaf.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -25,6 +25,7 @@ import javax.swing.border.*;
|
||||||
import javax.swing.plaf.*;
|
import javax.swing.plaf.*;
|
||||||
import javax.swing.plaf.metal.*;
|
import javax.swing.plaf.metal.*;
|
||||||
|
|
||||||
|
import org.adempiere.plaf.AdempierePLAF;
|
||||||
import org.compiere.swing.*;
|
import org.compiere.swing.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -35,14 +36,14 @@ import org.compiere.swing.*;
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: AdempiereThemeEditor.java,v 1.3 2006/07/30 00:52:24 jjanke Exp $
|
* @version $Id: AdempiereThemeEditor.java,v 1.3 2006/07/30 00:52:24 jjanke Exp $
|
||||||
*/
|
*/
|
||||||
public class AdempiereThemeEditor extends CDialog
|
public class CompiereThemeEditor extends CDialog
|
||||||
implements ActionListener
|
implements ActionListener
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
* @param owner Frame owner
|
* @param owner Frame owner
|
||||||
*/
|
*/
|
||||||
public AdempiereThemeEditor (JDialog owner)
|
public CompiereThemeEditor (JDialog owner)
|
||||||
{
|
{
|
||||||
super(owner, s_res.getString("AdempiereThemeEditor"), true);
|
super(owner, s_res.getString("AdempiereThemeEditor"), true);
|
||||||
try
|
try
|
||||||
|
@ -291,7 +292,7 @@ public class AdempiereThemeEditor extends CDialog
|
||||||
// Confirm
|
// Confirm
|
||||||
if (e.getSource() == bOK)
|
if (e.getSource() == bOK)
|
||||||
{
|
{
|
||||||
CompiereTheme.save();
|
//CompiereTheme.save();
|
||||||
dispose();
|
dispose();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
|
@ -27,7 +27,7 @@ import javax.swing.plaf.metal.*;
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: AdempiereToggleButtonUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
* @version $Id: AdempiereToggleButtonUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
||||||
*/
|
*/
|
||||||
public class AdempiereToggleButtonUI extends MetalToggleButtonUI
|
public class CompiereToggleButtonUI extends MetalToggleButtonUI
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Static Create UI
|
* Static Create UI
|
||||||
|
@ -40,7 +40,7 @@ public class AdempiereToggleButtonUI extends MetalToggleButtonUI
|
||||||
} // createUI
|
} // createUI
|
||||||
|
|
||||||
/** UI shared */
|
/** UI shared */
|
||||||
private static AdempiereToggleButtonUI s_toggleButtonUI = new AdempiereToggleButtonUI();
|
private static CompiereToggleButtonUI s_toggleButtonUI = new CompiereToggleButtonUI();
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
@ -72,7 +72,7 @@ public class AdempiereToggleButtonUI extends MetalToggleButtonUI
|
||||||
{
|
{
|
||||||
if (c.isOpaque()) // flat background
|
if (c.isOpaque()) // flat background
|
||||||
// AdempiereColor.getDefaultBackground().paint(g, c);
|
// AdempiereColor.getDefaultBackground().paint(g, c);
|
||||||
AdempiereUtils.fillRectange((Graphics2D)g, c, CompiereLookAndFeel.ROUND);
|
CompiereUtils.fillRectange((Graphics2D)g, c, CompiereLookAndFeel.ROUND);
|
||||||
paint (g, c);
|
paint (g, c);
|
||||||
} // update
|
} // update
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ public class AdempiereToggleButtonUI extends MetalToggleButtonUI
|
||||||
ButtonModel model = b.getModel();
|
ButtonModel model = b.getModel();
|
||||||
boolean in = model.isPressed() || model.isSelected();
|
boolean in = model.isPressed() || model.isSelected();
|
||||||
//
|
//
|
||||||
AdempiereUtils.paint3Deffect((Graphics2D)g, c, CompiereLookAndFeel.ROUND, !in);
|
CompiereUtils.paint3Deffect((Graphics2D)g, c, CompiereLookAndFeel.ROUND, !in);
|
||||||
} // paint
|
} // paint
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -26,7 +26,7 @@ import javax.swing.plaf.metal.*;
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: AdempiereToolBarUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
* @version $Id: AdempiereToolBarUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
||||||
*/
|
*/
|
||||||
public class AdempiereToolBarUI extends MetalToolBarUI
|
public class CompiereToolBarUI extends MetalToolBarUI
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Create UI (own instance)
|
* Create UI (own instance)
|
||||||
|
@ -35,7 +35,7 @@ public class AdempiereToolBarUI extends MetalToolBarUI
|
||||||
*/
|
*/
|
||||||
public static ComponentUI createUI (JComponent c)
|
public static ComponentUI createUI (JComponent c)
|
||||||
{
|
{
|
||||||
return new AdempiereToolBarUI();
|
return new CompiereToolBarUI();
|
||||||
} // createUI
|
} // createUI
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ import javax.swing.plaf.metal.*;
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: AdempiereToolTipUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
* @version $Id: AdempiereToolTipUI.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
||||||
*/
|
*/
|
||||||
public class AdempiereToolTipUI extends MetalToolTipUI
|
public class CompiereToolTipUI extends MetalToolTipUI
|
||||||
{
|
{
|
||||||
|
|
||||||
public static ComponentUI createUI(JComponent c)
|
public static ComponentUI createUI(JComponent c)
|
||||||
|
@ -37,7 +37,7 @@ public class AdempiereToolTipUI extends MetalToolTipUI
|
||||||
return sharedInstance;
|
return sharedInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
static AdempiereToolTipUI sharedInstance = new AdempiereToolTipUI();
|
static CompiereToolTipUI sharedInstance = new CompiereToolTipUI();
|
||||||
|
|
||||||
private JToolTip tip;
|
private JToolTip tip;
|
||||||
|
|
|
@ -23,6 +23,9 @@ import java.io.*;
|
||||||
import java.net.*;
|
import java.net.*;
|
||||||
import java.util.logging.*;
|
import java.util.logging.*;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|
||||||
|
import org.adempiere.plaf.AdempierePLAF;
|
||||||
|
|
||||||
import com.sun.image.codec.jpeg.*;
|
import com.sun.image.codec.jpeg.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -31,11 +34,11 @@ import com.sun.image.codec.jpeg.*;
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: AdempiereUtils.java,v 1.2 2006/07/30 00:52:23 jjanke Exp $
|
* @version $Id: AdempiereUtils.java,v 1.2 2006/07/30 00:52:23 jjanke Exp $
|
||||||
*/
|
*/
|
||||||
public class AdempiereUtils
|
public class CompiereUtils
|
||||||
{
|
{
|
||||||
|
|
||||||
/** Logger */
|
/** Logger */
|
||||||
private static Logger log = Logger.getLogger(AdempiereUtils.class.getName());
|
private static Logger log = Logger.getLogger(CompiereUtils.class.getName());
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fill Background with Color.
|
* Fill Background with Color.
|
||||||
|
@ -48,18 +51,18 @@ public class AdempiereUtils
|
||||||
public static void fillRectange(Graphics2D g2D, JComponent c, boolean round)
|
public static void fillRectange(Graphics2D g2D, JComponent c, boolean round)
|
||||||
{
|
{
|
||||||
// Paint in AdempiereColor?
|
// Paint in AdempiereColor?
|
||||||
AdempiereColor cc = null;
|
CompiereColor cc = null;
|
||||||
boolean stdCC = c.getClientProperty(AdempierePLAF.BACKGROUND_FILL) != null;
|
boolean stdCC = c.getClientProperty(CompiereLookAndFeel.BACKGROUND_FILL) != null;
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
cc = (AdempiereColor)c.getClientProperty(AdempierePLAF.BACKGROUND);
|
cc = (CompiereColor)c.getClientProperty(CompiereLookAndFeel.BACKGROUND);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
stdCC = true;
|
stdCC = true;
|
||||||
}
|
}
|
||||||
if (stdCC)
|
if (stdCC)
|
||||||
cc = AdempiereColor.getDefaultBackground();
|
cc = CompiereColor.getDefaultBackground();
|
||||||
|
|
||||||
// Paint AdempiereColor
|
// Paint AdempiereColor
|
||||||
if (cc != null)
|
if (cc != null)
|
||||||
|
@ -455,7 +458,7 @@ public class AdempiereUtils
|
||||||
c.setName("C" + String.valueOf(s_no++));
|
c.setName("C" + String.valueOf(s_no++));
|
||||||
System.out.print(c.getName());
|
System.out.print(c.getName());
|
||||||
System.out.print(" - " + c.getClass().getName());
|
System.out.print(" - " + c.getClass().getName());
|
||||||
System.out.println (" ** " + c.isOpaque() + " bg=" + (c.getClientProperty(AdempierePLAF.BACKGROUND) != null));
|
System.out.println (" ** " + c.isOpaque() + " bg=" + (c.getClientProperty(CompiereLookAndFeel.BACKGROUND) != null));
|
||||||
//
|
//
|
||||||
Container container = c.getParent();
|
Container container = c.getParent();
|
||||||
while (container != null)
|
while (container != null)
|
||||||
|
@ -463,7 +466,7 @@ public class AdempiereUtils
|
||||||
System.out.print (" - " + container.getName() + " " + container.getClass().getName()
|
System.out.print (" - " + container.getName() + " " + container.getClass().getName()
|
||||||
+ " ** " + container.isOpaque());
|
+ " ** " + container.isOpaque());
|
||||||
if (container instanceof JComponent)
|
if (container instanceof JComponent)
|
||||||
System.out.print (" bg=" + (((JComponent)container).getClientProperty(AdempierePLAF.BACKGROUND) != null));
|
System.out.print (" bg=" + (((JComponent)container).getClientProperty(CompiereLookAndFeel.BACKGROUND) != null));
|
||||||
System.out.println ();
|
System.out.println ();
|
||||||
container = container.getParent();
|
container = container.getParent();
|
||||||
}
|
}
|
|
@ -27,7 +27,7 @@ import javax.swing.plaf.basic.BasicViewportUI;
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: AdempiereViewportUI.java,v 1.2 2006/07/30 00:52:23 jjanke Exp $
|
* @version $Id: AdempiereViewportUI.java,v 1.2 2006/07/30 00:52:23 jjanke Exp $
|
||||||
*/
|
*/
|
||||||
public class AdempiereViewportUI extends BasicViewportUI
|
public class CompiereViewportUI extends BasicViewportUI
|
||||||
{
|
{
|
||||||
/** Shared UI object */
|
/** Shared UI object */
|
||||||
private static ViewportUI viewportUI;
|
private static ViewportUI viewportUI;
|
||||||
|
@ -40,7 +40,7 @@ public class AdempiereViewportUI extends BasicViewportUI
|
||||||
public static ComponentUI createUI (JComponent c)
|
public static ComponentUI createUI (JComponent c)
|
||||||
{
|
{
|
||||||
if (viewportUI == null)
|
if (viewportUI == null)
|
||||||
viewportUI = new AdempiereViewportUI();
|
viewportUI = new CompiereViewportUI();
|
||||||
return viewportUI;
|
return viewportUI;
|
||||||
} // createUI
|
} // createUI
|
||||||
|
|
|
@ -117,7 +117,9 @@ public class PlafRes extends ListResourceBundle
|
||||||
{ "LineBackColor", "Background Color" },
|
{ "LineBackColor", "Background Color" },
|
||||||
{ "LineWidth", "Line Width" },
|
{ "LineWidth", "Line Width" },
|
||||||
{ "LineDistance", "Line Distance" },
|
{ "LineDistance", "Line Distance" },
|
||||||
{ "FlatColor", "Flat Color" }
|
{ "FlatColor", "Flat Color" },
|
||||||
|
{ "UITheme", "User Interface Theme" },
|
||||||
|
{ "Preview", "Preview" }
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -18,6 +18,8 @@ package org.compiere.swing;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|
||||||
|
import org.adempiere.plaf.AdempierePLAF;
|
||||||
import org.compiere.plaf.*;
|
import org.compiere.plaf.*;
|
||||||
import org.compiere.util.*;
|
import org.compiere.util.*;
|
||||||
|
|
||||||
|
@ -68,8 +70,6 @@ public class CButton extends JButton implements CEditor
|
||||||
public CButton (Action a)
|
public CButton (Action a)
|
||||||
{
|
{
|
||||||
super (a);
|
super (a);
|
||||||
setContentAreaFilled(false);
|
|
||||||
setOpaque(false);
|
|
||||||
} // CButton
|
} // CButton
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -81,11 +81,6 @@ public class CButton extends JButton implements CEditor
|
||||||
public CButton(String text, Icon icon)
|
public CButton(String text, Icon icon)
|
||||||
{
|
{
|
||||||
super (text, icon);
|
super (text, icon);
|
||||||
setContentAreaFilled(false);
|
|
||||||
setOpaque(false);
|
|
||||||
//
|
|
||||||
setFont(AdempierePLAF.getFont_Label());
|
|
||||||
setForeground(AdempierePLAF.getTextColor_Label());
|
|
||||||
} // CButton
|
} // CButton
|
||||||
|
|
||||||
|
|
||||||
|
@ -99,12 +94,7 @@ public class CButton extends JButton implements CEditor
|
||||||
if (bg.equals(getBackground()))
|
if (bg.equals(getBackground()))
|
||||||
return;
|
return;
|
||||||
super.setBackground (bg);
|
super.setBackground (bg);
|
||||||
// ignore calls from javax.swing.LookAndFeel.installColors(LookAndFeel.java:61)
|
setBackgroundColor(new CompiereColor(bg));
|
||||||
if (!Trace.getCallerClass(1).startsWith("javax"))
|
|
||||||
{
|
|
||||||
setOpaque(true);
|
|
||||||
setContentAreaFilled(true);
|
|
||||||
}
|
|
||||||
this.repaint();
|
this.repaint();
|
||||||
} // setBackground
|
} // setBackground
|
||||||
|
|
||||||
|
@ -128,12 +118,11 @@ public class CButton extends JButton implements CEditor
|
||||||
* Set Background
|
* Set Background
|
||||||
* @param bg AdempiereColor for Background, if null set standard background
|
* @param bg AdempiereColor for Background, if null set standard background
|
||||||
*/
|
*/
|
||||||
public void setBackgroundColor (AdempiereColor bg)
|
public void setBackgroundColor (CompiereColor bg)
|
||||||
{
|
{
|
||||||
if (bg == null)
|
if (bg == null)
|
||||||
bg = AdempiereColor.getDefaultBackground();
|
bg = new CompiereColor(AdempierePLAF.getFormBackground());
|
||||||
setOpaque(true);
|
putClientProperty(CompiereLookAndFeel.BACKGROUND, bg);
|
||||||
putClientProperty(AdempierePLAF.BACKGROUND, bg);
|
|
||||||
super.setBackground (bg.getFlatColor());
|
super.setBackground (bg.getFlatColor());
|
||||||
this.repaint();
|
this.repaint();
|
||||||
} // setBackground
|
} // setBackground
|
||||||
|
@ -142,11 +131,11 @@ public class CButton extends JButton implements CEditor
|
||||||
* Get Background
|
* Get Background
|
||||||
* @return Color for Background
|
* @return Color for Background
|
||||||
*/
|
*/
|
||||||
public AdempiereColor getBackgroundColor ()
|
public CompiereColor getBackgroundColor ()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return (AdempiereColor)getClientProperty(AdempierePLAF.BACKGROUND);
|
return (CompiereColor)getClientProperty(CompiereLookAndFeel.BACKGROUND);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -22,7 +22,7 @@ import javax.swing.Action;
|
||||||
import javax.swing.Icon;
|
import javax.swing.Icon;
|
||||||
import javax.swing.JCheckBox;
|
import javax.swing.JCheckBox;
|
||||||
|
|
||||||
import org.compiere.plaf.AdempierePLAF;
|
import org.adempiere.plaf.AdempierePLAF;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adempiere CheckBox
|
* Adempiere CheckBox
|
||||||
|
@ -135,8 +135,8 @@ public class CCheckBox extends JCheckBox implements CEditor
|
||||||
*/
|
*/
|
||||||
private void init()
|
private void init()
|
||||||
{
|
{
|
||||||
setFont(AdempierePLAF.getFont_Label());
|
//Default to transparent, works better under windows look and feel
|
||||||
setForeground(AdempierePLAF.getTextColor_Label());
|
setOpaque(false);
|
||||||
} // init
|
} // init
|
||||||
|
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
|
@ -21,6 +21,8 @@ import java.awt.event.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.plaf.*;
|
import javax.swing.plaf.*;
|
||||||
|
|
||||||
|
import org.adempiere.plaf.AdempierePLAF;
|
||||||
import org.compiere.plaf.*;
|
import org.compiere.plaf.*;
|
||||||
import org.compiere.util.*;
|
import org.compiere.util.*;
|
||||||
|
|
||||||
|
@ -132,10 +134,6 @@ public class CComboBox extends JComboBox
|
||||||
*/
|
*/
|
||||||
private void init()
|
private void init()
|
||||||
{
|
{
|
||||||
// overwrite - otherwise Label Font
|
|
||||||
setFont(AdempierePLAF.getFont_Field());
|
|
||||||
setForeground(AdempierePLAF.getTextColor_Normal());
|
|
||||||
setBackground(false);
|
|
||||||
FIELD_HIGHT = getPreferredSize().height;
|
FIELD_HIGHT = getPreferredSize().height;
|
||||||
} // init
|
} // init
|
||||||
|
|
||||||
|
@ -151,8 +149,8 @@ public class CComboBox extends JComboBox
|
||||||
*/
|
*/
|
||||||
public void setIcon (Icon defaultIcon)
|
public void setIcon (Icon defaultIcon)
|
||||||
{
|
{
|
||||||
if (getUI() instanceof AdempiereComboBoxUI)
|
if (getUI() instanceof CompiereComboBoxUI)
|
||||||
((AdempiereComboBoxUI)getUI()).setIcon(defaultIcon);
|
((CompiereComboBoxUI)getUI()).setIcon(defaultIcon);
|
||||||
m_icon = defaultIcon;
|
m_icon = defaultIcon;
|
||||||
} // setIcon
|
} // setIcon
|
||||||
|
|
||||||
|
@ -163,8 +161,8 @@ public class CComboBox extends JComboBox
|
||||||
public void setUI (ComboBoxUI ui)
|
public void setUI (ComboBoxUI ui)
|
||||||
{
|
{
|
||||||
super.setUI(ui);
|
super.setUI(ui);
|
||||||
if (m_icon != null && ui instanceof AdempiereComboBoxUI)
|
if (m_icon != null && ui instanceof CompiereComboBoxUI)
|
||||||
((AdempiereComboBoxUI)getUI()).setIcon(m_icon);
|
((CompiereComboBoxUI)getUI()).setIcon(m_icon);
|
||||||
} // setUI
|
} // setUI
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -283,16 +281,16 @@ public class CComboBox extends JComboBox
|
||||||
* Add Mouse Listener - 1-4-0 Bug.
|
* Add Mouse Listener - 1-4-0 Bug.
|
||||||
* Bug in 1.4.0 Metal: arrowButton gets Mouse Events, so add the JComboBox
|
* Bug in 1.4.0 Metal: arrowButton gets Mouse Events, so add the JComboBox
|
||||||
* MouseListeners to the arrowButton - No context menu if right-click
|
* MouseListeners to the arrowButton - No context menu if right-click
|
||||||
* @see AdempiereComboBoxUI#installUI(JComponent)
|
* @see CompiereComboBoxUI#installUI(JComponent)
|
||||||
* @param ml
|
* @param ml
|
||||||
*/
|
*/
|
||||||
public void addMouseListener (MouseListener ml)
|
public void addMouseListener (MouseListener ml)
|
||||||
{
|
{
|
||||||
super.addMouseListener(ml);
|
super.addMouseListener(ml);
|
||||||
// ignore calls from javax.swing.plaf.basic.BasicComboBoxUI.installListeners(BasicComboBoxUI.java:271)
|
// ignore calls from javax.swing.plaf.basic.BasicComboBoxUI.installListeners(BasicComboBoxUI.java:271)
|
||||||
if (getUI() instanceof AdempiereComboBoxUI && !Trace.getCallerClass(1).startsWith("javax"))
|
if (getUI() instanceof CompiereComboBoxUI && !Trace.getCallerClass(1).startsWith("javax"))
|
||||||
{
|
{
|
||||||
JButton b = ((AdempiereComboBoxUI)getUI()).getArrowButton();
|
JButton b = ((CompiereComboBoxUI)getUI()).getArrowButton();
|
||||||
if (b != null)
|
if (b != null)
|
||||||
b.addMouseListener(ml);
|
b.addMouseListener(ml);
|
||||||
}
|
}
|
||||||
|
@ -313,9 +311,9 @@ public class CComboBox extends JComboBox
|
||||||
public void removeMouseListener (MouseListener ml)
|
public void removeMouseListener (MouseListener ml)
|
||||||
{
|
{
|
||||||
super.removeMouseListener(ml);
|
super.removeMouseListener(ml);
|
||||||
if (getUI() instanceof AdempiereComboBoxUI)
|
if (getUI() instanceof CompiereComboBoxUI)
|
||||||
{
|
{
|
||||||
JButton b = ((AdempiereComboBoxUI)getUI()).getArrowButton();
|
JButton b = ((CompiereComboBoxUI)getUI()).getArrowButton();
|
||||||
if (b != null)
|
if (b != null)
|
||||||
b.removeMouseListener(ml);
|
b.removeMouseListener(ml);
|
||||||
}
|
}
|
||||||
|
|
|
@ -152,7 +152,6 @@ public class CDialog extends JDialog
|
||||||
protected void dialogInit()
|
protected void dialogInit()
|
||||||
{
|
{
|
||||||
super.dialogInit();
|
super.dialogInit();
|
||||||
AdempiereColor.setBackground(this);
|
|
||||||
setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
|
setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
|
||||||
setTitle(getTitle()); // remove Mn
|
setTitle(getTitle()); // remove Mn
|
||||||
//
|
//
|
||||||
|
|
|
@ -35,7 +35,7 @@ import javax.swing.JOptionPane;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.plaf.TextUI;
|
import javax.swing.plaf.TextUI;
|
||||||
|
|
||||||
import org.compiere.plaf.AdempierePLAF;
|
import org.adempiere.plaf.AdempierePLAF;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adempiere Colored Field with external popup editor.
|
* Adempiere Colored Field with external popup editor.
|
||||||
|
|
|
@ -76,7 +76,6 @@ public class CFrame extends JFrame
|
||||||
protected void frameInit ()
|
protected void frameInit ()
|
||||||
{
|
{
|
||||||
super.frameInit ();
|
super.frameInit ();
|
||||||
AdempiereColor.setBackground(this);
|
|
||||||
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
|
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
|
||||||
//
|
//
|
||||||
Container c = getContentPane();
|
Container c = getContentPane();
|
||||||
|
|
|
@ -174,9 +174,6 @@ public class CLabel extends JLabel
|
||||||
setOpaque(false);
|
setOpaque(false);
|
||||||
if (getToolTipText() == null) // force Tool Tip
|
if (getToolTipText() == null) // force Tool Tip
|
||||||
setToolTipText(getText());
|
setToolTipText(getText());
|
||||||
//
|
|
||||||
setForeground(AdempierePLAF.getTextColor_Label());
|
|
||||||
setFont(AdempierePLAF.getFont_Label());
|
|
||||||
} // init
|
} // init
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -18,6 +18,8 @@ package org.compiere.swing;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|
||||||
|
import org.adempiere.plaf.AdempierePLAF;
|
||||||
import org.compiere.plaf.*;
|
import org.compiere.plaf.*;
|
||||||
import org.compiere.util.*;
|
import org.compiere.util.*;
|
||||||
|
|
||||||
|
@ -79,7 +81,7 @@ public class CPanel extends JPanel
|
||||||
* Creates a new <code>CPanel</code> with a double buffer and a flow layout.
|
* Creates a new <code>CPanel</code> with a double buffer and a flow layout.
|
||||||
* @param bc Initial Background Color
|
* @param bc Initial Background Color
|
||||||
*/
|
*/
|
||||||
public CPanel(AdempiereColor bc)
|
public CPanel(CompiereColor bc)
|
||||||
{
|
{
|
||||||
this ();
|
this ();
|
||||||
init();
|
init();
|
||||||
|
@ -107,20 +109,20 @@ public class CPanel extends JPanel
|
||||||
return;
|
return;
|
||||||
super.setBackground (bg);
|
super.setBackground (bg);
|
||||||
// ignore calls from javax.swing.LookAndFeel.installColors(LookAndFeel.java:61)
|
// ignore calls from javax.swing.LookAndFeel.installColors(LookAndFeel.java:61)
|
||||||
if (!Trace.getCallerClass(1).startsWith("javax"))
|
//if (!Trace.getCallerClass(1).startsWith("javax"))
|
||||||
setBackgroundColor (new AdempiereColor(bg));
|
setBackgroundColor (new CompiereColor(bg));
|
||||||
} // setBackground
|
} // setBackground
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set Background
|
* Set Background
|
||||||
* @param bg AdempiereColor for Background, if null set standard background
|
* @param bg AdempiereColor for Background, if null set standard background
|
||||||
*/
|
*/
|
||||||
public void setBackgroundColor (AdempiereColor bg)
|
public void setBackgroundColor (CompiereColor bg)
|
||||||
{
|
{
|
||||||
if (bg == null)
|
if (bg == null)
|
||||||
bg = AdempierePanelUI.getDefaultBackground();
|
bg = new CompiereColor(AdempierePLAF.getFormBackground());
|
||||||
setOpaque(true); // not transparent
|
setOpaque(true); // not transparent
|
||||||
putClientProperty(AdempierePLAF.BACKGROUND, bg);
|
putClientProperty(CompiereLookAndFeel.BACKGROUND, bg);
|
||||||
super.setBackground (bg.getFlatColor());
|
super.setBackground (bg.getFlatColor());
|
||||||
} // setBackground
|
} // setBackground
|
||||||
|
|
||||||
|
@ -128,11 +130,11 @@ public class CPanel extends JPanel
|
||||||
* Get Background
|
* Get Background
|
||||||
* @return Color for Background
|
* @return Color for Background
|
||||||
*/
|
*/
|
||||||
public AdempiereColor getBackgroundColor ()
|
public CompiereColor getBackgroundColor ()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return (AdempiereColor)getClientProperty(AdempierePLAF.BACKGROUND);
|
return (CompiereColor)getClientProperty(CompiereLookAndFeel.BACKGROUND);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -152,9 +154,9 @@ public class CPanel extends JPanel
|
||||||
public void setTabLevel (int level)
|
public void setTabLevel (int level)
|
||||||
{
|
{
|
||||||
if (level == 0)
|
if (level == 0)
|
||||||
putClientProperty(AdempierePLAF.TABLEVEL, null);
|
putClientProperty(CompiereLookAndFeel.TABLEVEL, null);
|
||||||
else
|
else
|
||||||
putClientProperty(AdempierePLAF.TABLEVEL, new Integer(level));
|
putClientProperty(CompiereLookAndFeel.TABLEVEL, new Integer(level));
|
||||||
} // setTabLevel
|
} // setTabLevel
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -165,7 +167,7 @@ public class CPanel extends JPanel
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
Integer ll = (Integer)getClientProperty(AdempierePLAF.TABLEVEL);
|
Integer ll = (Integer)getClientProperty(CompiereLookAndFeel.TABLEVEL);
|
||||||
if (ll != null)
|
if (ll != null)
|
||||||
return ll.intValue();
|
return ll.intValue();
|
||||||
}
|
}
|
||||||
|
@ -185,7 +187,7 @@ public class CPanel extends JPanel
|
||||||
{
|
{
|
||||||
StringBuffer sb = new StringBuffer ("CPanel [");
|
StringBuffer sb = new StringBuffer ("CPanel [");
|
||||||
sb.append(super.toString());
|
sb.append(super.toString());
|
||||||
AdempiereColor bg = getBackgroundColor();
|
CompiereColor bg = getBackgroundColor();
|
||||||
if (bg != null)
|
if (bg != null)
|
||||||
sb.append(bg.toString());
|
sb.append(bg.toString());
|
||||||
sb.append("]");
|
sb.append("]");
|
||||||
|
|
|
@ -21,7 +21,7 @@ import java.awt.Color;
|
||||||
import javax.swing.JPasswordField;
|
import javax.swing.JPasswordField;
|
||||||
import javax.swing.text.Document;
|
import javax.swing.text.Document;
|
||||||
|
|
||||||
import org.compiere.plaf.AdempierePLAF;
|
import org.adempiere.plaf.AdempierePLAF;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Password Field
|
* Password Field
|
||||||
|
@ -107,8 +107,6 @@ public class CPassword extends JPasswordField implements CEditor
|
||||||
*/
|
*/
|
||||||
private void init()
|
private void init()
|
||||||
{
|
{
|
||||||
setFont(AdempierePLAF.getFont_Field());
|
|
||||||
setForeground(AdempierePLAF.getTextColor_Normal());
|
|
||||||
} // init
|
} // init
|
||||||
|
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
|
@ -20,6 +20,7 @@ import java.awt.*;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|
||||||
|
import org.adempiere.plaf.AdempierePLAF;
|
||||||
import org.compiere.plaf.*;
|
import org.compiere.plaf.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -67,7 +68,6 @@ public class CScrollPane extends JScrollPane
|
||||||
public CScrollPane (Component view, int vsbPolicy, int hsbPolicy)
|
public CScrollPane (Component view, int vsbPolicy, int hsbPolicy)
|
||||||
{
|
{
|
||||||
super (view, vsbPolicy, hsbPolicy);
|
super (view, vsbPolicy, hsbPolicy);
|
||||||
setBackgroundColor(null);
|
|
||||||
setOpaque(false);
|
setOpaque(false);
|
||||||
getViewport().setOpaque(false);
|
getViewport().setOpaque(false);
|
||||||
} // CScollPane
|
} // CScollPane
|
||||||
|
@ -77,15 +77,11 @@ public class CScrollPane extends JScrollPane
|
||||||
* Set Background
|
* Set Background
|
||||||
* @param bg AdempiereColor for Background, if null set standard background
|
* @param bg AdempiereColor for Background, if null set standard background
|
||||||
*/
|
*/
|
||||||
public void setBackgroundColor (AdempiereColor bg)
|
public void setBackgroundColor (CompiereColor bg)
|
||||||
{
|
{
|
||||||
if (bg == null)
|
if (bg == null)
|
||||||
bg = AdempierePanelUI.getDefaultBackground();
|
bg = new CompiereColor(AdempierePLAF.getFormBackground());
|
||||||
putClientProperty(AdempierePLAF.BACKGROUND, bg);
|
putClientProperty(CompiereLookAndFeel.BACKGROUND, bg);
|
||||||
// super.setBackground(bg.getFlatColor());
|
|
||||||
// getViewport().putClientProperty(AdempierePLAF.BACKGROUND, bg);
|
|
||||||
// getViewport().setBackground(bg.getFlatColor());
|
|
||||||
// getViewport().setOpaque(true);
|
|
||||||
} // setBackground
|
} // setBackground
|
||||||
|
|
||||||
} // CScollPane
|
} // CScollPane
|
||||||
|
|
|
@ -22,9 +22,10 @@ import java.util.*;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|
||||||
import org.compiere.plaf.AdempiereColor;
|
import org.adempiere.plaf.AdempierePLAF;
|
||||||
import org.compiere.plaf.AdempierePLAF;
|
import org.compiere.plaf.CompiereColor;
|
||||||
import org.compiere.plaf.AdempierePanelUI;
|
import org.compiere.plaf.CompiereLookAndFeel;
|
||||||
|
import org.compiere.plaf.CompierePanelUI;
|
||||||
import org.compiere.util.Trace;
|
import org.compiere.util.Trace;
|
||||||
import sun.swing.*;
|
import sun.swing.*;
|
||||||
|
|
||||||
|
@ -84,7 +85,7 @@ public class CTabbedPane extends JTabbedPane
|
||||||
* Creates an empty <code>TabbedPane</code> with a defaults and Color
|
* Creates an empty <code>TabbedPane</code> with a defaults and Color
|
||||||
* @param bg Color
|
* @param bg Color
|
||||||
*/
|
*/
|
||||||
public CTabbedPane (AdempiereColor bg)
|
public CTabbedPane (CompiereColor bg)
|
||||||
{
|
{
|
||||||
super();
|
super();
|
||||||
init();
|
init();
|
||||||
|
@ -96,9 +97,6 @@ public class CTabbedPane extends JTabbedPane
|
||||||
*/
|
*/
|
||||||
private void init()
|
private void init()
|
||||||
{
|
{
|
||||||
setOpaque(false);
|
|
||||||
setFont(AdempierePLAF.getFont_Label());
|
|
||||||
setForeground(AdempierePLAF.getTextColor_Label());
|
|
||||||
} // init
|
} // init
|
||||||
|
|
||||||
|
|
||||||
|
@ -111,9 +109,7 @@ public class CTabbedPane extends JTabbedPane
|
||||||
if (bg.equals(getBackground()))
|
if (bg.equals(getBackground()))
|
||||||
return;
|
return;
|
||||||
super.setBackground (bg);
|
super.setBackground (bg);
|
||||||
// ignore calls from javax.swing.LookAndFeel.installColors(LookAndFeel.java:61)
|
setBackgroundColor (new CompiereColor(bg));
|
||||||
if (!Trace.getCallerClass(1).startsWith("javax"))
|
|
||||||
setBackgroundColor (new AdempiereColor(bg));
|
|
||||||
} // setBackground
|
} // setBackground
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -128,12 +124,11 @@ public class CTabbedPane extends JTabbedPane
|
||||||
* Set Background
|
* Set Background
|
||||||
* @param bg AdempiereColor for Background, if null set standard background
|
* @param bg AdempiereColor for Background, if null set standard background
|
||||||
*/
|
*/
|
||||||
public void setBackgroundColor (AdempiereColor bg)
|
public void setBackgroundColor (CompiereColor bg)
|
||||||
{
|
{
|
||||||
if (bg == null)
|
if (bg == null)
|
||||||
bg = AdempierePanelUI.getDefaultBackground();
|
bg = new CompiereColor(AdempierePLAF.getFormBackground());
|
||||||
setOpaque(true);
|
putClientProperty(CompiereLookAndFeel.BACKGROUND, bg);
|
||||||
putClientProperty(AdempierePLAF.BACKGROUND, bg);
|
|
||||||
super.setBackground (bg.getFlatColor());
|
super.setBackground (bg.getFlatColor());
|
||||||
//
|
//
|
||||||
repaint();
|
repaint();
|
||||||
|
@ -143,11 +138,11 @@ public class CTabbedPane extends JTabbedPane
|
||||||
* Get Background
|
* Get Background
|
||||||
* @return Color for Background
|
* @return Color for Background
|
||||||
*/
|
*/
|
||||||
public AdempiereColor getBackgroundColor ()
|
public CompiereColor getBackgroundColor ()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return (AdempiereColor)getClientProperty(AdempierePLAF.BACKGROUND);
|
return (CompiereColor)getClientProperty(CompiereLookAndFeel.BACKGROUND);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -195,10 +190,10 @@ public class CTabbedPane extends JTabbedPane
|
||||||
if (component instanceof JPanel)
|
if (component instanceof JPanel)
|
||||||
{
|
{
|
||||||
JPanel p = (JPanel)component;
|
JPanel p = (JPanel)component;
|
||||||
if (p.getClientProperty(AdempierePLAF.BACKGROUND) == null)
|
if (p.getClientProperty(CompiereLookAndFeel.BACKGROUND) == null)
|
||||||
{
|
{
|
||||||
AdempiereColor.setBackground(p);
|
//AdempiereColor.setBackground(p);
|
||||||
p.setOpaque(true);
|
//p.setOpaque(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Set first
|
// Set first
|
||||||
|
@ -328,7 +323,7 @@ public class CTabbedPane extends JTabbedPane
|
||||||
{
|
{
|
||||||
StringBuffer sb = new StringBuffer ("CTabbedPane [");
|
StringBuffer sb = new StringBuffer ("CTabbedPane [");
|
||||||
sb.append(super.toString());
|
sb.append(super.toString());
|
||||||
AdempiereColor bg = getBackgroundColor();
|
CompiereColor bg = getBackgroundColor();
|
||||||
if (bg != null)
|
if (bg != null)
|
||||||
sb.append(bg.toString());
|
sb.append(bg.toString());
|
||||||
sb.append("]");
|
sb.append("]");
|
||||||
|
|
|
@ -45,6 +45,8 @@ public class CTable extends JTable
|
||||||
setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
|
setAutoResizeMode(JTable.AUTO_RESIZE_OFF);
|
||||||
getTableHeader().addMouseListener(new CTableMouseListener());
|
getTableHeader().addMouseListener(new CTableMouseListener());
|
||||||
setSurrendersFocusOnKeystroke(true);
|
setSurrendersFocusOnKeystroke(true);
|
||||||
|
//Default row height too narrow
|
||||||
|
setRowHeight(getFont().getSize() + 8);
|
||||||
} // CTable
|
} // CTable
|
||||||
|
|
||||||
/** Last model index sorted */
|
/** Last model index sorted */
|
||||||
|
@ -301,4 +303,12 @@ public class CTable extends JTable
|
||||||
}
|
}
|
||||||
} // CTableMouseListener
|
} // CTableMouseListener
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setFont(Font font) {
|
||||||
|
super.setFont(font);
|
||||||
|
//Update row height
|
||||||
|
setRowHeight(getFont().getSize() + 8);
|
||||||
|
}
|
||||||
|
|
||||||
} // CTable
|
} // CTable
|
||||||
|
|
|
@ -23,6 +23,7 @@ import java.awt.im.*;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.text.*;
|
import javax.swing.text.*;
|
||||||
|
|
||||||
|
import org.adempiere.plaf.AdempierePLAF;
|
||||||
import org.compiere.plaf.*;
|
import org.compiere.plaf.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -125,8 +126,6 @@ public class CTextArea extends JScrollPane
|
||||||
m_textArea = textArea;
|
m_textArea = textArea;
|
||||||
super.setOpaque(false);
|
super.setOpaque(false);
|
||||||
super.getViewport().setOpaque(false);
|
super.getViewport().setOpaque(false);
|
||||||
m_textArea.setFont(AdempierePLAF.getFont_Field());
|
|
||||||
m_textArea.setForeground(AdempierePLAF.getTextColor_Normal());
|
|
||||||
m_textArea.setLineWrap(true);
|
m_textArea.setLineWrap(true);
|
||||||
m_textArea.setWrapStyleWord(true);
|
m_textArea.setWrapStyleWord(true);
|
||||||
// Overwrite default Tab
|
// Overwrite default Tab
|
||||||
|
|
|
@ -22,6 +22,7 @@ import java.awt.event.*;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.text.*;
|
import javax.swing.text.*;
|
||||||
|
|
||||||
|
import org.adempiere.plaf.AdempierePLAF;
|
||||||
import org.compiere.plaf.*;
|
import org.compiere.plaf.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -117,8 +118,6 @@ public class CTextField extends JTextField
|
||||||
*/
|
*/
|
||||||
private void init()
|
private void init()
|
||||||
{
|
{
|
||||||
setFont(AdempierePLAF.getFont_Field());
|
|
||||||
setForeground(AdempierePLAF.getTextColor_Normal());
|
|
||||||
setBackground (false);
|
setBackground (false);
|
||||||
// Minimum Size
|
// Minimum Size
|
||||||
Dimension size = getPreferredSize();
|
Dimension size = getPreferredSize();
|
||||||
|
|
|
@ -23,6 +23,7 @@ import java.awt.im.*;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import javax.swing.text.*;
|
import javax.swing.text.*;
|
||||||
|
|
||||||
|
import org.adempiere.plaf.AdempierePLAF;
|
||||||
import org.compiere.plaf.*;
|
import org.compiere.plaf.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -63,8 +64,6 @@ public class CTextPane extends JScrollPane
|
||||||
super.setOpaque(false);
|
super.setOpaque(false);
|
||||||
super.getViewport().setOpaque(false);
|
super.getViewport().setOpaque(false);
|
||||||
m_textPane.setContentType("text/html");
|
m_textPane.setContentType("text/html");
|
||||||
m_textPane.setFont(AdempierePLAF.getFont_Field());
|
|
||||||
m_textPane.setForeground(AdempierePLAF.getTextColor_Normal());
|
|
||||||
} // CTextPane
|
} // CTextPane
|
||||||
|
|
||||||
private JTextPane m_textPane = null;
|
private JTextPane m_textPane = null;
|
||||||
|
|
|
@ -22,8 +22,9 @@ import javax.swing.Action;
|
||||||
import javax.swing.Icon;
|
import javax.swing.Icon;
|
||||||
import javax.swing.JToggleButton;
|
import javax.swing.JToggleButton;
|
||||||
|
|
||||||
import org.compiere.plaf.AdempiereColor;
|
import org.adempiere.plaf.AdempierePLAF;
|
||||||
import org.compiere.plaf.AdempierePLAF;
|
import org.compiere.plaf.CompiereColor;
|
||||||
|
import org.compiere.plaf.CompiereLookAndFeel;
|
||||||
import org.compiere.util.Trace;
|
import org.compiere.util.Trace;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -125,11 +126,6 @@ public class CToggleButton extends JToggleButton implements CEditor
|
||||||
public CToggleButton (String text, Icon icon, boolean selected)
|
public CToggleButton (String text, Icon icon, boolean selected)
|
||||||
{
|
{
|
||||||
super(text, icon, selected);
|
super(text, icon, selected);
|
||||||
setContentAreaFilled(false);
|
|
||||||
setOpaque(false);
|
|
||||||
//
|
|
||||||
setFont(AdempierePLAF.getFont_Label());
|
|
||||||
setForeground(AdempierePLAF.getTextColor_Label());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
@ -144,12 +140,6 @@ public class CToggleButton extends JToggleButton implements CEditor
|
||||||
if (bg.equals(getBackground()))
|
if (bg.equals(getBackground()))
|
||||||
return;
|
return;
|
||||||
super.setBackground( bg);
|
super.setBackground( bg);
|
||||||
// ignore calls from javax.swing.LookAndFeel.installColors(LookAndFeel.java:61)
|
|
||||||
if (!Trace.getCallerClass(1).startsWith("javax"))
|
|
||||||
{
|
|
||||||
setOpaque(true);
|
|
||||||
setContentAreaFilled(true);
|
|
||||||
}
|
|
||||||
} // setBackground
|
} // setBackground
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -172,12 +162,12 @@ public class CToggleButton extends JToggleButton implements CEditor
|
||||||
* Set Background
|
* Set Background
|
||||||
* @param bg AdempiereColor for Background, if null set standard background
|
* @param bg AdempiereColor for Background, if null set standard background
|
||||||
*/
|
*/
|
||||||
public void setBackgroundColor (AdempiereColor bg)
|
public void setBackgroundColor (CompiereColor bg)
|
||||||
{
|
{
|
||||||
if (bg == null)
|
if (bg == null)
|
||||||
bg = AdempiereColor.getDefaultBackground();
|
bg = new CompiereColor(AdempierePLAF.getFormBackground());
|
||||||
setOpaque(true);
|
setOpaque(true);
|
||||||
putClientProperty(AdempierePLAF.BACKGROUND, bg);
|
putClientProperty(CompiereLookAndFeel.BACKGROUND, bg);
|
||||||
super.setBackground (bg.getFlatColor());
|
super.setBackground (bg.getFlatColor());
|
||||||
} // setBackground
|
} // setBackground
|
||||||
|
|
||||||
|
@ -185,11 +175,11 @@ public class CToggleButton extends JToggleButton implements CEditor
|
||||||
* Get Background
|
* Get Background
|
||||||
* @return Color for Background
|
* @return Color for Background
|
||||||
*/
|
*/
|
||||||
public AdempiereColor getBackgroundColor ()
|
public CompiereColor getBackgroundColor ()
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
return (AdempiereColor)getClientProperty(AdempierePLAF.BACKGROUND);
|
return (CompiereColor)getClientProperty(CompiereLookAndFeel.BACKGROUND);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||||
* or via info@compiere.org or http://www.compiere.org/license.html *
|
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
package org.compiere.plaf;
|
package org.compiere.swing;
|
||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.Color;
|
||||||
import java.util.logging.*;
|
import java.util.logging.*;
|
|
@ -14,13 +14,16 @@
|
||||||
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||||
* or via info@compiere.org or http://www.compiere.org/license.html *
|
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
package org.compiere.plaf;
|
package org.compiere.swing;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.event.*;
|
import java.awt.event.*;
|
||||||
import java.beans.*;
|
import java.beans.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|
||||||
|
import org.adempiere.plaf.AdempierePLAF;
|
||||||
|
import org.compiere.plaf.CompiereColor;
|
||||||
import org.compiere.swing.*;
|
import org.compiere.swing.*;
|
||||||
import org.compiere.util.*;
|
import org.compiere.util.*;
|
||||||
|
|
||||||
|
@ -30,7 +33,7 @@ import org.compiere.util.*;
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: AdempiereColorEditor.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
* @version $Id: AdempiereColorEditor.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
||||||
*/
|
*/
|
||||||
public class AdempiereColorEditor extends CDialog
|
public class ColorEditor extends CDialog
|
||||||
implements ActionListener, PropertyEditor
|
implements ActionListener, PropertyEditor
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
@ -39,9 +42,9 @@ public class AdempiereColorEditor extends CDialog
|
||||||
* @param color optional initial color
|
* @param color optional initial color
|
||||||
* @return AdempiereColor
|
* @return AdempiereColor
|
||||||
*/
|
*/
|
||||||
public static AdempiereColor showDialog (Frame owner, AdempiereColor color)
|
public static CompiereColor showDialog (Frame owner, CompiereColor color)
|
||||||
{
|
{
|
||||||
AdempiereColorEditor cce = new AdempiereColorEditor (owner, color);
|
ColorEditor cce = new ColorEditor (owner, color);
|
||||||
if (cce.isSaved())
|
if (cce.isSaved())
|
||||||
return cce.getColor();
|
return cce.getColor();
|
||||||
return color;
|
return color;
|
||||||
|
@ -53,9 +56,9 @@ public class AdempiereColorEditor extends CDialog
|
||||||
* @param color optional initial color
|
* @param color optional initial color
|
||||||
* @return AdempiereColor
|
* @return AdempiereColor
|
||||||
*/
|
*/
|
||||||
public static AdempiereColor showDialog (Dialog owner, AdempiereColor color)
|
public static CompiereColor showDialog (Dialog owner, CompiereColor color)
|
||||||
{
|
{
|
||||||
AdempiereColorEditor cce = new AdempiereColorEditor (owner, color);
|
ColorEditor cce = new ColorEditor (owner, color);
|
||||||
if (cce.isSaved())
|
if (cce.isSaved())
|
||||||
return cce.getColor();
|
return cce.getColor();
|
||||||
return color;
|
return color;
|
||||||
|
@ -68,7 +71,7 @@ public class AdempiereColorEditor extends CDialog
|
||||||
* @param owner owner
|
* @param owner owner
|
||||||
* @param color Start Color
|
* @param color Start Color
|
||||||
*/
|
*/
|
||||||
public AdempiereColorEditor (Frame owner, AdempiereColor color)
|
public ColorEditor (Frame owner, CompiereColor color)
|
||||||
{
|
{
|
||||||
super(owner, "", true);
|
super(owner, "", true);
|
||||||
init (color);
|
init (color);
|
||||||
|
@ -79,7 +82,7 @@ public class AdempiereColorEditor extends CDialog
|
||||||
* @param owner owner
|
* @param owner owner
|
||||||
* @param color Start Color
|
* @param color Start Color
|
||||||
*/
|
*/
|
||||||
public AdempiereColorEditor (Dialog owner, AdempiereColor color)
|
public ColorEditor (Dialog owner, CompiereColor color)
|
||||||
{
|
{
|
||||||
super(owner, "", true);
|
super(owner, "", true);
|
||||||
init (color);
|
init (color);
|
||||||
|
@ -89,7 +92,7 @@ public class AdempiereColorEditor extends CDialog
|
||||||
* Init Dialog
|
* Init Dialog
|
||||||
* @param color Start Color
|
* @param color Start Color
|
||||||
*/
|
*/
|
||||||
private void init (AdempiereColor color)
|
private void init (CompiereColor color)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -119,13 +122,13 @@ public class AdempiereColorEditor extends CDialog
|
||||||
if (color == null)
|
if (color == null)
|
||||||
setColor (m_cc);
|
setColor (m_cc);
|
||||||
else
|
else
|
||||||
setColor (new AdempiereColor(color));
|
setColor (new CompiereColor(color));
|
||||||
AdempierePLAF.showCenterScreen(this);
|
AdempierePLAF.showCenterScreen(this);
|
||||||
} // init
|
} // init
|
||||||
|
|
||||||
|
|
||||||
private static ResourceBundle res = ResourceBundle.getBundle("org.compiere.plaf.PlafRes");
|
private static ResourceBundle res = ResourceBundle.getBundle("org.compiere.plaf.PlafRes");
|
||||||
private AdempiereColor m_cc = null;
|
private CompiereColor m_cc = null;
|
||||||
private boolean m_saved = false;
|
private boolean m_saved = false;
|
||||||
private boolean m_setting = false;
|
private boolean m_setting = false;
|
||||||
|
|
||||||
|
@ -137,7 +140,7 @@ public class AdempiereColorEditor extends CDialog
|
||||||
private FlowLayout southLayout = new FlowLayout();
|
private FlowLayout southLayout = new FlowLayout();
|
||||||
private GridBagLayout northLayout = new GridBagLayout();
|
private GridBagLayout northLayout = new GridBagLayout();
|
||||||
private CLabel typeLabel = new CLabel();
|
private CLabel typeLabel = new CLabel();
|
||||||
private CComboBox typeField = new CComboBox(AdempiereColor.TYPES);
|
private CComboBox typeField = new CComboBox(CompiereColor.TYPES);
|
||||||
private CButton gradientUpper = new CButton();
|
private CButton gradientUpper = new CButton();
|
||||||
private CButton gradientLower = new CButton();
|
private CButton gradientLower = new CButton();
|
||||||
private CLabel urlLabel = new CLabel();
|
private CLabel urlLabel = new CLabel();
|
||||||
|
@ -153,7 +156,7 @@ public class AdempiereColorEditor extends CDialog
|
||||||
private CTextField distanceField = new CTextField(10);
|
private CTextField distanceField = new CTextField(10);
|
||||||
private CPanel centerPanel = new CPanel();
|
private CPanel centerPanel = new CPanel();
|
||||||
private CButton flatField = new CButton();
|
private CButton flatField = new CButton();
|
||||||
private CComboBox gradientStartField = new CComboBox(AdempiereColor.GRADIENT_SP);
|
private CComboBox gradientStartField = new CComboBox(CompiereColor.GRADIENT_SP);
|
||||||
private CTextField gradientDistanceField = new CTextField(10);
|
private CTextField gradientDistanceField = new CTextField(10);
|
||||||
private CLabel gradientStartLabel = new CLabel();
|
private CLabel gradientStartLabel = new CLabel();
|
||||||
private CLabel gradientDistanceLabel = new CLabel();
|
private CLabel gradientDistanceLabel = new CLabel();
|
||||||
|
@ -312,14 +315,14 @@ public class AdempiereColorEditor extends CDialog
|
||||||
private void cmd_type()
|
private void cmd_type()
|
||||||
{
|
{
|
||||||
ValueNamePair vp = (ValueNamePair)typeField.getSelectedItem();
|
ValueNamePair vp = (ValueNamePair)typeField.getSelectedItem();
|
||||||
if (vp.getValue().equals(AdempiereColor.TYPE_FLAT))
|
if (vp.getValue().equals(CompiereColor.TYPE_FLAT))
|
||||||
m_cc = new AdempiereColor(AdempiereColor.TYPE_FLAT);
|
m_cc = new CompiereColor(CompiereColor.TYPE_FLAT);
|
||||||
else if (vp.getValue().equals(AdempiereColor.TYPE_GRADIENT))
|
else if (vp.getValue().equals(CompiereColor.TYPE_GRADIENT))
|
||||||
m_cc = new AdempiereColor(AdempiereColor.TYPE_GRADIENT);
|
m_cc = new CompiereColor(CompiereColor.TYPE_GRADIENT);
|
||||||
else if (vp.getValue().equals(AdempiereColor.TYPE_TEXTURE))
|
else if (vp.getValue().equals(CompiereColor.TYPE_TEXTURE))
|
||||||
m_cc = new AdempiereColor(AdempiereColor.TYPE_TEXTURE);
|
m_cc = new CompiereColor(CompiereColor.TYPE_TEXTURE);
|
||||||
else if (vp.getValue().equals(AdempiereColor.TYPE_LINES))
|
else if (vp.getValue().equals(CompiereColor.TYPE_LINES))
|
||||||
m_cc = new AdempiereColor(AdempiereColor.TYPE_LINES);
|
m_cc = new CompiereColor(CompiereColor.TYPE_LINES);
|
||||||
setColor (m_cc);
|
setColor (m_cc);
|
||||||
} // cmd_type
|
} // cmd_type
|
||||||
|
|
||||||
|
@ -327,7 +330,7 @@ public class AdempiereColorEditor extends CDialog
|
||||||
* Set Color and update UI
|
* Set Color and update UI
|
||||||
* @param color color
|
* @param color color
|
||||||
*/
|
*/
|
||||||
public void setColor (AdempiereColor color)
|
public void setColor (CompiereColor color)
|
||||||
{
|
{
|
||||||
if (color == null && m_cc != null)
|
if (color == null && m_cc != null)
|
||||||
return;
|
return;
|
||||||
|
@ -335,7 +338,7 @@ public class AdempiereColorEditor extends CDialog
|
||||||
// System.out.println("AdempiereColorEditor.setColor " + color);
|
// System.out.println("AdempiereColorEditor.setColor " + color);
|
||||||
m_cc = color;
|
m_cc = color;
|
||||||
if (m_cc == null)
|
if (m_cc == null)
|
||||||
m_cc = AdempierePanelUI.getDefaultBackground();
|
m_cc = CompiereColor.getDefaultBackground();
|
||||||
|
|
||||||
// update display
|
// update display
|
||||||
updateFields();
|
updateFields();
|
||||||
|
@ -350,11 +353,11 @@ public class AdempiereColorEditor extends CDialog
|
||||||
{
|
{
|
||||||
m_setting = true;
|
m_setting = true;
|
||||||
// Type
|
// Type
|
||||||
for (int i = 0; i < AdempiereColor.TYPES.length; i++)
|
for (int i = 0; i < CompiereColor.TYPES.length; i++)
|
||||||
{
|
{
|
||||||
if (m_cc.getType().equals(AdempiereColor.TYPE_VALUES[i]))
|
if (m_cc.getType().equals(CompiereColor.TYPE_VALUES[i]))
|
||||||
{
|
{
|
||||||
typeField.setSelectedItem(AdempiereColor.TYPES[i]);
|
typeField.setSelectedItem(CompiereColor.TYPES[i]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -406,11 +409,11 @@ public class AdempiereColorEditor extends CDialog
|
||||||
gradientUpper.setBackground(m_cc.getGradientUpperColor());
|
gradientUpper.setBackground(m_cc.getGradientUpperColor());
|
||||||
gradientLower.setBackground(m_cc.getGradientLowerColor());
|
gradientLower.setBackground(m_cc.getGradientLowerColor());
|
||||||
gradientDistanceField.setText(String.valueOf(m_cc.getGradientRepeatDistance()));
|
gradientDistanceField.setText(String.valueOf(m_cc.getGradientRepeatDistance()));
|
||||||
for (int i = 0; i < AdempiereColor.GRADIENT_SP.length; i++)
|
for (int i = 0; i < CompiereColor.GRADIENT_SP.length; i++)
|
||||||
{
|
{
|
||||||
if (m_cc.getGradientStartPoint() == AdempiereColor.GRADIENT_SP_VALUES[i])
|
if (m_cc.getGradientStartPoint() == CompiereColor.GRADIENT_SP_VALUES[i])
|
||||||
{
|
{
|
||||||
gradientStartField.setSelectedItem(AdempiereColor.GRADIENT_SP[i]);
|
gradientStartField.setSelectedItem(CompiereColor.GRADIENT_SP[i]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -473,7 +476,7 @@ public class AdempiereColorEditor extends CDialog
|
||||||
* Get Color
|
* Get Color
|
||||||
* @return Color, when saved - else null
|
* @return Color, when saved - else null
|
||||||
*/
|
*/
|
||||||
public AdempiereColor getColor()
|
public CompiereColor getColor()
|
||||||
{
|
{
|
||||||
return m_cc;
|
return m_cc;
|
||||||
} // getColor
|
} // getColor
|
||||||
|
@ -501,8 +504,8 @@ public class AdempiereColorEditor extends CDialog
|
||||||
*/
|
*/
|
||||||
public void setValue(Object value)
|
public void setValue(Object value)
|
||||||
{
|
{
|
||||||
if (value != null && value instanceof AdempiereColor)
|
if (value != null && value instanceof CompiereColor)
|
||||||
setColor (new AdempiereColor((AdempiereColor)value));
|
setColor (new CompiereColor((CompiereColor)value));
|
||||||
else
|
else
|
||||||
throw new IllegalArgumentException("AdempiereColorEditor.setValue requires AdempiereColor");
|
throw new IllegalArgumentException("AdempiereColorEditor.setValue requires AdempiereColor");
|
||||||
} // setValue
|
} // setValue
|
|
@ -0,0 +1,30 @@
|
||||||
|
package org.compiere.swing;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import javax.swing.plaf.ColorUIResource;
|
||||||
|
|
||||||
|
public interface ExtendedTheme {
|
||||||
|
|
||||||
|
public ColorUIResource getWhite();
|
||||||
|
public ColorUIResource getBlack();
|
||||||
|
public ColorUIResource getErrorForeground();
|
||||||
|
public ColorUIResource getErrorBackground();
|
||||||
|
public ColorUIResource getInactiveBackground();
|
||||||
|
public ColorUIResource getMandatoryBackground();
|
||||||
|
public ColorUIResource getInfoBackground();
|
||||||
|
|
||||||
|
public final static ColorUIResource DEFAULT_MANDATORY_BG = new ColorUIResource(224, 224, 255); // blue-isch
|
||||||
|
public final static ColorUIResource DEFAULT_ERROR_BG = new ColorUIResource(255, 204, 204); // red-isch
|
||||||
|
public final static ColorUIResource DEFAULT_ERROR_FG = new ColorUIResource(204, 0, 0); // dark red
|
||||||
|
public final static ColorUIResource DEFAULT_INACTIVE_BG = new ColorUIResource(234, 234, 234); // light gray
|
||||||
|
public final static ColorUIResource DEFAULT_INFO_BG = new ColorUIResource(253, 237, 207); // light yellow
|
||||||
|
|
||||||
|
public void setUIProperties(Map propertyMap);
|
||||||
|
|
||||||
|
public final static String ERROR_BG_KEY = "TextField.errorBackground";
|
||||||
|
public final static String ERROR_FG_KEY = "TextField.errorForeground";
|
||||||
|
public final static String MANDATORY_BG_KEY = "TextField.mandatoryBackground";
|
||||||
|
public final static String INACTIVE_BG_KEY = "TextField.inactiveBackground";
|
||||||
|
public final static String INFO_BG_KEY = "Info.background";
|
||||||
|
}
|
|
@ -14,12 +14,14 @@
|
||||||
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
* ComPiere, Inc., 2620 Augustine Dr. #245, Santa Clara, CA 95054, USA *
|
||||||
* or via info@compiere.org or http://www.compiere.org/license.html *
|
* or via info@compiere.org or http://www.compiere.org/license.html *
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
package org.compiere.plaf;
|
package org.compiere.swing;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.awt.event.*;
|
import java.awt.event.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|
||||||
|
import org.adempiere.plaf.AdempierePLAF;
|
||||||
import org.compiere.swing.*;
|
import org.compiere.swing.*;
|
||||||
|
|
||||||
/**
|
/**
|
|
@ -0,0 +1,220 @@
|
||||||
|
package org.compiere.swing;
|
||||||
|
|
||||||
|
import java.awt.Color;
|
||||||
|
import java.awt.Font;
|
||||||
|
import java.awt.SystemColor;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Properties;
|
||||||
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
|
import javax.swing.plaf.ColorUIResource;
|
||||||
|
import javax.swing.plaf.FontUIResource;
|
||||||
|
import javax.swing.plaf.metal.MetalTheme;
|
||||||
|
|
||||||
|
import org.compiere.plaf.CompiereColor;
|
||||||
|
|
||||||
|
public final class ThemeUtils {
|
||||||
|
|
||||||
|
/** Logger */
|
||||||
|
private static Logger log = Logger.getLogger(ThemeUtils.class.getName());
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parses Color into String representation.
|
||||||
|
* Required as SystemColors and Alpha Colors have different formats
|
||||||
|
* @param c Color
|
||||||
|
* @return [r=102,g=102,b=153,a=255]
|
||||||
|
* @see #parseColor
|
||||||
|
*/
|
||||||
|
public static String getColorAsString (Color c)
|
||||||
|
{
|
||||||
|
if (c == null)
|
||||||
|
c = SystemColor.control;
|
||||||
|
StringBuffer sb = new StringBuffer("[r=").append(c.getRed())
|
||||||
|
.append(",g=").append(c.getGreen())
|
||||||
|
.append(",b=").append(c.getBlue())
|
||||||
|
.append(",a=").append(c.getAlpha())
|
||||||
|
.append("]");
|
||||||
|
// System.out.println(sb.toString());
|
||||||
|
return sb.toString();
|
||||||
|
} // getColorAsString
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parse Color.
|
||||||
|
* <p>
|
||||||
|
* Color - [r=102,g=102,b=153,a=0]
|
||||||
|
*
|
||||||
|
* @param information string information to be parsed
|
||||||
|
* @param stdColor color used if info cannot parsed
|
||||||
|
* @return color
|
||||||
|
* @see #getColorAsString
|
||||||
|
*/
|
||||||
|
public static ColorUIResource parseColor (String information, ColorUIResource stdColor)
|
||||||
|
{
|
||||||
|
if (information == null
|
||||||
|
|| information.length() == 0
|
||||||
|
|| information.trim().length() == 0)
|
||||||
|
return stdColor;
|
||||||
|
// System.out.print("ParseColor=" + info);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
int r = Integer.parseInt(information.substring(information.indexOf("r=")+2, information.indexOf(",g=")));
|
||||||
|
int g = Integer.parseInt(information.substring(information.indexOf("g=")+2, information.indexOf(",b=")));
|
||||||
|
int b = 0;
|
||||||
|
int a = 255;
|
||||||
|
if (information.indexOf("a=") == -1)
|
||||||
|
b = Integer.parseInt(information.substring(information.indexOf("b=")+2, information.indexOf("]")));
|
||||||
|
else
|
||||||
|
{
|
||||||
|
b = Integer.parseInt(information.substring(information.indexOf("b=")+2, information.indexOf(",a=")));
|
||||||
|
a = Integer.parseInt(information.substring(information.indexOf("a=")+2, information.indexOf("]")));
|
||||||
|
}
|
||||||
|
ColorUIResource retValue = new ColorUIResource(new Color(r, g, b, a));
|
||||||
|
// System.out.println(" - " + retValue.toString());
|
||||||
|
return retValue;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
log.config(information + " - cannot parse: " + e.toString());
|
||||||
|
}
|
||||||
|
return stdColor;
|
||||||
|
} // parseColor
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parse Font
|
||||||
|
* <p>
|
||||||
|
* javax.swing.plaf.FontUIResource[family=dialog.bold,name=Dialog,style=bold,size=12]
|
||||||
|
*
|
||||||
|
* @param information string information to be parsed
|
||||||
|
* @param stdFont font used if info cannot be parsed
|
||||||
|
* @return font
|
||||||
|
*/
|
||||||
|
public static FontUIResource parseFont(String information, FontUIResource stdFont)
|
||||||
|
{
|
||||||
|
if (information == null
|
||||||
|
|| information.length() == 0
|
||||||
|
|| information.trim().length() == 0)
|
||||||
|
return stdFont;
|
||||||
|
// System.out.print("ParseFont=" + info);
|
||||||
|
try
|
||||||
|
{
|
||||||
|
String name = information.substring(information.indexOf("name=")+5, information.indexOf(",style="));
|
||||||
|
String s = information.substring(information.indexOf("style=")+6, information.indexOf(",size="));
|
||||||
|
int style = Font.PLAIN;
|
||||||
|
if (s.equals("bold"))
|
||||||
|
style = Font.BOLD;
|
||||||
|
else if (s.equals("italic"))
|
||||||
|
style = Font.ITALIC;
|
||||||
|
else if (s.equals("bolditalic"))
|
||||||
|
style = Font.BOLD | Font.ITALIC;
|
||||||
|
int size = Integer.parseInt(information.substring(information.indexOf(",size=")+6, information.lastIndexOf("]")));
|
||||||
|
FontUIResource retValue = new FontUIResource(name,style,size);
|
||||||
|
// System.out.println(" - " + retValue.toString());
|
||||||
|
return retValue;
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
log.config(information + " - cannot parse: " + e.toString());
|
||||||
|
}
|
||||||
|
return stdFont;
|
||||||
|
} // parseFont
|
||||||
|
|
||||||
|
// Static property info
|
||||||
|
public static final String P_Primary1 = "#ColorPrimary1";
|
||||||
|
public static final String P_Primary2 = "#ColorPrimary2";
|
||||||
|
public static final String P_Primary3 = "#ColorPrimary3";
|
||||||
|
public static final String P_Secondary1 = "#ColorSecondary1";
|
||||||
|
public static final String P_Secondary2 = "#ColorSecondary2";
|
||||||
|
public static final String P_Secondary3 = "#ColorSecondary3";
|
||||||
|
public static final String P_Black = "#ColorBlack";
|
||||||
|
public static final String P_White = "#ColorWhite";
|
||||||
|
public static final String P_Error = "#ColorError";
|
||||||
|
public static final String P_Info = "#ColorInfo";
|
||||||
|
public static final String P_Mandatory = "#ColorMandatory";
|
||||||
|
public static final String P_Inactive = "#ColorInactive";
|
||||||
|
public static final String P_Txt_OK = "#ColorTextOK";
|
||||||
|
public static final String P_Txt_Error = "#ColorTextError";
|
||||||
|
//
|
||||||
|
public static final String P_Control = "#FontControl";
|
||||||
|
public static final String P_System = "#FontSystem";
|
||||||
|
public static final String P_User = "#FontUser";
|
||||||
|
public static final String P_Small = "#FontSmall";
|
||||||
|
public static final String P_Window = "#FontWindow";
|
||||||
|
public static final String P_Menu = "#FontMenu";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Save information in Properties
|
||||||
|
*/
|
||||||
|
public static void save (Properties properties, MetalTheme theme)
|
||||||
|
{
|
||||||
|
log.config(CompiereColor.getDefaultBackground().toString());
|
||||||
|
//
|
||||||
|
properties.setProperty(P_Primary1, getColorAsString(theme.getPrimaryControlDarkShadow()));
|
||||||
|
properties.setProperty(P_Primary2, getColorAsString(theme.getPrimaryControlShadow()));
|
||||||
|
properties.setProperty(P_Primary3, getColorAsString(theme.getPrimaryControl()));
|
||||||
|
properties.setProperty(P_Secondary1, getColorAsString(theme.getControlDarkShadow()));
|
||||||
|
properties.setProperty(P_Secondary2, getColorAsString(theme.getControlShadow()));
|
||||||
|
properties.setProperty(P_Secondary3, getColorAsString(theme.getControl()));
|
||||||
|
properties.setProperty(P_Txt_OK, getColorAsString(theme.getUserTextColor()));
|
||||||
|
|
||||||
|
if ( theme instanceof ExtendedTheme ) {
|
||||||
|
ExtendedTheme e = (ExtendedTheme)theme;
|
||||||
|
properties.setProperty(P_Error, getColorAsString(e.getErrorBackground()));
|
||||||
|
properties.setProperty(P_Txt_Error, getColorAsString(e.getErrorForeground()));
|
||||||
|
properties.setProperty(P_Mandatory, getColorAsString(e.getMandatoryBackground()));
|
||||||
|
properties.setProperty(P_Inactive, getColorAsString(e.getInactiveBackground()));
|
||||||
|
properties.setProperty(P_White, getColorAsString(e.getWhite()));
|
||||||
|
properties.setProperty(P_Black, getColorAsString(e.getBlack()));
|
||||||
|
properties.setProperty(P_Info, getColorAsString(e.getInfoBackground()));
|
||||||
|
} else {
|
||||||
|
properties.setProperty(P_White, getColorAsString(Color.white));
|
||||||
|
properties.setProperty(P_Black, getColorAsString(Color.black));
|
||||||
|
properties.setProperty(P_Error, getColorAsString(ExtendedTheme.DEFAULT_ERROR_BG));
|
||||||
|
properties.setProperty(P_Txt_Error, getColorAsString(ExtendedTheme.DEFAULT_ERROR_FG));
|
||||||
|
properties.setProperty(P_Mandatory, getColorAsString(ExtendedTheme.DEFAULT_MANDATORY_BG));
|
||||||
|
properties.setProperty(P_Inactive, getColorAsString(ExtendedTheme.DEFAULT_INACTIVE_BG));
|
||||||
|
properties.setProperty(P_Info, getColorAsString(theme.getPrimaryControl()));
|
||||||
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
properties.setProperty(P_Control, (theme.getControlTextFont()).toString());
|
||||||
|
properties.setProperty(P_System, (theme.getSystemTextFont()).toString());
|
||||||
|
properties.setProperty(P_User, (theme.getUserTextFont()).toString());
|
||||||
|
properties.setProperty(P_Small, (theme.getSubTextFont()).toString());
|
||||||
|
properties.setProperty(P_Window, (theme.getWindowTitleFont()).toString());
|
||||||
|
properties.setProperty(P_Menu, (theme.getMenuTextFont()).toString());
|
||||||
|
|
||||||
|
} // save
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load Properties from properties
|
||||||
|
*/
|
||||||
|
public static void load (Properties properties, ExtendedTheme theme)
|
||||||
|
{
|
||||||
|
Map<String, Object> p = new HashMap<String, Object>();
|
||||||
|
p.put(P_Primary1, parseColor (properties.getProperty(P_Primary1),null));
|
||||||
|
p.put(P_Primary2, parseColor (properties.getProperty(P_Primary2),null));
|
||||||
|
p.put(P_Primary3, parseColor (properties.getProperty(P_Primary3), null));
|
||||||
|
p.put(P_Secondary1, parseColor (properties.getProperty(P_Secondary1), null));
|
||||||
|
p.put(P_Secondary2, parseColor (properties.getProperty(P_Secondary2), null));
|
||||||
|
p.put(P_Secondary3, parseColor (properties.getProperty(P_Secondary3), null));
|
||||||
|
p.put(P_Error, parseColor(properties.getProperty(P_Error), null));
|
||||||
|
p.put(P_Info, parseColor(properties.getProperty(P_Info), null));
|
||||||
|
p.put(P_Mandatory, parseColor(properties.getProperty(P_Mandatory), null));
|
||||||
|
p.put(P_Inactive, parseColor(properties.getProperty(P_Inactive), null));
|
||||||
|
p.put(P_White,parseColor(properties.getProperty(P_White), null));
|
||||||
|
p.put(P_Black, parseColor(properties.getProperty(P_Black), null));
|
||||||
|
p.put(P_Txt_OK, parseColor(properties.getProperty(P_Txt_OK), null));
|
||||||
|
p.put(P_Txt_Error,parseColor(properties.getProperty(P_Txt_Error), null));
|
||||||
|
//
|
||||||
|
p.put(P_Control, parseFont(properties.getProperty(P_Control), null));
|
||||||
|
p.put(P_System, parseFont(properties.getProperty(P_System), null));
|
||||||
|
p.put(P_User, parseFont(properties.getProperty(P_User), null));
|
||||||
|
p.put(P_Small, parseFont(properties.getProperty(P_Small), null));
|
||||||
|
p.put(P_Window, parseFont(properties.getProperty(P_Window), null));
|
||||||
|
p.put(P_Menu, parseFont(properties.getProperty(P_Menu), null));
|
||||||
|
//
|
||||||
|
theme.setUIProperties(p);
|
||||||
|
} // load
|
||||||
|
}
|
|
@ -75,9 +75,12 @@ public final class Ini implements Serializable
|
||||||
private static final String DEFAULT_UI_THEME = AdempiereThemeInnova.NAME;
|
private static final String DEFAULT_UI_THEME = AdempiereThemeInnova.NAME;
|
||||||
/** UI Theme */
|
/** UI Theme */
|
||||||
public static final String P_UI_THEME = "UITheme";
|
public static final String P_UI_THEME = "UITheme";
|
||||||
/** Flat Color UI */
|
|
||||||
|
/** Flat Color UI
|
||||||
public static final String P_UI_FLAT = "UIFlat";
|
public static final String P_UI_FLAT = "UIFlat";
|
||||||
private static final boolean DEFAULT_UI_FLAT = false;
|
private static final boolean DEFAULT_UI_FLAT = false;
|
||||||
|
*/
|
||||||
|
|
||||||
/** Auto Save */
|
/** Auto Save */
|
||||||
public static final String P_A_COMMIT = "AutoCommit";
|
public static final String P_A_COMMIT = "AutoCommit";
|
||||||
private static final boolean DEFAULT_A_COMMIT = true;
|
private static final boolean DEFAULT_A_COMMIT = true;
|
||||||
|
@ -148,7 +151,7 @@ public final class Ini implements Serializable
|
||||||
P_UID, P_PWD, P_TRACELEVEL, P_TRACEFILE,
|
P_UID, P_PWD, P_TRACELEVEL, P_TRACEFILE,
|
||||||
P_LANGUAGE, P_INI,
|
P_LANGUAGE, P_INI,
|
||||||
P_CONNECTION, P_STORE_PWD,
|
P_CONNECTION, P_STORE_PWD,
|
||||||
P_UI_LOOK, P_UI_THEME, P_UI_FLAT,
|
P_UI_LOOK, P_UI_THEME, /* P_UI_FLAT,*/
|
||||||
P_A_COMMIT, P_A_LOGIN, P_A_NEW,
|
P_A_COMMIT, P_A_LOGIN, P_A_NEW,
|
||||||
P_ADEMPIERESYS, P_SHOW_ACCT, P_SHOW_TRL,
|
P_ADEMPIERESYS, P_SHOW_ACCT, P_SHOW_TRL,
|
||||||
P_SHOW_ADVANCED, P_CACHE_WINDOW,
|
P_SHOW_ADVANCED, P_CACHE_WINDOW,
|
||||||
|
@ -165,7 +168,7 @@ public final class Ini implements Serializable
|
||||||
DEFAULT_UID, DEFAULT_PWD, DEFAULT_TRACELEVEL, DEFAULT_TRACEFILE?"Y":"N",
|
DEFAULT_UID, DEFAULT_PWD, DEFAULT_TRACELEVEL, DEFAULT_TRACEFILE?"Y":"N",
|
||||||
DEFAULT_LANGUAGE, DEFAULT_INI,
|
DEFAULT_LANGUAGE, DEFAULT_INI,
|
||||||
DEFAULT_CONNECTION, DEFAULT_STORE_PWD?"Y":"N",
|
DEFAULT_CONNECTION, DEFAULT_STORE_PWD?"Y":"N",
|
||||||
DEFAULT_UI_LOOK, DEFAULT_UI_THEME, DEFAULT_UI_FLAT?"Y":"N",
|
DEFAULT_UI_LOOK, DEFAULT_UI_THEME, /* DEFAULT_UI_FLAT?"Y":"N", */
|
||||||
DEFAULT_A_COMMIT?"Y":"N", DEFAULT_A_LOGIN?"Y":"N", DEFAULT_A_NEW?"Y":"N",
|
DEFAULT_A_COMMIT?"Y":"N", DEFAULT_A_LOGIN?"Y":"N", DEFAULT_A_NEW?"Y":"N",
|
||||||
DEFAULT_ADEMPIERESYS?"Y":"N", DEFAULT_SHOW_ACCT?"Y":"N", DEFAULT_SHOW_TRL?"Y":"N",
|
DEFAULT_ADEMPIERESYS?"Y":"N", DEFAULT_SHOW_ACCT?"Y":"N", DEFAULT_SHOW_TRL?"Y":"N",
|
||||||
DEFAULT_SHOW_ADVANCED?"Y":"N", DEFAULT_CACHE_WINDOW?"Y":"N",
|
DEFAULT_SHOW_ADVANCED?"Y":"N", DEFAULT_CACHE_WINDOW?"Y":"N",
|
||||||
|
|
|
@ -23,6 +23,7 @@ import java.util.*;
|
||||||
import java.util.logging.*;
|
import java.util.logging.*;
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
|
||||||
|
import org.adempiere.plaf.AdempierePLAF;
|
||||||
import org.compiere.swing.*;
|
import org.compiere.swing.*;
|
||||||
import org.compiere.plaf.*;
|
import org.compiere.plaf.*;
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,8 @@ import javax.swing.JDialog;
|
||||||
import javax.swing.JEditorPane;
|
import javax.swing.JEditorPane;
|
||||||
import javax.swing.JScrollPane;
|
import javax.swing.JScrollPane;
|
||||||
|
|
||||||
import org.compiere.plaf.AdempierePLAF;
|
import org.adempiere.plaf.AdempierePLAF;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mini Browser
|
* Mini Browser
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
swing.defaultlaf=org.compiere.plaf.AdempiereLookAndFeel
|
swing.defaultlaf=org.adempiere.plaf.AdempiereLookAndFeel
|
||||||
swing.installedlafs=Metal,Motif,Windows,Adempiere
|
swing.installedlafs=Metal,Motif,Windows,Adempiere
|
||||||
swing.installedlaf.Metal.class=javax.swing.plaf.metal.MetalLookAndFeel
|
swing.installedlaf.Metal.class=javax.swing.plaf.metal.MetalLookAndFeel
|
||||||
swing.installedlaf.Metal.name=Metal
|
swing.installedlaf.Metal.name=Metal
|
||||||
|
|
Loading…
Reference in New Issue