integrate kisitomomo patch
[ 1612136 ] checkbox look and feel improved https://sourceforge.net/tracker/index.php?func=detail&aid=1612136&group_id=176962&atid=879334
This commit is contained in:
parent
197331478e
commit
a682ce98c5
|
@ -1,5 +1,5 @@
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* Product: Adempiere ERP & CRM Smart Business Solution *
|
* Product: Adempiere ERP & CRM Smart Business Solution *
|
||||||
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
|
* Copyright (C) 1999-2006 ComPiere, Inc. All Rights Reserved. *
|
||||||
* This program is free software; you can redistribute it and/or modify it *
|
* 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 *
|
* under the terms version 2 of the GNU General Public License as published *
|
||||||
|
@ -13,20 +13,30 @@
|
||||||
* For the text or an alternative of this public license, you may reach us *
|
* 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 *
|
* 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 *
|
||||||
|
* Contributor(s): kisitomomo *
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
package org.compiere.plaf;
|
package org.compiere.plaf;
|
||||||
|
|
||||||
import javax.swing.AbstractButton;
|
import javax.swing.AbstractButton;
|
||||||
|
import javax.swing.JCheckBox;
|
||||||
import javax.swing.JComponent;
|
import javax.swing.JComponent;
|
||||||
import javax.swing.plaf.ComponentUI;
|
import javax.swing.plaf.ComponentUI;
|
||||||
import javax.swing.plaf.basic.*;
|
import javax.swing.plaf.basic.*;
|
||||||
import javax.swing.plaf.metal.MetalCheckBoxUI;
|
import javax.swing.plaf.metal.MetalCheckBoxUI;
|
||||||
|
import java.awt.Color;
|
||||||
|
import java.awt.Graphics;
|
||||||
|
import org.adempiere.plaf.*;
|
||||||
|
|
||||||
|
import com.jgoodies.looks.plastic.PlasticLookAndFeel;
|
||||||
/**
|
/**
|
||||||
* Check Box UI
|
* Check Box UI
|
||||||
*
|
*
|
||||||
* @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 $
|
||||||
|
*
|
||||||
|
* globalqss: integrate kisitomomo patch
|
||||||
|
* [ 1612136 ] checkbox look and feel improved
|
||||||
|
* https://sourceforge.net/tracker/index.php?func=detail&aid=1612136&group_id=176962&atid=879334
|
||||||
*/
|
*/
|
||||||
public class CompiereCheckBoxUI extends MetalCheckBoxUI
|
public class CompiereCheckBoxUI extends MetalCheckBoxUI
|
||||||
{
|
{
|
||||||
|
@ -37,6 +47,7 @@ public class CompiereCheckBoxUI extends MetalCheckBoxUI
|
||||||
*/
|
*/
|
||||||
public static ComponentUI createUI (JComponent b)
|
public static ComponentUI createUI (JComponent b)
|
||||||
{
|
{
|
||||||
|
|
||||||
return s_checkBoxUI;
|
return s_checkBoxUI;
|
||||||
} // createUI
|
} // createUI
|
||||||
|
|
||||||
|
@ -64,4 +75,36 @@ public class CompiereCheckBoxUI extends MetalCheckBoxUI
|
||||||
return new CompiereButtonListener(b);
|
return new CompiereButtonListener(b);
|
||||||
} // createButtonListener
|
} // createButtonListener
|
||||||
|
|
||||||
|
//kisito code
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected Color getDisabledTextColor() {
|
||||||
|
return AdempiereTheme.DARKEN_STOP;
|
||||||
|
}
|
||||||
|
private static void drawCheck(Graphics g, int x, int y) {
|
||||||
|
g.translate(x, y);
|
||||||
|
g.drawLine(3, 5, 3, 5);
|
||||||
|
g.fillRect(3, 6, 2, 2);
|
||||||
|
g.drawLine(4, 8, 9, 3);
|
||||||
|
g.drawLine(5, 8, 9, 4);
|
||||||
|
g.drawLine(5, 9, 9, 5);
|
||||||
|
g.translate(-x, -y);
|
||||||
|
}
|
||||||
|
|
||||||
|
public synchronized void paint(java.awt.Graphics g, JComponent c) {
|
||||||
|
|
||||||
|
super.paint(g,c);
|
||||||
|
JCheckBox chk=(JCheckBox)c;
|
||||||
|
if(!chk.isEnabled()) {
|
||||||
|
g.setColor(PlasticLookAndFeel.getControlDarkShadow());
|
||||||
|
g.drawRect(0, 3, 11, 11);
|
||||||
|
if(chk.getModel().isSelected())
|
||||||
|
{
|
||||||
|
drawCheck(g,0,4);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// end kisito
|
||||||
} // AdempiereCheckBoxUI
|
} // AdempiereCheckBoxUI
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
* For the text or an alternative of this public license, you may reach us *
|
* 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 *
|
* 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 *
|
||||||
|
* Contributor(s): kisitomomo *
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
package org.compiere.swing;
|
package org.compiere.swing;
|
||||||
|
|
||||||
|
@ -21,14 +22,17 @@ import java.awt.Color;
|
||||||
import javax.swing.Action;
|
import javax.swing.Action;
|
||||||
import javax.swing.Icon;
|
import javax.swing.Icon;
|
||||||
import javax.swing.JCheckBox;
|
import javax.swing.JCheckBox;
|
||||||
|
import org.compiere.plaf.*;
|
||||||
import org.adempiere.plaf.AdempierePLAF;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adempiere CheckBox
|
* Adempiere CheckBox
|
||||||
*
|
*
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: CCheckBox.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
* @version $Id: CCheckBox.java,v 1.2 2006/07/30 00:52:24 jjanke Exp $
|
||||||
|
*
|
||||||
|
* globalqss: integrate kisitomomo patch
|
||||||
|
* [ 1612136 ] checkbox look and feel improved
|
||||||
|
* https://sourceforge.net/tracker/index.php?func=detail&aid=1612136&group_id=176962&atid=879334
|
||||||
*/
|
*/
|
||||||
public class CCheckBox extends JCheckBox implements CEditor
|
public class CCheckBox extends JCheckBox implements CEditor
|
||||||
{
|
{
|
||||||
|
@ -39,6 +43,7 @@ public class CCheckBox extends JCheckBox implements CEditor
|
||||||
{
|
{
|
||||||
super ();
|
super ();
|
||||||
init();
|
init();
|
||||||
|
setUI(new CompiereCheckBoxUI()); //kisito code
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -199,6 +204,7 @@ public class CCheckBox extends JCheckBox implements CEditor
|
||||||
* Set Background
|
* Set Background
|
||||||
* @param bg
|
* @param bg
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setBackground (Color bg)
|
public void setBackground (Color bg)
|
||||||
{
|
{
|
||||||
if (bg.equals(getBackground()))
|
if (bg.equals(getBackground()))
|
||||||
|
@ -293,6 +299,12 @@ public class CCheckBox extends JCheckBox implements CEditor
|
||||||
}
|
}
|
||||||
return text;
|
return text;
|
||||||
} // createMnemonic
|
} // createMnemonic
|
||||||
|
/* @Override
|
||||||
|
public Icon getIcon() {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
} // CCheckBox
|
} // CCheckBox
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue