jtattooluna window icons changed
git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@12321 b35dd754-fafc-0310-a699-88a17e54d16e
BIN
build/lib/dist/JTattoo.jar
vendored
@ -24,8 +24,7 @@ import org.jivesoftware.smack.packet.PacketExtension;
|
||||
/**
|
||||
* XEP-0224 Compliance<br>
|
||||
* see <a
|
||||
* href="http://xmpp.org/extensions/xep-0224.html">http://xmpp.org/extensions
|
||||
* /xep-0224.html</a>
|
||||
* href="http://xmpp.org/extensions/xep-0224.html">http://xmpp.org/extensions/xep-0224.html</a>
|
||||
*/
|
||||
public class BuzzPacket implements PacketExtension {
|
||||
public String getElementName() {
|
||||
@ -36,8 +35,7 @@ public class BuzzPacket implements PacketExtension {
|
||||
return "urn:xmpp:attention:0";
|
||||
}
|
||||
|
||||
|
||||
//TODO 2.6.1 remove buzz only attention gets to stay
|
||||
// TODO 2.6.1 remove buzz only attention gets to stay
|
||||
public String toXML() {
|
||||
return "<" + getElementName() + " xmlns=\"" + getNamespace()
|
||||
+ "\"/><buzz xmlns=\"http://www.jivesoftware.com/spark\"/>";
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
package com.jtattoo.plaf.luna;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
import javax.swing.*;
|
||||
|
||||
import com.jtattoo.plaf.*;
|
||||
@ -29,28 +30,32 @@ public class LunaIcons extends BaseIcons {
|
||||
|
||||
public static Icon getIconIcon() {
|
||||
if (iconIcon == null) {
|
||||
iconIcon = new TitleButtonIcon(TitleButtonIcon.ICON_ICON_TYP);
|
||||
iconIcon = new TitleButtonIcon(new LazyImageIcon("luna/icons/iconify_active.gif"),
|
||||
new LazyImageIcon("luna/icons/iconify_inactive.gif"));
|
||||
}
|
||||
return iconIcon;
|
||||
}
|
||||
|
||||
public static Icon getMinIcon() {
|
||||
if (minIcon == null) {
|
||||
minIcon = new TitleButtonIcon(TitleButtonIcon.MIN_ICON_TYP);
|
||||
minIcon = new TitleButtonIcon(new LazyImageIcon("luna/icons/min_active.gif"),
|
||||
new LazyImageIcon("luna/icons/min_inactive.gif"));
|
||||
}
|
||||
return minIcon;
|
||||
}
|
||||
|
||||
public static Icon getMaxIcon() {
|
||||
if (maxIcon == null) {
|
||||
maxIcon = new TitleButtonIcon(TitleButtonIcon.MAX_ICON_TYP);
|
||||
maxIcon = new TitleButtonIcon(new LazyImageIcon("luna/icons/max_active.gif"),
|
||||
new LazyImageIcon("luna/icons/max_inactive.gif"));
|
||||
}
|
||||
return maxIcon;
|
||||
}
|
||||
|
||||
public static Icon getCloseIcon() {
|
||||
if (closeIcon == null) {
|
||||
closeIcon = new TitleButtonIcon(TitleButtonIcon.CLOSE_ICON_TYP);
|
||||
closeIcon = new TitleButtonIcon(new LazyImageIcon("luna/icons/close_active.gif"),
|
||||
new LazyImageIcon("luna/icons/close_inactive.gif"));
|
||||
}
|
||||
return closeIcon;
|
||||
}
|
||||
@ -68,9 +73,13 @@ public class LunaIcons extends BaseIcons {
|
||||
public static final int MAX_ICON_TYP = 2;
|
||||
public static final int CLOSE_ICON_TYP = 3;
|
||||
private int iconTyp = ICON_ICON_TYP;
|
||||
|
||||
private Icon _active;
|
||||
private Icon _inactive;
|
||||
|
||||
public TitleButtonIcon(int typ) {
|
||||
iconTyp = typ;
|
||||
public TitleButtonIcon(Icon active, Icon inactive) {
|
||||
_active = active;
|
||||
_inactive = inactive;
|
||||
}
|
||||
|
||||
public int getIconHeight() {
|
||||
@ -80,76 +89,51 @@ public class LunaIcons extends BaseIcons {
|
||||
public int getIconWidth() {
|
||||
return 20;
|
||||
}
|
||||
|
||||
public void paintIcon(Component c, Graphics g, int x, int y) {
|
||||
AbstractButton btn = (AbstractButton) c;
|
||||
|
||||
public void paintIcon(Component c, Graphics g, int x, int y) {
|
||||
int w = c.getWidth();
|
||||
int h = c.getHeight();
|
||||
Graphics2D g2D = (Graphics2D) g;
|
||||
Color fc = blueFrameColor;
|
||||
Color cHi = blueColorLight;
|
||||
Color cLo = blueColorDark;
|
||||
int w = c.getWidth();
|
||||
int h = c.getHeight();
|
||||
g2D.setPaint(new GradientPaint(0, 0, cHi, w, h, cLo));
|
||||
g.fillRect(1, 1, w - 2, h - 2);
|
||||
|
||||
JButton b = (JButton) c;
|
||||
Graphics2D g2D = (Graphics2D) g;
|
||||
g.setColor(fc);
|
||||
g.drawLine(1, 0, w - 2, 0);
|
||||
g.drawLine(0, 1, 0, h - 2);
|
||||
g.drawLine(1, h - 1, w - 2, h - 1);
|
||||
g.drawLine(w - 1, 1, w - 1, h - 2);
|
||||
Composite composite = g2D.getComposite();
|
||||
AlphaComposite alpha = AlphaComposite.getInstance(
|
||||
AlphaComposite.SRC_OVER, 0.2f);
|
||||
g2D.setComposite(alpha);
|
||||
g2D.setColor(cLo);
|
||||
g.drawLine(2, 1, w - 2, 1);
|
||||
g.drawLine(1, 2, 1, h - 2);
|
||||
g2D.setColor(ColorHelper.darker(cLo, 40));
|
||||
g.drawLine(2, h - 2, w - 2, h - 2);
|
||||
g.drawLine(w - 2, 2, w - 2, h - 2);
|
||||
|
||||
boolean isActive = JTattooUtilities.isActive(b);
|
||||
boolean isPressed = b.getModel().isPressed();
|
||||
boolean isArmed = b.getModel().isArmed();
|
||||
boolean isRollover = b.getModel().isRollover();
|
||||
g2D.setComposite(composite);
|
||||
|
||||
Color fc = blueFrameColor;
|
||||
Color cHi = blueColorLight;
|
||||
Color cLo = blueColorDark;
|
||||
if (iconTyp == CLOSE_ICON_TYP) {
|
||||
cHi = closerColorLight;
|
||||
cLo = closerColorDark;
|
||||
}
|
||||
|
||||
if (!isActive) {
|
||||
cHi = ColorHelper.brighter(cHi, 20);
|
||||
cLo = ColorHelper.brighter(cLo, 10);
|
||||
}
|
||||
if (isPressed && isArmed) {
|
||||
Color cTemp = ColorHelper.darker(cLo, 10);
|
||||
cLo = ColorHelper.darker(cHi, 10);
|
||||
cHi = cTemp;
|
||||
} else if (isRollover) {
|
||||
cHi = ColorHelper.brighter(cHi, 30);
|
||||
cLo = ColorHelper.brighter(cLo, 30);
|
||||
}
|
||||
|
||||
g2D.setPaint(new GradientPaint(0, 0, cHi, w, h, cLo));
|
||||
g.fillRect(1, 1, w - 2, h - 2);
|
||||
|
||||
g.setColor(fc);
|
||||
g.drawLine(1, 0, w - 2, 0);
|
||||
g.drawLine(0, 1, 0, h - 2);
|
||||
g.drawLine(1, h - 1, w - 2, h - 1);
|
||||
g.drawLine(w - 1, 1, w - 1, h - 2);
|
||||
Composite composite = g2D.getComposite();
|
||||
AlphaComposite alpha = AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.2f);
|
||||
g2D.setComposite(alpha);
|
||||
g2D.setColor(cLo);
|
||||
g.drawLine(2, 1, w - 2, 1);
|
||||
g.drawLine(1, 2, 1, h - 2);
|
||||
g2D.setColor(ColorHelper.darker(cLo, 40));
|
||||
g.drawLine(2, h - 2, w - 2, h - 2);
|
||||
g.drawLine(w - 2, 2, w - 2, h - 2);
|
||||
|
||||
g2D.setComposite(composite);
|
||||
|
||||
// Paint the icon
|
||||
cHi = Color.white;
|
||||
cLo = ColorHelper.darker(cLo, 30);
|
||||
Icon icon = null;
|
||||
if (iconTyp == ICON_ICON_TYP) {
|
||||
icon = new BaseIcons.IconSymbol(cHi, cLo, null, new Insets(0, 0, 0, 1));
|
||||
} else if (iconTyp == MIN_ICON_TYP) {
|
||||
icon = new BaseIcons.MinSymbol(cHi, cLo, null, new Insets(0, 0, 0, 1));
|
||||
} else if (iconTyp == MAX_ICON_TYP) {
|
||||
icon = new BaseIcons.MaxSymbol(cHi, cLo, null, new Insets(0, 0, 0, 1));
|
||||
} else if (iconTyp == CLOSE_ICON_TYP) {
|
||||
icon = new BaseIcons.CloseSymbol(cHi, cLo, null, new Insets(0, 0, 0, 1));
|
||||
}
|
||||
if (icon != null) {
|
||||
icon.paintIcon(c, g, 0, 0);
|
||||
}
|
||||
}
|
||||
ButtonModel model = btn.getModel();
|
||||
Icon ico = _active;
|
||||
if (JTattooUtilities.isActive(btn)) {
|
||||
if (model.isRollover()) {
|
||||
ico = _inactive;
|
||||
}
|
||||
} else {
|
||||
if (model.isRollover()) {
|
||||
ico = _inactive;
|
||||
} else {
|
||||
ico = _active;
|
||||
}
|
||||
}
|
||||
ico.paintIcon(c, g, 1, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BIN
src/jtattoo/src/com/jtattoo/plaf/luna/icons/close_active.gif
Normal file
|
After Width: | Height: | Size: 999 B |
BIN
src/jtattoo/src/com/jtattoo/plaf/luna/icons/close_inactive.gif
Normal file
|
After Width: | Height: | Size: 996 B |
BIN
src/jtattoo/src/com/jtattoo/plaf/luna/icons/iconify_active.gif
Normal file
|
After Width: | Height: | Size: 959 B |
BIN
src/jtattoo/src/com/jtattoo/plaf/luna/icons/iconify_inactive.gif
Normal file
|
After Width: | Height: | Size: 956 B |
BIN
src/jtattoo/src/com/jtattoo/plaf/luna/icons/max_active.gif
Normal file
|
After Width: | Height: | Size: 969 B |
BIN
src/jtattoo/src/com/jtattoo/plaf/luna/icons/max_inactive.gif
Normal file
|
After Width: | Height: | Size: 965 B |
BIN
src/jtattoo/src/com/jtattoo/plaf/luna/icons/min_active.gif
Normal file
|
After Width: | Height: | Size: 963 B |
BIN
src/jtattoo/src/com/jtattoo/plaf/luna/icons/min_inactive.gif
Normal file
|
After Width: | Height: | Size: 960 B |