Update of /cvsroot/squirrel-sql/mavenize/thirdparty-non-maven/metouia/src/net/sourceforge/mlf/metouia/borders
In directory sfp-cvsdas-3.v30.ch3.sourceforge.com:/tmp/cvs-serv12694/thirdparty-non-maven/metouia/src/net/sourceforge/mlf/metouia/borders
Added Files:
MetouiaToolBarBorder.java MetouiaTextFieldBorder.class
MetouiaButtonBorder.java MetouiaDots.class
MetouiaToolBarBorder.class MetouiaTableHeaderBorder.java
MetouiaOptionDialogBorder.java MetouiaMenuBarBorder.java
MetouiaTableHeaderBorder.class MetouiaBorderUtilities.class
MetouiaBorderUtilities.java MetouiaTextFieldBorder.java
MetouiaPopupMenuBorder.java MetouiaMenuItemBorder.class
MetouiaScrollPaneBorder.class MetouiaPopupMenuBorder.class
MetouiaOptionDialogBorder.class MetouiaPaletteBorder.class
MetouiaMenuBarBorder.class MetouiaDots.java
MetouiaButtonBorder.class MetouiaScrollPaneBorder.java
MetouiaInternalFrameBorder.class
MetouiaToggleButtonBorder.java MetouiaInternalFrameBorder.java
MetouiaToggleButtonBorder.class MetouiaDotsBuffer.class
MetouiaDotsBuffer.java MetouiaPaletteBorder.java
MetouiaMenuItemBorder.java
Log Message:
Source for project which doesn't have a source code repo. Maven central only accepts artifacts whose source is hosted in a source repo.
--- NEW FILE: MetouiaMenuBarBorder.class ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: MetouiaDotsBuffer.java ---
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Metouia Look And Feel: a free pluggable look and feel for java *
* http://mlf.sourceforge.net *
* (C) Copyright 2002, by Taoufik Romdhane and Contributors. *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by *
* the Free Software Foundation; either version 2.1 of the License, or (at *
* your option) any later version. *
* *
* This library 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 Lesser 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. *
* *
* MetouiaDotsBuffer.java *
* Original Author: Taoufik Romdhane *
* Contributor(s): *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package net.sourceforge.mlf.metouia.borders;
import java.awt.BorderLayout;
import java.awt.Canvas;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.Graphics;
import java.awt.Image;
import net.sourceforge.mlf.metouia.MetouiaLookAndFeel;
import javax.swing.plaf.metal.MetalLookAndFeel;
/**
* This class represents a dots buffer providing images filled with dots.
*
* @author Taoufik Romdhane
*/
class MetouiaDotsBuffer
{
/**
* The frame object, needed for th graphics context.
*/
private static Frame frame;
/**
* The component, needed for the image object.
*/
private static Component component;
/**
* The image itself, used by MetouiaDots.
*/
private transient Image image;
/**
* The image size: should be a multiplicator of the dots size with insets.
*/
private static final int IMAGE_SIZE = 125;
/**
* The image dimension.
*/
private static Dimension imageSize = new Dimension(IMAGE_SIZE, IMAGE_SIZE);
/**
* The dots background color: usually the control's background.
*/
private Color background;
/**
* The dots highlight color: almost white.
*/
private Color highlight;
/**
* The dots shadow color: ordered by their light values.
*/
private Color shadow;
/**
* The dots darker shadow color: ordered by their light values.
*/
private Color darkshadow;
/**
* The dots even darker shadow color: ordered by their light values.
*/
private Color matteshadow;
/**
* Creates a new Metouia dots buffer with standard colors taken from the
* current theme.
*/
public MetouiaDotsBuffer()
{
// Create a frame in order to get a graphics context:
if (frame == null)
{
frame = new Frame("bufferCreator");
}
if (component == null)
{
component = new Canvas();
frame.add(component, BorderLayout.CENTER);
}
frame.addNotify();
// Create the image to draw on:
image = component.createImage(IMAGE_SIZE, IMAGE_SIZE);
// Set the colors:
background = MetalLookAndFeel.getControl();
matteshadow = MetouiaLookAndFeel.getPrimaryControl();
shadow = MetouiaLookAndFeel.getControlShadow();
darkshadow = MetouiaLookAndFeel.getControlDarkShadow();
highlight = MetouiaLookAndFeel.getPrimaryControlHighlight();
// Fill the buffer with dots:
fillBumpBuffer();
}
/**
* Gets the buffers image which is filled with the Metouia dots.
*
* @return The buffer's image filld with dots.
*/
public Image getImage()
{
if (image == null)
{
image = component.createImage(IMAGE_SIZE, IMAGE_SIZE);
fillBumpBuffer();
}
return image;
}
/**
* Gets the buffer's image size.
*
* @return The size of buffer's image.
*/
public Dimension getImageSize()
{
return imageSize;
}
/**
* Fills the buffer with the metouia dots.
*/
protected void fillBumpBuffer()
{
Graphics g = image.getGraphics();
g.setColor(background);
g.fillRect(0, 0, IMAGE_SIZE, IMAGE_SIZE);
g.setColor(matteshadow);
for (int x = 0; x < IMAGE_SIZE; x += 5)
{
for (int y = 0; y < IMAGE_SIZE; y += 5)
{
g.drawLine(x, y, x, y);
}
}
g.setColor(shadow);
for (int x = 1; x < IMAGE_SIZE; x += 5)
{
for (int y = 0; y < IMAGE_SIZE; y += 5)
{
g.drawLine(x, y, x, y);
g.drawLine(x-1, y+1, x-1, y+1);
}
}
g.setColor(darkshadow);
for (int x = 1; x < IMAGE_SIZE; x += 5)
{
for (int y = 1; y < IMAGE_SIZE; y += 5)
{
g.drawLine(x, y, x, y);
}
}
g.setColor(highlight);
for (int x = 2; x < IMAGE_SIZE; x += 5)
{
for (int y = 1; y < IMAGE_SIZE; y += 5)
{
g.drawLine(x, y, x, y+1);
g.drawLine(x+1, y+1, x+1, y+1);
}
}
g.dispose();
}
}
--- NEW FILE: MetouiaInternalFrameBorder.java ---
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Metouia Look And Feel: a free pluggable look and feel for java *
* http://mlf.sourceforge.net *
* (C) Copyright 2002, by Taoufik Romdhane and Contributors. *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by *
* the Free Software Foundation; either version 2.1 of the License, or (at *
* your option) any later version. *
* *
* This library 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 Lesser 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. *
* *
* MetouiaInternalFrameBorder.java *
* Original Author: Taoufik Romdhane *
* Contributor(s): *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package net.sourceforge.mlf.metouia.borders;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Insets;
import javax.swing.UIManager;
import javax.swing.border.AbstractBorder;
import javax.swing.plaf.UIResource;
import net.sourceforge.mlf.metouia.MetouiaLookAndFeel;
/**
* This class represents the border for internal frames.
*
* @author Taoufik Romdhane
*/
public class MetouiaInternalFrameBorder extends AbstractBorder
implements UIResource
{
/**
* The border insets.
*/
private static final Insets insets = new Insets(2, 2, 2, 2);
/**
* Draws a simple 3d border for the given component.
*
* @param c The component to draw its border.
* @param g The graphics context.
* @param x The x coordinate of the top left corner.
* @param y The y coordinate of the top left corner.
* @param w The width.
* @param h The height.
*/
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h)
{
// Inner highlight:
g.setColor(MetouiaLookAndFeel.getPrimaryControlHighlight());
g.drawLine(1, 1, w - 2, 1);
g.drawLine(1, 1, 1, h - 2);
// Inner shadow:
g.setColor(MetouiaLookAndFeel.getDesktopColor());
g.drawLine(w - 2, 2, w - 2, h - 2);
g.drawLine(2, h - 2, w - 2, h - 2);
// Bind the title frame border:
int frameTitleHeight
= UIManager.getInt("InternalFrame.frameTitleHeight");
g.setColor(MetouiaLookAndFeel.getControlDarkShadow());
g.drawLine(w - 2, frameTitleHeight, w - 2, frameTitleHeight);
g.drawLine(1, frameTitleHeight, 1, frameTitleHeight);
// Outer highlight:
g.setColor(MetouiaLookAndFeel.getControlDisabled());
g.drawLine(0, 0, w - 2, 0);
g.drawLine(0, 0, 0, h - 1);
// Outer shadow:
g.setColor(MetouiaLookAndFeel.getControlDarkShadow());
g.drawLine(w - 1, 0, w - 1, h - 1);
g.drawLine(0, h - 1, w - 1, h - 1);
}
/**
* Gets the border insets for a given component.
*
* @param c The component to get its border insets.
* @return Always returns the same insets as defined in <code>insets</code>.
*/
public Insets getBorderInsets(Component c)
{
return insets;
}
}
--- NEW FILE: MetouiaPopupMenuBorder.java ---
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Metouia Look And Feel: a free pluggable look and feel for java *
* http://mlf.sourceforge.net *
* (C) Copyright 2002, by Taoufik Romdhane and Contributors. *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by *
* the Free Software Foundation; either version 2.1 of the License, or (at *
* your option) any later version. *
* *
* This library 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 Lesser 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. *
* *
* MetouiaPopupMenuBorder.java *
* Original Author: Taoufik Romdhane *
* Contributor(s): *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package net.sourceforge.mlf.metouia.borders;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Insets;
import javax.swing.border.AbstractBorder;
import javax.swing.plaf.UIResource;
import net.sourceforge.mlf.metouia.MetouiaLookAndFeel;
/**
* This is a simple 3d border class used for menu popups.
*
* @author Taoufik Romdhane
*/
public class MetouiaPopupMenuBorder extends AbstractBorder implements UIResource
{
/**
* The border insets.
*/
protected static Insets insets = new Insets(2, 1, 2, 2);
/**
* Draws a simple 3d border for the given component.
*
* @param c The component to draw its border.
* @param g The graphics context.
* @param x The x coordinate of the top left corner.
* @param y The y coordinate of the top left corner.
* @param w The width.
* @param h The height.
*/
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h)
{
// Inner highlight:
g.setColor(MetouiaLookAndFeel.getPrimaryControlHighlight());
g.drawLine(1, 1, w - 2, 1);
g.drawLine(1, 1, 1, h - 2);
// Inner shadow:
g.setColor(MetouiaLookAndFeel.getDesktopColor());
g.drawLine(w - 2, 2, w - 2, h - 2);
g.drawLine(2, h - 2, w - 2, h - 2);
// Outer highlight:
g.setColor(MetouiaLookAndFeel.getControlDisabled());
g.drawLine(0, 0, w - 2, 0);
g.drawLine(0, 0, 0, h - 1);
// Outer shadow:
g.setColor(MetouiaLookAndFeel.getControlDarkShadow());
g.drawLine(w - 1, 0, w - 1, h - 1);
g.drawLine(0, h - 1, w - 1, h - 1);
}
/**
* Gets the border insets for a given component.
*
* @param c The component to get its border insets.
* @return Always returns the same insets as defined in <code>insets</code>.
*/
public Insets getBorderInsets(Component c)
{
return insets;
}
}
--- NEW FILE: MetouiaPaletteBorder.java ---
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Metouia Look And Feel: a free pluggable look and feel for java *
* http://mlf.sourceforge.net *
* (C) Copyright 2002, by Taoufik Romdhane and Contributors. *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by *
* the Free Software Foundation; either version 2.1 of the License, or (at *
* your option) any later version. *
* *
* This library 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 Lesser 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. *
* *
* MetouiaPaletteBorder.java *
* Original Author: Taoufik Romdhane *
* Contributor(s): *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package net.sourceforge.mlf.metouia.borders;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Insets;
import javax.swing.UIManager;
import javax.swing.border.AbstractBorder;
import javax.swing.plaf.UIResource;
import net.sourceforge.mlf.metouia.MetouiaLookAndFeel;
/**
* This class represents the border for palettes.
*
* @author Taoufik Romdhane
*/
public class MetouiaPaletteBorder extends AbstractBorder implements UIResource
{
/**
* The border insets.
*/
private static final Insets insets = new Insets(2, 2, 2, 2);
/**
* Draws a simple 3d border for the given component.
*
* @param c The component to draw its border.
* @param g The graphics context.
* @param x The x coordinate of the top left corner.
* @param y The y coordinate of the top left corner.
* @param w The width.
* @param h The height.
*/
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h)
{
// Inner highlight:
g.setColor(MetouiaLookAndFeel.getPrimaryControlHighlight());
g.drawLine(1, 1, w - 2, 1);
g.drawLine(1, 1, 1, h - 2);
// Inner shadow:
g.setColor(MetouiaLookAndFeel.getDesktopColor());
g.drawLine(w - 2, 2, w - 2, h - 2);
g.drawLine(2, h - 2, w - 2, h - 2);
// Bind the title frame border:
int frameTitleHeight
= UIManager.getInt("InternalFrame.paletteTitleHeight") + 1;
g.setColor(MetouiaLookAndFeel.getControlDarkShadow());
g.drawLine(w - 2, frameTitleHeight, w - 2, frameTitleHeight);
g.drawLine(1, frameTitleHeight, 1, frameTitleHeight);
// Outer highlight:
g.setColor(MetouiaLookAndFeel.getControlDisabled());
g.drawLine(0, 0, w - 2, 0);
g.drawLine(0, 0, 0, h - 1);
// Outer shadow:
g.setColor(MetouiaLookAndFeel.getControlDarkShadow());
g.drawLine(w - 1, 0, w - 1, h - 1);
g.drawLine(0, h - 1, w - 1, h - 1);
}
/**
* Gets the border insets for a given component.
*
* @param c The component to get its border insets.
* @return Always returns the same insets as defined in <code>insets</code>.
*/
public Insets getBorderInsets(Component c)
{
return insets;
}
}
--- NEW FILE: MetouiaScrollPaneBorder.class ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: MetouiaPopupMenuBorder.class ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: MetouiaPaletteBorder.class ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: MetouiaBorderUtilities.class ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: MetouiaMenuItemBorder.class ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: MetouiaDotsBuffer.class ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: MetouiaToggleButtonBorder.class ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: MetouiaTableHeaderBorder.class ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: MetouiaButtonBorder.java ---
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Metouia Look And Feel: a free pluggable look and feel for java *
* http://mlf.sourceforge.net *
* (C) Copyright 2002, by Taoufik Romdhane and Contributors. *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by *
* the Free Software Foundation; either version 2.1 of the License, or (at *
* your option) any later version. *
* *
* This library 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 Lesser 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. *
* *
* MetouiaButtonBorder.java *
* Original Author: Taoufik Romdhane *
* Contributor(s): *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package net.sourceforge.mlf.metouia.borders;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Insets;
import javax.swing.ButtonModel;
import javax.swing.JButton;
import javax.swing.border.AbstractBorder;
import javax.swing.plaf.UIResource;
/**
* This is a simple 3d border class used for buttons.
*
* @author Taoufik Romdhane
*/
public class MetouiaButtonBorder extends AbstractBorder implements UIResource
{
/**
* The border insets.
*/
protected static final Insets insets = new Insets(2, 2, 2, 2);
/**
* Draws a simple 3d border for the given component.
*
* @param c The component to draw its border.
* @param g The graphics context.
* @param x The x coordinate of the top left corner.
* @param y The y coordinate of the top left corner.
* @param w The width.
* @param h The height.
*/
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h)
{
JButton button = (JButton)c;
ButtonModel model = ((JButton)c).getModel();
// Optimizations are welcome here!
if (model.isEnabled())
{
if (model.isPressed() && model.isArmed())
{
MetouiaBorderUtilities.drawPressed3DBorder(g, x, y, w, h);
}
else
{
if (button.isDefaultButton())
{
MetouiaBorderUtilities.drawDefaultButtonBorder(g, x, y, w, h);
}
else
{
if (button.isRolloverEnabled())
{
if (model.isRollover())
{
MetouiaBorderUtilities.drawSimple3DBorder(g, x, y, w, h);
}
}
else
{
MetouiaBorderUtilities.drawSimple3DBorder(g, x, y, w, h);
}
}
}
}
else
{
if (!button.isRolloverEnabled())
{
MetouiaBorderUtilities.drawDisabledBorder(g, x, y, w - 1, h - 1);
}
}
}
/**
* Gets the border insets for a given component.
*
* @param c The component to get its border insets.
* @return Always returns the same insets as defined in <code>insets</code>.
*/
public Insets getBorderInsets(Component c)
{
return insets;
}
}
--- NEW FILE: MetouiaOptionDialogBorder.java ---
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Metouia Look And Feel: a free pluggable look and feel for java *
* http://mlf.sourceforge.net *
* (C) Copyright 2002, by Taoufik Romdhane and Contributors. *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by *
* the Free Software Foundation; either version 2.1 of the License, or (at *
* your option) any later version. *
* *
* This library 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 Lesser 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. *
* *
* MetouiaOptionDialogBorder.java *
* Original Author: Taoufik Romdhane *
* Contributor(s): *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package net.sourceforge.mlf.metouia.borders;
/**
* This class represents the border of option dialog Lke Internal JOptionPane...
* It simply iherits from the MetouiaInternalFrameBorder.
*
* @author Taoufik Romdhane
*/
public class MetouiaOptionDialogBorder extends MetouiaInternalFrameBorder
{
}
--- NEW FILE: MetouiaTableHeaderBorder.java ---
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Metouia Look And Feel: a free pluggable look and feel for java *
* http://mlf.sourceforge.net *
* (C) Copyright 2002, by Taoufik Romdhane and Contributors. *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by *
* the Free Software Foundation; either version 2.1 of the License, or (at *
* your option) any later version. *
* *
* This library 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 Lesser 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. *
* *
* MetouiaTableHeaderBorder.java *
* Original Author: Taoufik Romdhane *
* Contributor(s): *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package net.sourceforge.mlf.metouia.borders;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Insets;
import javax.swing.plaf.metal.MetalLookAndFeel;
import javax.swing.border.AbstractBorder;
/**
* This class represents the border of a table header.
*
* @author Taoufik Romdhane
*/
public class MetouiaTableHeaderBorder extends AbstractBorder
{
/**
* The border insets.
*/
protected Insets insets = new Insets(2, 2, 2, 0);
/**
* Draws a simple 3d border for the given component.
*
* @param c The component to draw its border.
* @param g The graphics context.
* @param x The x coordinate of the top left corner.
* @param y The y coordinate of the top left corner.
* @param w The width.
* @param h The height.
*/
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h)
{
g.translate(x, y);
g.setColor(MetalLookAndFeel.getControlDarkShadow());
g.drawLine(w - 1, 0, w - 1, h - 1);
g.drawLine(1, h - 1, w - 1, h - 1);
g.setColor(MetalLookAndFeel.getControlHighlight());
g.drawLine(0, 0, w - 2, 0);
g.drawLine(0, 0, 0, h - 2);
g.translate(-x, -y);
}
/**
* Gets the border insets for a given component.
*
* @param c The component to get its border insets.
* @return Always returns the same insets as defined in <code>insets</code>.
*/
public Insets getBorderInsets(Component c)
{
return insets;
}
}
--- NEW FILE: MetouiaMenuItemBorder.java ---
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Metouia Look And Feel: a free pluggable look and feel for java *
* http://mlf.sourceforge.net *
* (C) Copyright 2002, by Taoufik Romdhane and Contributors. *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by *
* the Free Software Foundation; either version 2.1 of the License, or (at *
* your option) any later version. *
* *
* This library 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 Lesser 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. *
* *
* MetouiaMenuItemBorder.java *
* Original Author: Taoufik Romdhane *
* Contributor(s): *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package net.sourceforge.mlf.metouia.borders;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Insets;
import javax.swing.ButtonModel;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.border.AbstractBorder;
import javax.swing.plaf.UIResource;
import net.sourceforge.mlf.metouia.MetouiaLookAndFeel;
/**
* This class represents the border for menu items.
*
* @author Taoufik Romdhane
*/
public class MetouiaMenuItemBorder extends AbstractBorder implements UIResource
{
/**
* The border insets.
*/
protected static Insets insets = new Insets(1, 1, 1, 1);
/**
* Draws a simple 3d border for the given component.
*
* @param c The component to draw its border.
* @param g The graphics context.
* @param x The x coordinate of the top left corner.
* @param y The y coordinate of the top left corner.
* @param w The width.
* @param h The height.
*/
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h)
{
ButtonModel model = ((JMenuItem)c).getModel();
g.translate(x, y);
if (c.getParent() instanceof JMenuBar)
{
if (model.isArmed() || model.isSelected())
{
g.setColor(MetouiaLookAndFeel.getControlDarkShadow());
g.drawLine(0, 0, w - 2, 0);
g.drawLine(0, 0, 0, h - 1);
g.setColor(MetouiaLookAndFeel.getPrimaryControlHighlight());
g.drawLine(w - 1, 1, w - 1, h - 1);
}
}
else
{
if (model.isArmed() || (c instanceof JMenu && model.isSelected()))
{
g.setColor(MetouiaLookAndFeel.getControlDarkShadow());
g.drawLine(0, 0, w - 1, 0);
g.setColor(MetouiaLookAndFeel.getPrimaryControlHighlight());
g.drawLine(0, h - 1, w - 1, h - 1);
}
else
{
g.setColor(MetouiaLookAndFeel.getPrimaryControlHighlight());
g.drawLine(0, 0, 0, h - 1);
}
}
g.translate(-x, -y);
}
/**
* Gets the border insets for a given component.
*
* @param c The component to get its border insets.
* @return Always returns the same insets as defined in <code>insets</code>.
*/
public Insets getBorderInsets(Component c)
{
return insets;
}
}
--- NEW FILE: MetouiaTextFieldBorder.class ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: MetouiaScrollPaneBorder.java ---
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Metouia Look And Feel: a free pluggable look and feel for java *
* http://mlf.sourceforge.net *
* (C) Copyright 2002, by Taoufik Romdhane and Contributors. *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by *
* the Free Software Foundation; either version 2.1 of the License, or (at *
* your option) any later version. *
* *
* This library 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 Lesser 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. *
* *
* MetouiaScrollPaneBorder.java *
* Original Author: Taoufik Romdhane *
* Contributor(s): *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package net.sourceforge.mlf.metouia.borders;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Insets;
import javax.swing.border.AbstractBorder;
import javax.swing.plaf.UIResource;
import net.sourceforge.mlf.metouia.MetouiaLookAndFeel;
/**
* This class represents the border of a scroll pane.
*
* @author Taoufik Romdhane
*/
public class MetouiaScrollPaneBorder extends AbstractBorder
implements UIResource
{
/**
* The border insets.
*/
private static final Insets insets = new Insets(1, 1, 2, 2);
/**
* Draws a simple 3d border for the given component.
*
* @param c The component to draw its border.
* @param g The graphics context.
* @param x The x coordinate of the top left corner.
* @param y The y coordinate of the top left corner.
* @param w The width.
* @param h The height.
*/
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h)
{
g.translate(x, y);
g.setColor(MetouiaLookAndFeel.getControlDarkShadow());
g.drawRect(0, 0, w - 2, h - 2);
g.setColor(MetouiaLookAndFeel.getControlHighlight());
g.drawLine(w - 1, 1, w - 1, h - 1);
g.drawLine(1, h - 1, w - 1, h - 1);
g.translate(-x, -y);
}
/**
* Gets the border insets for a given component.
*
* @param c The component to get its border insets.
* @return Always returns the same insets as defined in <code>insets</code>.
*/
public Insets getBorderInsets(Component c)
{
return insets;
}
}
--- NEW FILE: MetouiaInternalFrameBorder.class ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: MetouiaOptionDialogBorder.class ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: MetouiaToolBarBorder.java ---
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Metouia Look And Feel: a free pluggable look and feel for java *
* http://mlf.sourceforge.net *
* (C) Copyright 2002, by Taoufik Romdhane and Contributors. *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by *
* the Free Software Foundation; either version 2.1 of the License, or (at *
* your option) any later version. *
* *
* This library 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 Lesser 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. *
* *
* MetouiaToolBarBorder.java *
* Original Author: Taoufik Romdhane *
* Contributor(s): *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package net.sourceforge.mlf.metouia.borders;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Insets;
import javax.swing.JToolBar;
import javax.swing.SwingConstants;
import javax.swing.border.AbstractBorder;
import javax.swing.plaf.UIResource;
import javax.swing.plaf.metal.MetalLookAndFeel;
import net.sourceforge.mlf.metouia.MetouiaLookAndFeel;
/**
* This class represents the border of toolbars.
*
* @author Taoufik Romdhane
*/
public class MetouiaToolBarBorder extends AbstractBorder
implements UIResource, SwingConstants
{
/**
* The drag "dots" for floatable toolbars.
*/
protected MetouiaDots dots = new MetouiaDots(5, 5);
/**
* Draws a simple 3d border for the given component.
*
* @param c The component to draw its border.
* @param g The graphics context.
* @param x The x coordinate of the top left corner.
* @param y The y coordinate of the top left corner.
* @param w The width.
* @param h The height.
*/
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h)
{
boolean isHorizontal = ((JToolBar)c).getOrientation() == HORIZONTAL;
g.setColor(MetouiaLookAndFeel.getControlHighlight());
if (isHorizontal)
{
g.drawLine(0, 0, w - 1, 0);
}
else
{
g.drawLine(0, 0, 0, h - 1);
}
g.setColor(MetouiaLookAndFeel.getControlShadow());
if (isHorizontal)
{
g.drawLine(0, h - 1, w - 1, h - 1);
}
else
{
g.drawLine(w - 1, 0, w - 1, h - 1);
}
g.translate(x, y);
if (((JToolBar)c).isFloatable())
{
if (((JToolBar)c).getOrientation() == HORIZONTAL)
{
dots.setDotsArea(5, c.getSize().height - 4);
if (c.getComponentOrientation().isLeftToRight())
{
dots.paintIcon(c, g, 2, 2);
}
else
{
dots.paintIcon(c, g, c.getBounds().width - 12, 2);
}
}
else
{
dots.setDotsArea(c.getSize().width - 4, 5);
dots.paintIcon(c, g, 2, 2);
}
}
g.translate(-x, -y);
}
/**
* Gets the border insets for a given component.
* When the toolbar is flaotable, space for for the drag "dots" is also taken
* in the insets.
*
* @param c The component to get its border insets.
* @return The toolbar border insets.
*/
public Insets getBorderInsets(Component c)
{
Insets insets = new Insets(3, 3, 3, 3);
if (((JToolBar)c).isFloatable())
{
if (((JToolBar)c).getOrientation() == HORIZONTAL)
{
insets.left = 8;
}
else
{
insets.top = 8;
}
}
return insets;
}
}
--- NEW FILE: MetouiaDots.class ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: MetouiaDots.java ---
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Metouia Look And Feel: a free pluggable look and feel for java *
* http://mlf.sourceforge.net *
* (C) Copyright 2002, by Taoufik Romdhane and Contributors. *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by *
* the Free Software Foundation; either version 2.1 of the License, or (at *
* your option) any later version. *
* *
* This library 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 Lesser 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. *
* *
* MetouiaDots.java *
* Original Author: Taoufik Romdhane *
* Contributor(s): *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package net.sourceforge.mlf.metouia.borders;
import java.awt.Component;
import java.awt.Graphics;
import javax.swing.Icon;
/**
* This class implements the dots used throughout the Metouia Look and Feel.
*
* @author Taoufik Romdhane
*/
public class MetouiaDots implements Icon
{
/**
* The horizontal dots count.
*/
protected int xDots;
/**
* The vertical dots count.
*/
protected int yDots;
/**
* The dots buffer that can be reused for painting dots.
*/
protected MetouiaDotsBuffer buffer;
/**
* This constructor creates a dots area with the given size.
*
* @param width The width of the dots area.
* @param height The height of the dots area.
*/
public MetouiaDots(int width, int height)
{
setDotsArea(width, height);
if (buffer == null)
{
buffer = new MetouiaDotsBuffer();
}
}
/**
* Sets the dots area to the given size.
*
* @param width The width of the dots area.
* @param height The height of the dots area.
*/
public void setDotsArea(int width, int height)
{
xDots = width / 5;
yDots = height / 5;
}
/**
* Draws the dots area at the specified location.
*
* @param c The component to draw on.
* @param g The graphics context.
* @param x The x coordinate of the top left corner.
* @param y The y coordinate of the top left corner.
*/
public void paintIcon(Component c, Graphics g, int x, int y)
{
int bufferWidth = buffer.getImageSize().width;
int bufferHeight = buffer.getImageSize().height;
int iconWidth = getIconWidth();
int iconHeight = getIconHeight();
int x2 = x + iconWidth;
int y2 = y + iconHeight;
int savex = x;
while (y < y2)
{
int h = Math.min(y2 - y, bufferHeight);
for (x = savex; x < x2; x += bufferWidth)
{
int w = Math.min(x2 - x, bufferWidth);
g.drawImage(buffer.getImage(), x, y, x + w, y + h, 0, 0, w, h, null);
}
y += bufferHeight;
}
}
/**
* Returns the icon's width.
*
* @return An int specifying the fixed width of the icon.
*/
public int getIconWidth()
{
return xDots * 5;
}
/**
* Returns the icon's height.
*
* @return An int specifying the fixed height of the icon.
*/
public int getIconHeight()
{
return yDots * 5;
}
}
--- NEW FILE: MetouiaToggleButtonBorder.java ---
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Metouia Look And Feel: a free pluggable look and feel for java *
* http://mlf.sourceforge.net *
* (C) Copyright 2002, by Taoufik Romdhane and Contributors. *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by *
* the Free Software Foundation; either version 2.1 of the License, or (at *
* your option) any later version. *
* *
* This library 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 Lesser 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. *
* *
* MetouiaToggleButtonBorder.java *
* Original Author: Taoufik Romdhane *
* Contributor(s): *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package net.sourceforge.mlf.metouia.borders;
import java.awt.Component;
import java.awt.Graphics;
import javax.swing.ButtonModel;
import javax.swing.JToggleButton;
/**
* This is a simple 3d border class used for toggle buttons.
*
* @author Taoufik Romdhane
*/
public class MetouiaToggleButtonBorder extends MetouiaButtonBorder
{
/**
* Draws a simple 3d border for the given component.
*
* @param c The component to draw its border.
* @param g The graphics context.
* @param x The x coordinate of the top left corner.
* @param y The y coordinate of the top left corner.
* @param w The width.
* @param h The height.
*/
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h)
{
JToggleButton button = (JToggleButton)c;
ButtonModel model = button.getModel();
// Optimizations are welcome here!
if (c.isEnabled())
{
if (model.isPressed() && model.isArmed())
{
if (button.isRolloverEnabled())
{
if (model.isRollover())
{
MetouiaBorderUtilities.drawPressed3DBorder(g, x, y, w, h);
}
}
else
{
MetouiaBorderUtilities.drawPressed3DBorder(g, x, y, w, h);
}
}
else if (model.isSelected())
{
MetouiaBorderUtilities.drawPressed3DBorder(g, x, y, w, h);
}
else
{
if (button.isRolloverEnabled())
{
if (model.isRollover())
{
MetouiaBorderUtilities.drawSimple3DBorder(g, x, y, w, h);
}
}
else
{
MetouiaBorderUtilities.drawSimple3DBorder(g, x, y, w, h);
}
}
}
else
{
if (button.isRolloverEnabled())
{
MetouiaBorderUtilities.drawDisabledBorder(g, x, y, w - 1, h - 1);
}
}
}
}
--- NEW FILE: MetouiaButtonBorder.class ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: MetouiaToolBarBorder.class ---
(This appears to be a binary file; contents omitted.)
--- NEW FILE: MetouiaMenuBarBorder.java ---
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Metouia Look And Feel: a free pluggable look and feel for java *
* http://mlf.sourceforge.net *
* (C) Copyright 2002, by Taoufik Romdhane and Contributors. *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by *
* the Free Software Foundation; either version 2.1 of the License, or (at *
* your option) any later version. *
* *
* This library 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 Lesser 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. *
* *
* MetouiaMenuBarBorder.java *
* Original Author: Taoufik Romdhane *
* Contributor(s): *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package net.sourceforge.mlf.metouia.borders;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Insets;
import javax.swing.border.AbstractBorder;
import javax.swing.plaf.UIResource;
import net.sourceforge.mlf.metouia.MetouiaLookAndFeel;
/**
* This class represents the border of a menu bar.
*
* @author Taoufik Romdhane
*/
public class MetouiaMenuBarBorder extends AbstractBorder implements UIResource
{
/**
* The border insets.
*/
protected static Insets insets = new Insets(1, 0, 1, 0);
/**
* Draws a simple 3d border for the given component.
*
* @param c The component to draw its border.
* @param g The graphics context.
* @param x The x coordinate of the top left corner.
* @param y The y coordinate of the top left corner.
* @param w The width.
* @param h The height.
*/
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h)
{
g.setColor(MetouiaLookAndFeel.getControlHighlight());
g.drawLine(0, 0, 0, h - 1);
g.setColor(MetouiaLookAndFeel.getControlShadow());
g.drawLine(0, h - 1, w - 1, h - 1);
}
/**
* Gets the border insets for a given component.
*
* @param c The component to get its border insets.
* @return Always returns the same insets as defined in <code>insets</code>.
*/
public Insets getBorderInsets(Component c)
{
return insets;
}
}
--- NEW FILE: MetouiaTextFieldBorder.java ---
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Metouia Look And Feel: a free pluggable look and feel for java *
* http://mlf.sourceforge.net *
* (C) Copyright 2002, by Taoufik Romdhane and Contributors. *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by *
* the Free Software Foundation; either version 2.1 of the License, or (at *
* your option) any later version. *
* *
* This library 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 Lesser 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. *
* *
* MetouiaTextFieldBorder.java *
* Original Author: Taoufik Romdhane *
* Contributor(s): *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package net.sourceforge.mlf.metouia.borders;
import java.awt.Component;
import java.awt.Graphics;
import java.awt.Insets;
import javax.swing.border.AbstractBorder;
import javax.swing.plaf.UIResource;
import javax.swing.text.JTextComponent;
/**
* This is a simple 3d border class used for text fields.
*
* @author Taoufik Romdhane
*/
public class MetouiaTextFieldBorder extends AbstractBorder implements UIResource
{
/**
* The border insets.
*/
private static final Insets insets = new Insets(1, 2, 1, 2);
/**
* Gets the border insets for a given component.
*
* @param c The component to get its border insets.
* @return Always returns the same insets as defined in <code>insets</code>.
*/
public Insets getBorderInsets(Component c)
{
return insets;
}
/**
* Draws a simple 3d border for the given component.
*
* @param c The component to draw its border.
* @param g The graphics context.
* @param x The x coordinate of the top left corner.
* @param y The y coordinate of the top left corner.
* @param w The width.
* @param h The height.
*/
public void paintBorder(Component c, Graphics g, int x, int y, int w, int h)
{
if (!(c instanceof JTextComponent))
{
if (c.isEnabled())
{
MetouiaBorderUtilities.drawPressed3DFieldBorder(g, x, y, w, h);
}
else
{
MetouiaBorderUtilities.drawDisabledBorder(g, x, y, w, h);
}
return;
}
if (c.isEnabled() && ((JTextComponent)c).isEditable())
{
MetouiaBorderUtilities.drawPressed3DFieldBorder(g, x, y, w, h);
}
else
{
MetouiaBorderUtilities.drawDisabledBorder(g, x, y, w, h);
}
}
}
--- NEW FILE: MetouiaBorderUtilities.java ---
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Metouia Look And Feel: a free pluggable look and feel for java *
* http://mlf.sourceforge.net *
* (C) Copyright 2002, by Taoufik Romdhane and Contributors. *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by *
* the Free Software Foundation; either version 2.1 of the License, or (at *
* your option) any later version. *
* *
* This library 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 Lesser 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. *
* *
* MetouiaBorderUtilities.java *
* Original Author: Taoufik Romdhane *
* Contributor(s): *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
package net.sourceforge.mlf.metouia.borders;
import java.awt.Color;
import java.awt.Graphics;
import java.awt.Rectangle;
import javax.swing.border.Border;
import javax.swing.border.LineBorder;
import javax.swing.border.MatteBorder;
import javax.swing.plaf.BorderUIResource;
import javax.swing.plaf.basic.BasicBorders;
import net.sourceforge.mlf.metouia.MetouiaLookAndFeel;
/**
* This is a utility class for painting simple 3d borders, and providding common
* ones.
*
* @author Taoufik Romdhane
*/
public class MetouiaBorderUtilities
{
/**
* Cached botton border instance.
*/
private static Border buttonBorder;
/**
* Cached text border instance.
*/
private static Border textBorder;
/**
* Cached text field border instance.
*/
private static Border textFieldBorder;
/**
* Cached toggle botton border instance.
*/
private static Border toggleButtonBorder;
/**
* Draws a simple 3d border.
*
* @param g The graphics context.
* @param r The rectangle object defining the bounds of the border.
*/
static void drawSimple3DBorder(Graphics g, Rectangle r)
{
drawSimple3DBorder(g, r.x, r.y, r.width, r.height);
}
/**
* Draws a simple 3d border.
*
* @param g The graphics context.
* @param x The x coordinate of the top left corner.
* @param y The y coordinate of the top left corner.
* @param w The width.
* @param h The height.
*/
static void drawSimple3DBorder(Graphics g, int x, int y, int w, int h)
{
drawSimple3DBorder(g, x, y, w, h, MetouiaLookAndFeel.getControlHighlight(),
MetouiaLookAndFeel.getContro...
[truncated message content] |