mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
Move graphics functions to static FSkin class
This commit is contained in:
@@ -20,7 +20,6 @@ import com.google.common.collect.Lists;
|
|||||||
import forge.Singletons;
|
import forge.Singletons;
|
||||||
import forge.gui.toolbox.FPanel;
|
import forge.gui.toolbox.FPanel;
|
||||||
import forge.gui.toolbox.FSkin;
|
import forge.gui.toolbox.FSkin;
|
||||||
import forge.gui.toolbox.FSkin.JLabelSkin;
|
|
||||||
import forge.gui.toolbox.FSkin.SkinImage;
|
import forge.gui.toolbox.FSkin.SkinImage;
|
||||||
import forge.properties.ForgePreferences;
|
import forge.properties.ForgePreferences;
|
||||||
import forge.properties.ForgePreferences.FPref;
|
import forge.properties.ForgePreferences.FPref;
|
||||||
@@ -446,12 +445,10 @@ public final class DragCell extends JPanel implements ILocalRepaint {
|
|||||||
|
|
||||||
/** Paints dragging handle image the length of the label. */
|
/** Paints dragging handle image the length of the label. */
|
||||||
private class DragHandle extends JLabel {
|
private class DragHandle extends JLabel {
|
||||||
private final JLabelSkin<DragHandle> skin;
|
|
||||||
private final SkinImage img = FSkin.getImage(FSkin.LayoutImages.IMG_HANDLE);
|
private final SkinImage img = FSkin.getImage(FSkin.LayoutImages.IMG_HANDLE);
|
||||||
private boolean hovered = false;
|
private boolean hovered = false;
|
||||||
|
|
||||||
public DragHandle() {
|
public DragHandle() {
|
||||||
this.skin = FSkin.get(this);
|
|
||||||
this.addMouseListener(SRearrangingUtil.getRearrangeClickEvent());
|
this.addMouseListener(SRearrangingUtil.getRearrangeClickEvent());
|
||||||
this.addMouseMotionListener(SRearrangingUtil.getRearrangeDragEvent());
|
this.addMouseMotionListener(SRearrangingUtil.getRearrangeDragEvent());
|
||||||
|
|
||||||
@@ -479,7 +476,7 @@ public final class DragCell extends JPanel implements ILocalRepaint {
|
|||||||
final int imgH = imgSize.height;
|
final int imgH = imgSize.height;
|
||||||
|
|
||||||
for (int x = 0; x < getWidth(); x += imgW) {
|
for (int x = 0; x < getWidth(); x += imgW) {
|
||||||
skin.drawImage(g, img, x, ((getHeight() - imgH) / 2));
|
FSkin.drawImage(g, img, x, ((getHeight() - imgH) / 2));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,7 +15,6 @@ import forge.gui.toolbox.FSkin;
|
|||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public final class DragTab extends JLabel implements ILocalRepaint {
|
public final class DragTab extends JLabel implements ILocalRepaint {
|
||||||
private final FSkin.JLabelSkin<DragTab> skin;
|
|
||||||
private boolean selected = false;
|
private boolean selected = false;
|
||||||
private int priority = 10;
|
private int priority = 10;
|
||||||
|
|
||||||
@@ -28,12 +27,11 @@ public final class DragTab extends JLabel implements ILocalRepaint {
|
|||||||
*/
|
*/
|
||||||
public DragTab(final String title0) {
|
public DragTab(final String title0) {
|
||||||
super(title0);
|
super(title0);
|
||||||
skin = FSkin.get(this);
|
|
||||||
setToolTipText(title0);
|
setToolTipText(title0);
|
||||||
setOpaque(false);
|
setOpaque(false);
|
||||||
setSelected(false);
|
setSelected(false);
|
||||||
setBorder(new EmptyBorder(2, 5, 2, 5));
|
setBorder(new EmptyBorder(2, 5, 2, 5));
|
||||||
skin.setForeground(FSkin.getColor(FSkin.Colors.CLR_TEXT));
|
FSkin.get(this).setForeground(FSkin.getColor(FSkin.Colors.CLR_TEXT));
|
||||||
|
|
||||||
this.addMouseListener(SRearrangingUtil.getRearrangeClickEvent());
|
this.addMouseListener(SRearrangingUtil.getRearrangeClickEvent());
|
||||||
this.addMouseMotionListener(SRearrangingUtil.getRearrangeDragEvent());
|
this.addMouseMotionListener(SRearrangingUtil.getRearrangeDragEvent());
|
||||||
@@ -78,15 +76,15 @@ public final class DragTab extends JLabel implements ILocalRepaint {
|
|||||||
@Override
|
@Override
|
||||||
public void paintComponent(final Graphics g) {
|
public void paintComponent(final Graphics g) {
|
||||||
if (!selected) {
|
if (!selected) {
|
||||||
skin.setGraphicsColor(g, FSkin.getColor(FSkin.Colors.CLR_INACTIVE));
|
FSkin.setGraphicsColor(g, FSkin.getColor(FSkin.Colors.CLR_INACTIVE));
|
||||||
g.fillRoundRect(0, 0, getWidth() - 1, getHeight() * 2, 6, 6);
|
g.fillRoundRect(0, 0, getWidth() - 1, getHeight() * 2, 6, 6);
|
||||||
skin.setGraphicsColor(g, FSkin.getColor(FSkin.Colors.CLR_BORDERS));
|
FSkin.setGraphicsColor(g, FSkin.getColor(FSkin.Colors.CLR_BORDERS));
|
||||||
g.drawRoundRect(0, 0, getWidth() - 1, getHeight() * 2, 6, 6);
|
g.drawRoundRect(0, 0, getWidth() - 1, getHeight() * 2, 6, 6);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skin.setGraphicsColor(g, FSkin.getColor(FSkin.Colors.CLR_ACTIVE));
|
FSkin.setGraphicsColor(g, FSkin.getColor(FSkin.Colors.CLR_ACTIVE));
|
||||||
g.fillRoundRect(0, 0, getWidth() - 1, getHeight() * 2, 6, 6);
|
g.fillRoundRect(0, 0, getWidth() - 1, getHeight() * 2, 6, 6);
|
||||||
skin.setGraphicsColor(g, FSkin.getColor(FSkin.Colors.CLR_BORDERS));
|
FSkin.setGraphicsColor(g, FSkin.getColor(FSkin.Colors.CLR_BORDERS));
|
||||||
g.drawRoundRect(0, 0, getWidth() - 1, getHeight() * 2, 6, 6);
|
g.drawRoundRect(0, 0, getWidth() - 1, getHeight() * 2, 6, 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ import javax.swing.JLabel;
|
|||||||
import forge.Singletons;
|
import forge.Singletons;
|
||||||
import forge.gui.framework.ILocalRepaint;
|
import forge.gui.framework.ILocalRepaint;
|
||||||
import forge.gui.toolbox.FSkin;
|
import forge.gui.toolbox.FSkin;
|
||||||
import forge.gui.toolbox.FSkin.JLabelSkin;
|
|
||||||
import forge.gui.toolbox.FSkin.SkinColor;
|
import forge.gui.toolbox.FSkin.SkinColor;
|
||||||
import forge.properties.ForgePreferences.FPref;
|
import forge.properties.ForgePreferences.FPref;
|
||||||
|
|
||||||
@@ -28,7 +27,6 @@ public class LblGroup extends JLabel implements ILocalRepaint {
|
|||||||
|
|
||||||
private boolean hovered = false;
|
private boolean hovered = false;
|
||||||
|
|
||||||
private final JLabelSkin<LblGroup> skin;
|
|
||||||
private final SkinColor clrTheme = FSkin.getColor(FSkin.Colors.CLR_THEME);
|
private final SkinColor clrTheme = FSkin.getColor(FSkin.Colors.CLR_THEME);
|
||||||
private final SkinColor l20 = clrTheme.stepColor(20);
|
private final SkinColor l20 = clrTheme.stepColor(20);
|
||||||
private final SkinColor l25 = clrTheme.stepColor(25);
|
private final SkinColor l25 = clrTheme.stepColor(25);
|
||||||
@@ -46,9 +44,8 @@ public class LblGroup extends JLabel implements ILocalRepaint {
|
|||||||
|
|
||||||
super(" " + e0.getTitle());
|
super(" " + e0.getTitle());
|
||||||
|
|
||||||
skin = FSkin.get(this);
|
FSkin.get(this).setFont(FSkin.getBoldFont(14));
|
||||||
skin.setFont(FSkin.getBoldFont(14));
|
FSkin.get(this).setForeground(FSkin.getColor(FSkin.Colors.CLR_TEXT));
|
||||||
skin.setForeground(FSkin.getColor(FSkin.Colors.CLR_TEXT));
|
|
||||||
|
|
||||||
this.addMouseListener(new MouseAdapter() {
|
this.addMouseListener(new MouseAdapter() {
|
||||||
@Override
|
@Override
|
||||||
@@ -130,15 +127,15 @@ public class LblGroup extends JLabel implements ILocalRepaint {
|
|||||||
int w = getWidth();
|
int w = getWidth();
|
||||||
int h = getHeight();
|
int h = getHeight();
|
||||||
|
|
||||||
skin.setGraphicsColor(g, l20);
|
FSkin.setGraphicsColor(g, l20);
|
||||||
g.fillRect(0, 0, getWidth(), getHeight());
|
g.fillRect(0, 0, getWidth(), getHeight());
|
||||||
|
|
||||||
skin.setGraphicsGradientPaint(g2d, w - 10, 0, l25, w, 0, d80);
|
FSkin.setGraphicsGradientPaint(g2d, w - 10, 0, l25, w, 0, d80);
|
||||||
g2d.fillRect(w - 10, 0, w, h);
|
g2d.fillRect(w - 10, 0, w, h);
|
||||||
|
|
||||||
skin.setGraphicsColor(g, l40);
|
FSkin.setGraphicsColor(g, l40);
|
||||||
g2d.drawLine(0, 0, w - 6, 0);
|
g2d.drawLine(0, 0, w - 6, 0);
|
||||||
skin.setGraphicsColor(g, d20);
|
FSkin.setGraphicsColor(g, d20);
|
||||||
g2d.drawLine(0, h - 1, w - 6, h - 1);
|
g2d.drawLine(0, h - 1, w - 6, h - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ import javax.swing.JLabel;
|
|||||||
import javax.swing.border.EmptyBorder;
|
import javax.swing.border.EmptyBorder;
|
||||||
|
|
||||||
import forge.gui.toolbox.FSkin;
|
import forge.gui.toolbox.FSkin;
|
||||||
import forge.gui.toolbox.FSkin.JLabelSkin;
|
|
||||||
import forge.gui.toolbox.FSkin.SkinColor;
|
import forge.gui.toolbox.FSkin.SkinColor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -15,7 +14,6 @@ import forge.gui.toolbox.FSkin.SkinColor;
|
|||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class LblHeader extends JLabel {
|
public class LblHeader extends JLabel {
|
||||||
private final JLabelSkin<LblHeader> skin;
|
|
||||||
private final SkinColor clr = FSkin.getColor(FSkin.Colors.CLR_THEME).stepColor(0);
|
private final SkinColor clr = FSkin.getColor(FSkin.Colors.CLR_THEME).stepColor(0);
|
||||||
private final SkinColor a100 = clr.alphaColor(100);
|
private final SkinColor a100 = clr.alphaColor(100);
|
||||||
private final SkinColor d40 = clr.stepColor(-40);
|
private final SkinColor d40 = clr.stepColor(-40);
|
||||||
@@ -27,9 +25,8 @@ public class LblHeader extends JLabel {
|
|||||||
*/
|
*/
|
||||||
public LblHeader(final String txt0) {
|
public LblHeader(final String txt0) {
|
||||||
super(txt0);
|
super(txt0);
|
||||||
skin = FSkin.get(this);
|
FSkin.get(this).setForeground(FSkin.getColor(FSkin.Colors.CLR_TEXT));
|
||||||
skin.setForeground(FSkin.getColor(FSkin.Colors.CLR_TEXT));
|
FSkin.get(this).setFont(FSkin.getFont(18));
|
||||||
skin.setFont(FSkin.getFont(18));
|
|
||||||
this.setBorder(new EmptyBorder(5, 30, 0, 0));
|
this.setBorder(new EmptyBorder(5, 30, 0, 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -39,13 +36,13 @@ public class LblHeader extends JLabel {
|
|||||||
int w = getWidth();
|
int w = getWidth();
|
||||||
int h = getHeight();
|
int h = getHeight();
|
||||||
|
|
||||||
skin.setGraphicsColor(g2d, d80);
|
FSkin.setGraphicsColor(g2d, d80);
|
||||||
g2d.fillRect(0, 5, w, h - 5);
|
g2d.fillRect(0, 5, w, h - 5);
|
||||||
|
|
||||||
skin.setGraphicsColor(g2d, a100);
|
FSkin.setGraphicsColor(g2d, a100);
|
||||||
g2d.fillRect(5, 0, w - 5, h - 5);
|
g2d.fillRect(5, 0, w - 5, h - 5);
|
||||||
|
|
||||||
skin.setGraphicsColor(g2d, d40);
|
FSkin.setGraphicsColor(g2d, d40);
|
||||||
g2d.drawRect(5, 0, w - 6, h - 6);
|
g2d.drawRect(5, 0, w - 6, h - 6);
|
||||||
|
|
||||||
super.paintComponent(g);
|
super.paintComponent(g);
|
||||||
|
|||||||
@@ -11,7 +11,6 @@ import javax.swing.JLabel;
|
|||||||
import forge.gui.framework.ICDoc;
|
import forge.gui.framework.ICDoc;
|
||||||
import forge.gui.framework.ILocalRepaint;
|
import forge.gui.framework.ILocalRepaint;
|
||||||
import forge.gui.toolbox.FSkin;
|
import forge.gui.toolbox.FSkin;
|
||||||
import forge.gui.toolbox.FSkin.JLabelSkin;
|
|
||||||
import forge.gui.toolbox.FSkin.SkinColor;
|
import forge.gui.toolbox.FSkin.SkinColor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -20,11 +19,9 @@ import forge.gui.toolbox.FSkin.SkinColor;
|
|||||||
*/
|
*/
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
public class LblMenuItem extends JLabel implements ILocalRepaint {
|
public class LblMenuItem extends JLabel implements ILocalRepaint {
|
||||||
|
|
||||||
private boolean selected = false;
|
private boolean selected = false;
|
||||||
private boolean hovered = false;
|
private boolean hovered = false;
|
||||||
|
|
||||||
private final JLabelSkin<LblMenuItem> skin;
|
|
||||||
private final SkinColor clrTheme = FSkin.getColor(FSkin.Colors.CLR_THEME);
|
private final SkinColor clrTheme = FSkin.getColor(FSkin.Colors.CLR_THEME);
|
||||||
private final SkinColor l00 = clrTheme.stepColor(0);
|
private final SkinColor l00 = clrTheme.stepColor(0);
|
||||||
private final SkinColor l20 = clrTheme.stepColor(20);
|
private final SkinColor l20 = clrTheme.stepColor(20);
|
||||||
@@ -42,8 +39,7 @@ public class LblMenuItem extends JLabel implements ILocalRepaint {
|
|||||||
public LblMenuItem(final IVSubmenu<? extends ICDoc> doc0) {
|
public LblMenuItem(final IVSubmenu<? extends ICDoc> doc0) {
|
||||||
super(" " + doc0.getMenuTitle());
|
super(" " + doc0.getMenuTitle());
|
||||||
|
|
||||||
skin = FSkin.get(this);
|
FSkin.get(this).setFont(FSkin.getFont(14));
|
||||||
skin.setFont(FSkin.getFont(14));
|
|
||||||
FSkin.get(this).setForeground(FSkin.getColor(FSkin.Colors.CLR_TEXT));
|
FSkin.get(this).setForeground(FSkin.getColor(FSkin.Colors.CLR_TEXT));
|
||||||
|
|
||||||
this.addMouseListener(new MouseAdapter() {
|
this.addMouseListener(new MouseAdapter() {
|
||||||
@@ -84,23 +80,23 @@ public class LblMenuItem extends JLabel implements ILocalRepaint {
|
|||||||
int h = getHeight();
|
int h = getHeight();
|
||||||
|
|
||||||
if (this.selected) {
|
if (this.selected) {
|
||||||
skin.setGraphicsColor(g2d, alpha100);
|
FSkin.setGraphicsColor(g2d, alpha100);
|
||||||
g2d.fillRect(0, 0, w, h);
|
g2d.fillRect(0, 0, w, h);
|
||||||
skin.setGraphicsColor(g2d, d20);
|
FSkin.setGraphicsColor(g2d, d20);
|
||||||
g2d.drawLine(0, 0, w - 3, 0);
|
g2d.drawLine(0, 0, w - 3, 0);
|
||||||
skin.setGraphicsColor(g2d, l20);
|
FSkin.setGraphicsColor(g2d, l20);
|
||||||
g2d.drawLine(0, h - 1, w - 3, h - 1);
|
g2d.drawLine(0, h - 1, w - 3, h - 1);
|
||||||
}
|
}
|
||||||
else if (this.hovered) {
|
else if (this.hovered) {
|
||||||
skin.setGraphicsColor(g2d, d60);
|
FSkin.setGraphicsColor(g2d, d60);
|
||||||
g2d.fillRect(0, 0, getWidth(), h);
|
g2d.fillRect(0, 0, getWidth(), h);
|
||||||
|
|
||||||
skin.setGraphicsGradientPaint(g2d, 200 - 8, 0, l00, 200, 0, d80);
|
FSkin.setGraphicsGradientPaint(g2d, 200 - 8, 0, l00, 200, 0, d80);
|
||||||
g2d.fillRect(w - 2, 0, w, h);
|
g2d.fillRect(w - 2, 0, w, h);
|
||||||
|
|
||||||
skin.setGraphicsColor(g2d, d20);
|
FSkin.setGraphicsColor(g2d, d20);
|
||||||
g2d.drawLine(0, 0, w - 3, 0);
|
g2d.drawLine(0, 0, w - 3, 0);
|
||||||
skin.setGraphicsColor(g2d, l20);
|
FSkin.setGraphicsColor(g2d, l20);
|
||||||
g2d.drawLine(0, h - 1, w - 3, h - 1);
|
g2d.drawLine(0, h - 1, w - 3, h - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,14 +46,14 @@ public class PnlGroup extends JPanel {
|
|||||||
final int w = getWidth();
|
final int w = getWidth();
|
||||||
final int h = getHeight();
|
final int h = getHeight();
|
||||||
|
|
||||||
skin.setGraphicsColor(g2d, d20);
|
FSkin.setGraphicsColor(g2d, d20);
|
||||||
|
|
||||||
// Selected in this group, don't draw background under selected label.
|
// Selected in this group, don't draw background under selected label.
|
||||||
if (getY() < yTop && yTop < getY() + h) {
|
if (getY() < yTop && yTop < getY() + h) {
|
||||||
g2d.fillRect(0, 0, w, lbl.getY());
|
g2d.fillRect(0, 0, w, lbl.getY());
|
||||||
g2d.fillRect(0, lbl.getY() + lbl.getHeight(), w, h);
|
g2d.fillRect(0, lbl.getY() + lbl.getHeight(), w, h);
|
||||||
|
|
||||||
skin.setGraphicsGradientPaint(g2d, w - 8, 0, l00, w, 0, d80);
|
FSkin.setGraphicsGradientPaint(g2d, w - 8, 0, l00, w, 0, d80);
|
||||||
g2d.fillRect(w - 6, 0, w, lbl.getY());
|
g2d.fillRect(w - 6, 0, w, lbl.getY());
|
||||||
g2d.fillRect(w - 6, lbl.getY() + lbl.getHeight(), w, h);
|
g2d.fillRect(w - 6, lbl.getY() + lbl.getHeight(), w, h);
|
||||||
}
|
}
|
||||||
@@ -61,14 +61,14 @@ public class PnlGroup extends JPanel {
|
|||||||
else {
|
else {
|
||||||
g2d.fillRect(0, 0, w, h);
|
g2d.fillRect(0, 0, w, h);
|
||||||
|
|
||||||
skin.setGraphicsGradientPaint(g2d, w - 8, 0, l00, w, 0, d80);
|
FSkin.setGraphicsGradientPaint(g2d, w - 8, 0, l00, w, 0, d80);
|
||||||
g2d.fillRect(w - 6, 0, w, h);
|
g2d.fillRect(w - 6, 0, w, h);
|
||||||
}
|
}
|
||||||
|
|
||||||
skin.setGraphicsColor(g2d, l10);
|
FSkin.setGraphicsColor(g2d, l10);
|
||||||
g2d.drawLine(0, h - 1, w - 1, h - 1);
|
g2d.drawLine(0, h - 1, w - 1, h - 1);
|
||||||
|
|
||||||
skin.setGraphicsColor(g2d, d60);
|
FSkin.setGraphicsColor(g2d, d60);
|
||||||
g2d.drawLine(0, 0, w - 1, 0);
|
g2d.drawLine(0, 0, w - 1, 0);
|
||||||
|
|
||||||
g2d.dispose();
|
g2d.dispose();
|
||||||
|
|||||||
@@ -261,7 +261,7 @@ public enum VHomeUI implements IVTopLevelUI {
|
|||||||
super.paintComponent(g);
|
super.paintComponent(g);
|
||||||
final Graphics2D g2d = (Graphics2D) g.create();
|
final Graphics2D g2d = (Graphics2D) g.create();
|
||||||
|
|
||||||
skin.setGraphicsColor(g2d, skin.getBackground());
|
FSkin.setGraphicsColor(g2d, skin.getBackground());
|
||||||
g2d.fillRect(0, 0, getWidth(), getHeight());
|
g2d.fillRect(0, 0, getWidth(), getHeight());
|
||||||
|
|
||||||
g2d.dispose();
|
g2d.dispose();
|
||||||
@@ -269,11 +269,9 @@ public enum VHomeUI implements IVTopLevelUI {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private class PnlMenu extends JPanel {
|
private class PnlMenu extends JPanel {
|
||||||
private final JComponentSkin<PnlMenu> skin;
|
|
||||||
private final SkinColor d80 = clrTheme.stepColor(-80);
|
private final SkinColor d80 = clrTheme.stepColor(-80);
|
||||||
|
|
||||||
public PnlMenu() {
|
public PnlMenu() {
|
||||||
this.skin = FSkin.get(this);
|
|
||||||
this.setLayout(new MigLayout("insets 0, gap 0, wrap, hidemode 3"));
|
this.setLayout(new MigLayout("insets 0, gap 0, wrap, hidemode 3"));
|
||||||
this.setOpaque(false);
|
this.setOpaque(false);
|
||||||
}
|
}
|
||||||
@@ -305,14 +303,14 @@ public enum VHomeUI implements IVTopLevelUI {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
skin.setGraphicsColor(g2d, l00);
|
FSkin.setGraphicsColor(g2d, l00);
|
||||||
g2d.fillRect(0, y1, w, h1);
|
g2d.fillRect(0, y1, w, h1);
|
||||||
if (h2 > 0) {
|
if (h2 > 0) {
|
||||||
g2d.fillRect(0, y2, w, h2);
|
g2d.fillRect(0, y2, w, h2);
|
||||||
}
|
}
|
||||||
|
|
||||||
int x = w - 8;
|
int x = w - 8;
|
||||||
skin.setGraphicsGradientPaint(g2d, x, 0, l00, w, 0, d80);
|
FSkin.setGraphicsGradientPaint(g2d, x, 0, l00, w, 0, d80);
|
||||||
g2d.fillRect(x, y1, w, h1);
|
g2d.fillRect(x, y1, w, h1);
|
||||||
if (h2 > 0) {
|
if (h2 > 0) {
|
||||||
g2d.fillRect(x, y2, w, h2);
|
g2d.fillRect(x, y2, w, h2);
|
||||||
|
|||||||
@@ -17,7 +17,6 @@ import net.miginfocom.swing.MigLayout;
|
|||||||
import forge.ImageCache;
|
import forge.ImageCache;
|
||||||
import forge.gui.toolbox.FRadioButton;
|
import forge.gui.toolbox.FRadioButton;
|
||||||
import forge.gui.toolbox.FSkin;
|
import forge.gui.toolbox.FSkin;
|
||||||
import forge.gui.toolbox.FSkin.JComponentSkin;
|
|
||||||
import forge.gui.toolbox.FSkin.SkinColor;
|
import forge.gui.toolbox.FSkin.SkinColor;
|
||||||
import forge.gui.toolbox.FSkin.SkinImage;
|
import forge.gui.toolbox.FSkin.SkinImage;
|
||||||
import forge.gui.toolbox.FTextArea;
|
import forge.gui.toolbox.FTextArea;
|
||||||
@@ -38,7 +37,6 @@ class PnlEvent extends JPanel {
|
|||||||
private final int hImg = 100;
|
private final int hImg = 100;
|
||||||
private final int hRfl = 20;
|
private final int hRfl = 20;
|
||||||
|
|
||||||
private final JComponentSkin<PnlEvent> skin;
|
|
||||||
private final Color clr1 = new Color(255, 0, 255, 100);
|
private final Color clr1 = new Color(255, 0, 255, 100);
|
||||||
private final Color clr2 = new Color(255, 255, 0, 0);
|
private final Color clr2 = new Color(255, 255, 0, 0);
|
||||||
private final SkinColor clr3 = FSkin.getColor(FSkin.Colors.CLR_THEME2).alphaColor(200);
|
private final SkinColor clr3 = FSkin.getColor(FSkin.Colors.CLR_THEME2).alphaColor(200);
|
||||||
@@ -52,7 +50,6 @@ class PnlEvent extends JPanel {
|
|||||||
*/
|
*/
|
||||||
public PnlEvent(final QuestEvent e0) {
|
public PnlEvent(final QuestEvent e0) {
|
||||||
super();
|
super();
|
||||||
this.skin = FSkin.get(this);
|
|
||||||
this.event = e0;
|
this.event = e0;
|
||||||
img = ImageCache.getIcon(e0);
|
img = ImageCache.getIcon(e0);
|
||||||
|
|
||||||
@@ -94,7 +91,7 @@ class PnlEvent extends JPanel {
|
|||||||
@Override
|
@Override
|
||||||
public void paintComponent(final Graphics g) {
|
public void paintComponent(final Graphics g) {
|
||||||
Graphics2D g2d = (Graphics2D) g.create();
|
Graphics2D g2d = (Graphics2D) g.create();
|
||||||
skin.setGraphicsGradientPaint(g2d, 0, 0, clr3, getWidth(), 0, clr2);
|
FSkin.setGraphicsGradientPaint(g2d, 0, 0, clr3, getWidth(), 0, clr2);
|
||||||
g2d.fillRect(0, 0, getWidth(), getHeight());
|
g2d.fillRect(0, 0, getWidth(), getHeight());
|
||||||
|
|
||||||
// Padding here
|
// Padding here
|
||||||
@@ -104,7 +101,7 @@ class PnlEvent extends JPanel {
|
|||||||
int wSrc = srcSize.width;
|
int wSrc = srcSize.width;
|
||||||
int hSrc = srcSize.height;
|
int hSrc = srcSize.height;
|
||||||
|
|
||||||
skin.drawImage(g2d, img,
|
FSkin.drawImage(g2d, img,
|
||||||
0, 0, wImg, hImg, // Destination
|
0, 0, wImg, hImg, // Destination
|
||||||
0, 0, wSrc, hSrc); // Source
|
0, 0, wSrc, hSrc); // Source
|
||||||
|
|
||||||
@@ -115,7 +112,7 @@ class PnlEvent extends JPanel {
|
|||||||
BufferedImage refl = new BufferedImage(wImg, hImg, BufferedImage.TYPE_INT_ARGB);
|
BufferedImage refl = new BufferedImage(wImg, hImg, BufferedImage.TYPE_INT_ARGB);
|
||||||
Graphics2D gRefl = refl.createGraphics();
|
Graphics2D gRefl = refl.createGraphics();
|
||||||
|
|
||||||
skin.drawImage(gRefl, img,
|
FSkin.drawImage(gRefl, img,
|
||||||
0, hRfl, wImg, 0, // Destination
|
0, hRfl, wImg, 0, // Destination
|
||||||
0, hSrc - hRfl * hSrc / hImg, wSrc, hSrc); // Source
|
0, hSrc - hRfl * hSrc / hImg, wSrc, hSrc); // Source
|
||||||
|
|
||||||
|
|||||||
@@ -323,7 +323,7 @@ public enum TargetingOverlay {
|
|||||||
g2d.translate(startX, startY);
|
g2d.translate(startX, startY);
|
||||||
g2d.rotate(Math.atan2(ey, ex));
|
g2d.rotate(Math.atan2(ey, ex));
|
||||||
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.75f));
|
g2d.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.75f));
|
||||||
FSkin.get(this).setGraphicsColor(g2d, skinColor);
|
FSkin.setGraphicsColor(g2d, skinColor);
|
||||||
g2d.fill(arrow);
|
g2d.fill(arrow);
|
||||||
g2d.setColor(Color.BLACK);
|
g2d.setColor(Color.BLACK);
|
||||||
g2d.draw(arrow);
|
g2d.draw(arrow);
|
||||||
|
|||||||
@@ -247,15 +247,14 @@ public enum VDock implements IVDoc<CDock> {
|
|||||||
g.setColor(this.getBackground());
|
g.setColor(this.getBackground());
|
||||||
g.fillRect(0, 0, this.w, this.h);
|
g.fillRect(0, 0, this.w, this.h);
|
||||||
|
|
||||||
FSkin.JLabelSkin<DockButton> skin = FSkin.get(this);
|
if (FSkin.get(this).getBackground() == this.hoverBG) {
|
||||||
if (skin.getBackground() == this.hoverBG) {
|
FSkin.setGraphicsColor(g, FSkin.getColor(FSkin.Colors.CLR_BORDERS));
|
||||||
skin.setGraphicsColor(g, FSkin.getColor(FSkin.Colors.CLR_BORDERS));
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
g.setColor(this.defaultBorderColor);
|
g.setColor(this.defaultBorderColor);
|
||||||
}
|
}
|
||||||
g.drawRect(0, 0, this.w - 1, this.h - 1);
|
g.drawRect(0, 0, this.w - 1, this.h - 1);
|
||||||
skin.drawImage(g, this.img, 0, 0, this.w, this.h);
|
FSkin.drawImage(g, this.img, 0, 0, this.w, this.h);
|
||||||
super.paintComponent(g);
|
super.paintComponent(g);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -192,9 +192,8 @@ public class CardFaceSymbols {
|
|||||||
Log.info("Symbol not recognized \"" + symbol + "\" in string: " + s);
|
Log.info("Symbol not recognized \"" + symbol + "\" in string: " + s);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
skin.drawImage(g, image, x, y, w, h);
|
FSkin.drawImage(g, image, x, y, w, h);
|
||||||
x += symbol.length() > 2 ? 10 : 14; // slash.png is only 10 pixels
|
x += symbol.length() > 2 ? 10 : 14; // slash.png is only 10 pixels wide.
|
||||||
// wide.
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -211,7 +210,7 @@ public class CardFaceSymbols {
|
|||||||
* a int.
|
* a int.
|
||||||
*/
|
*/
|
||||||
public static void drawAttack(final ComponentSkin<?> skin, final Graphics g, final int x, final int y) {
|
public static void drawAttack(final ComponentSkin<?> skin, final Graphics g, final int x, final int y) {
|
||||||
skin.drawImage(g, MANA_IMAGES.get("attack"), x, y);
|
FSkin.drawImage(g, MANA_IMAGES.get("attack"), x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -229,7 +228,7 @@ public class CardFaceSymbols {
|
|||||||
* a int.
|
* a int.
|
||||||
*/
|
*/
|
||||||
public static void drawSymbol(final String imageName, final ComponentSkin<?> skin, final Graphics g, final int x, final int y) {
|
public static void drawSymbol(final String imageName, final ComponentSkin<?> skin, final Graphics g, final int x, final int y) {
|
||||||
skin.drawImage(g, MANA_IMAGES.get(imageName), x, y);
|
FSkin.drawImage(g, MANA_IMAGES.get(imageName), x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -243,9 +243,9 @@ public class FButton extends JButton implements ILocalRepaint {
|
|||||||
w = getWidth();
|
w = getWidth();
|
||||||
h = getHeight();
|
h = getHeight();
|
||||||
|
|
||||||
skin.drawImage(g2d, imgL, 0, 0, this.h, this.h);
|
FSkin.drawImage(g2d, imgL, 0, 0, this.h, this.h);
|
||||||
skin.drawImage(g2d, imgM, this.h, 0, this.w - (2 * this.h), this.h);
|
FSkin.drawImage(g2d, imgM, this.h, 0, this.w - (2 * this.h), this.h);
|
||||||
skin.drawImage(g2d, imgR, this.w - this.h, 0, this.h, this.h);
|
FSkin.drawImage(g2d, imgR, this.w - this.h, 0, this.h, this.h);
|
||||||
|
|
||||||
super.paintComponent(g);
|
super.paintComponent(g);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -592,46 +592,46 @@ public class FLabel extends JLabel implements ILocalRepaint {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void paintFocus(final Graphics2D g, int w, int h) {
|
private void paintFocus(final Graphics2D g, int w, int h) {
|
||||||
skin.setGraphicsColor(g, clrHover);
|
FSkin.setGraphicsColor(g, clrHover);
|
||||||
g.drawRect(0, 0, w - 2, h - 2);
|
g.drawRect(0, 0, w - 2, h - 2);
|
||||||
skin.setGraphicsColor(g, l30);
|
FSkin.setGraphicsColor(g, l30);
|
||||||
g.drawRect(1, 1, w - 4, h - 4);
|
g.drawRect(1, 1, w - 4, h - 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void paintPressed(final Graphics2D g, int w, int h) {
|
private void paintPressed(final Graphics2D g, int w, int h) {
|
||||||
skin.setGraphicsGradientPaint(g, 0, h, d50, 0, 0, d10);
|
FSkin.setGraphicsGradientPaint(g, 0, h, d50, 0, 0, d10);
|
||||||
g.fillRect(0, 0, w - 1, h - 1);
|
g.fillRect(0, 0, w - 1, h - 1);
|
||||||
|
|
||||||
skin.setGraphicsColor(g, d50);
|
FSkin.setGraphicsColor(g, d50);
|
||||||
g.drawRect(0, 0, w - 2, h - 2);
|
g.drawRect(0, 0, w - 2, h - 2);
|
||||||
skin.setGraphicsColor(g, d10);
|
FSkin.setGraphicsColor(g, d10);
|
||||||
g.drawRect(1, 1, w - 4, h - 4);
|
g.drawRect(1, 1, w - 4, h - 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void paintUp(final Graphics2D g, int w, int h) {
|
private void paintUp(final Graphics2D g, int w, int h) {
|
||||||
skin.setGraphicsGradientPaint(g, 0, h, d10, 0, 0, l20);
|
FSkin.setGraphicsGradientPaint(g, 0, h, d10, 0, 0, l20);
|
||||||
g.fillRect(0, 0, w, h);
|
g.fillRect(0, 0, w, h);
|
||||||
|
|
||||||
skin.setGraphicsColor(g, d50);
|
FSkin.setGraphicsColor(g, d50);
|
||||||
g.drawRect(0, 0, w - 2, h - 2);
|
g.drawRect(0, 0, w - 2, h - 2);
|
||||||
skin.setGraphicsColor(g, l10);
|
FSkin.setGraphicsColor(g, l10);
|
||||||
g.drawRect(1, 1, w - 4, h - 4);
|
g.drawRect(1, 1, w - 4, h - 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void paintBorder(final Graphics2D g, int w, int h) {
|
private void paintBorder(final Graphics2D g, int w, int h) {
|
||||||
skin.setGraphicsColor(g, l10);
|
FSkin.setGraphicsColor(g, l10);
|
||||||
g.drawRect(0, 0, w - 2, h - 2);
|
g.drawRect(0, 0, w - 2, h - 2);
|
||||||
skin.setGraphicsColor(g, l30);
|
FSkin.setGraphicsColor(g, l30);
|
||||||
g.drawRect(1, 1, w - 4, h - 4);
|
g.drawRect(1, 1, w - 4, h - 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void paintDown(final Graphics2D g, int w, int h) {
|
private void paintDown(final Graphics2D g, int w, int h) {
|
||||||
skin.setGraphicsGradientPaint(g, 0, h, d30, 0, 0, l10);
|
FSkin.setGraphicsGradientPaint(g, 0, h, d30, 0, 0, l10);
|
||||||
g.fillRect(0, 0, w - 1, h - 1);
|
g.fillRect(0, 0, w - 1, h - 1);
|
||||||
|
|
||||||
skin.setGraphicsColor(g, d30);
|
FSkin.setGraphicsColor(g, d30);
|
||||||
g.drawRect(0, 0, w - 2, h - 2);
|
g.drawRect(0, 0, w - 2, h - 2);
|
||||||
skin.setGraphicsColor(g, l10);
|
FSkin.setGraphicsColor(g, l10);
|
||||||
g.drawRect(1, 1, w - 4, h - 4);
|
g.drawRect(1, 1, w - 4, h - 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -290,10 +290,10 @@ public class FPanel extends JPanel implements ILocalRepaint {
|
|||||||
//========== Special draw methods
|
//========== Special draw methods
|
||||||
private void drawBackgroundColor(final Graphics2D g2d0) {
|
private void drawBackgroundColor(final Graphics2D g2d0) {
|
||||||
// Color background as appropriate
|
// Color background as appropriate
|
||||||
if (selected) { skin.setGraphicsColor(g2d0, FSkin.getColor(FSkin.Colors.CLR_ACTIVE)); }
|
if (selected) { FSkin.setGraphicsColor(g2d0, FSkin.getColor(FSkin.Colors.CLR_ACTIVE)); }
|
||||||
else if (hovered) { skin.setGraphicsColor(g2d0, FSkin.getColor(FSkin.Colors.CLR_HOVER)); }
|
else if (hovered) { FSkin.setGraphicsColor(g2d0, FSkin.getColor(FSkin.Colors.CLR_HOVER)); }
|
||||||
else if (selectable) { skin.setGraphicsColor(g2d0, FSkin.getColor(FSkin.Colors.CLR_INACTIVE)); }
|
else if (selectable) { FSkin.setGraphicsColor(g2d0, FSkin.getColor(FSkin.Colors.CLR_INACTIVE)); }
|
||||||
else { skin.setGraphicsColor(g2d0, skin.getBackground()); }
|
else { FSkin.setGraphicsColor(g2d0, skin.getBackground()); }
|
||||||
|
|
||||||
g2d0.fillRoundRect(0, 0, pnlW, pnlH, cornerDiameter, cornerDiameter);
|
g2d0.fillRoundRect(0, 0, pnlW, pnlH, cornerDiameter, cornerDiameter);
|
||||||
}
|
}
|
||||||
@@ -362,7 +362,7 @@ public class FPanel extends JPanel implements ILocalRepaint {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void drawBorder(final Graphics2D g2d0) {
|
private void drawBorder(final Graphics2D g2d0) {
|
||||||
skin.setGraphicsColor(g2d0, borderColor);
|
FSkin.setGraphicsColor(g2d0, borderColor);
|
||||||
g2d0.drawRoundRect(0, 0, pnlW - 1, pnlH - 1, cornerDiameter, cornerDiameter);
|
g2d0.drawRoundRect(0, 0, pnlW - 1, pnlH - 1, cornerDiameter, cornerDiameter);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ import javax.swing.ScrollPaneConstants;
|
|||||||
import javax.swing.Timer;
|
import javax.swing.Timer;
|
||||||
|
|
||||||
import forge.gui.framework.ILocalRepaint;
|
import forge.gui.framework.ILocalRepaint;
|
||||||
import forge.gui.toolbox.FSkin.JLabelSkin;
|
|
||||||
import forge.gui.toolbox.FSkin.SkinColor;
|
import forge.gui.toolbox.FSkin.SkinColor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -218,7 +217,6 @@ public class FScrollPanel extends JScrollPane {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private abstract class ArrowButton extends JLabel implements ILocalRepaint {
|
private abstract class ArrowButton extends JLabel implements ILocalRepaint {
|
||||||
private final JLabelSkin<ArrowButton> skin;
|
|
||||||
private final SkinColor clrFore = FSkin.getColor(FSkin.Colors.CLR_TEXT);
|
private final SkinColor clrFore = FSkin.getColor(FSkin.Colors.CLR_TEXT);
|
||||||
private final SkinColor clrBack = FSkin.getColor(FSkin.Colors.CLR_INACTIVE);
|
private final SkinColor clrBack = FSkin.getColor(FSkin.Colors.CLR_INACTIVE);
|
||||||
private final SkinColor d50 = clrBack.stepColor(-50);
|
private final SkinColor d50 = clrBack.stepColor(-50);
|
||||||
@@ -234,7 +232,6 @@ public class FScrollPanel extends JScrollPane {
|
|||||||
|
|
||||||
protected ArrowButton(final JScrollBar scrollBar0, final int incrementDirection0) {
|
protected ArrowButton(final JScrollBar scrollBar0, final int incrementDirection0) {
|
||||||
super("");
|
super("");
|
||||||
skin = FSkin.get(this);
|
|
||||||
scrollBar = scrollBar0;
|
scrollBar = scrollBar0;
|
||||||
incrementDirection = incrementDirection0;
|
incrementDirection = incrementDirection0;
|
||||||
timer.setInitialDelay(500); //wait half a second after mouse down before starting timer
|
timer.setInitialDelay(500); //wait half a second after mouse down before starting timer
|
||||||
@@ -260,15 +257,15 @@ public class FScrollPanel extends JScrollPane {
|
|||||||
Composite oldComp = g2d.getComposite();
|
Composite oldComp = g2d.getComposite();
|
||||||
g2d.setComposite(hovered ? alphaHovered : alphaDefault);
|
g2d.setComposite(hovered ? alphaHovered : alphaDefault);
|
||||||
|
|
||||||
skin.setGraphicsGradientPaint(g2d, 0, h, d10, 0, 0, l20);
|
FSkin.setGraphicsGradientPaint(g2d, 0, h, d10, 0, 0, l20);
|
||||||
g.fillRect(0, 0, w, h);
|
g.fillRect(0, 0, w, h);
|
||||||
|
|
||||||
skin.setGraphicsColor(g, d50);
|
FSkin.setGraphicsColor(g, d50);
|
||||||
g.drawRect(0, 0, w - 1, h - 1);
|
g.drawRect(0, 0, w - 1, h - 1);
|
||||||
skin.setGraphicsColor(g, l10);
|
FSkin.setGraphicsColor(g, l10);
|
||||||
g.drawRect(1, 1, w - 3, h - 3);
|
g.drawRect(1, 1, w - 3, h - 3);
|
||||||
|
|
||||||
skin.setGraphicsColor(g, clrFore);
|
FSkin.setGraphicsColor(g, clrFore);
|
||||||
drawArrow(g);
|
drawArrow(g);
|
||||||
|
|
||||||
super.paintComponent(g);
|
super.paintComponent(g);
|
||||||
|
|||||||
@@ -139,37 +139,6 @@ public enum FSkin {
|
|||||||
this.cursor = null;
|
this.cursor = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setGraphicsColor(Graphics g, SkinColor skinColor) {
|
|
||||||
this.needRepaintOnReapply = true;
|
|
||||||
g.setColor(skinColor.color);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setGraphicsGradientPaint(Graphics2D g2d, float x1, float y1, SkinColor skinColor1, float x2, float y2, SkinColor skinColor2) {
|
|
||||||
this.needRepaintOnReapply = true;
|
|
||||||
g2d.setPaint(new GradientPaint(x1, y1, skinColor1.color, x2, y2, skinColor2.color));
|
|
||||||
}
|
|
||||||
public void setGraphicsGradientPaint(Graphics2D g2d, float x1, float y1, Color color1, float x2, float y2, SkinColor skinColor2) {
|
|
||||||
this.needRepaintOnReapply = true;
|
|
||||||
g2d.setPaint(new GradientPaint(x1, y1, color1, x2, y2, skinColor2.color));
|
|
||||||
}
|
|
||||||
public void setGraphicsGradientPaint(Graphics2D g2d, float x1, float y1, SkinColor skinColor1, float x2, float y2, Color color2) {
|
|
||||||
this.needRepaintOnReapply = true;
|
|
||||||
g2d.setPaint(new GradientPaint(x1, y1, skinColor1.color, x2, y2, color2));
|
|
||||||
}
|
|
||||||
|
|
||||||
public void drawImage(Graphics g, SkinImage skinImage, int x, int y) {
|
|
||||||
this.needRepaintOnReapply = true;
|
|
||||||
g.drawImage(skinImage.image, x, y, null);
|
|
||||||
}
|
|
||||||
public void drawImage(Graphics g, SkinImage skinImage, int x, int y, int w, int h) {
|
|
||||||
this.needRepaintOnReapply = true;
|
|
||||||
g.drawImage(skinImage.image, x, y, w, h, null);
|
|
||||||
}
|
|
||||||
public void drawImage(Graphics g, SkinImage skinImage, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2) {
|
|
||||||
this.needRepaintOnReapply = true;
|
|
||||||
g.drawImage(skinImage.image, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, null);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void reapply() {
|
protected void reapply() {
|
||||||
if (this.foreground != null) {
|
if (this.foreground != null) {
|
||||||
comp.setForeground(this.foreground.color);
|
comp.setForeground(this.foreground.color);
|
||||||
@@ -619,6 +588,20 @@ public enum FSkin {
|
|||||||
return isColorBright(c) ? Color.BLACK : Color.WHITE;
|
return isColorBright(c) ? Color.BLACK : Color.WHITE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void setGraphicsColor(Graphics g, SkinColor skinColor) {
|
||||||
|
g.setColor(skinColor.color);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setGraphicsGradientPaint(Graphics2D g2d, float x1, float y1, SkinColor skinColor1, float x2, float y2, SkinColor skinColor2) {
|
||||||
|
g2d.setPaint(new GradientPaint(x1, y1, skinColor1.color, x2, y2, skinColor2.color));
|
||||||
|
}
|
||||||
|
public static void setGraphicsGradientPaint(Graphics2D g2d, float x1, float y1, Color color1, float x2, float y2, SkinColor skinColor2) {
|
||||||
|
g2d.setPaint(new GradientPaint(x1, y1, color1, x2, y2, skinColor2.color));
|
||||||
|
}
|
||||||
|
public static void setGraphicsGradientPaint(Graphics2D g2d, float x1, float y1, SkinColor skinColor1, float x2, float y2, Color color2) {
|
||||||
|
g2d.setPaint(new GradientPaint(x1, y1, skinColor1.color, x2, y2, color2));
|
||||||
|
}
|
||||||
|
|
||||||
public static class SkinColor {
|
public static class SkinColor {
|
||||||
private static final HashMap<Colors, SkinColor> baseColors = new HashMap<Colors, SkinColor>();
|
private static final HashMap<Colors, SkinColor> baseColors = new HashMap<Colors, SkinColor>();
|
||||||
private static final HashMap<String, SkinColor> derivedColors = new HashMap<String, SkinColor>();
|
private static final HashMap<String, SkinColor> derivedColors = new HashMap<String, SkinColor>();
|
||||||
@@ -864,6 +847,16 @@ public enum FSkin {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void drawImage(Graphics g, SkinImage skinImage, int x, int y) {
|
||||||
|
g.drawImage(skinImage.image, x, y, null);
|
||||||
|
}
|
||||||
|
public static void drawImage(Graphics g, SkinImage skinImage, int x, int y, int w, int h) {
|
||||||
|
g.drawImage(skinImage.image, x, y, w, h, null);
|
||||||
|
}
|
||||||
|
public static void drawImage(Graphics g, SkinImage skinImage, int dx1, int dy1, int dx2, int dy2, int sx1, int sy1, int sx2, int sy2) {
|
||||||
|
g.drawImage(skinImage.image, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, null);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets an image.
|
* Gets an image.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ public class FTextField extends JTextField {
|
|||||||
final Insets margin = this.getMargin();
|
final Insets margin = this.getMargin();
|
||||||
final Graphics2D g2d = (Graphics2D)g.create();
|
final Graphics2D g2d = (Graphics2D)g.create();
|
||||||
g2d.setFont(this.getFont());
|
g2d.setFont(this.getFont());
|
||||||
skin.setGraphicsColor(g2d, skin.getForeground().stepColor(20));
|
FSkin.setGraphicsColor(g2d, skin.getForeground().stepColor(20));
|
||||||
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
|
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
|
||||||
g2d.drawString(this.ghostText, margin.left + 2, margin.top + 15); //account for borders (TODO: why +15?)
|
g2d.drawString(this.ghostText, margin.left + 2, margin.top + 15); //account for borders (TODO: why +15?)
|
||||||
g2d.dispose();
|
g2d.dispose();
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ import forge.gui.framework.ILocalRepaint;
|
|||||||
import forge.gui.toolbox.FSkin;
|
import forge.gui.toolbox.FSkin;
|
||||||
import forge.gui.toolbox.FSkin.Colors;
|
import forge.gui.toolbox.FSkin.Colors;
|
||||||
import forge.gui.toolbox.FSkin.JComponentSkin;
|
import forge.gui.toolbox.FSkin.JComponentSkin;
|
||||||
import forge.gui.toolbox.FSkin.JLabelSkin;
|
|
||||||
import forge.gui.toolbox.FSkin.SkinColor;
|
import forge.gui.toolbox.FSkin.SkinColor;
|
||||||
import forge.gui.toolbox.FTextField;
|
import forge.gui.toolbox.FTextField;
|
||||||
import forge.gui.toolbox.LayoutHelper;
|
import forge.gui.toolbox.LayoutHelper;
|
||||||
@@ -195,7 +194,6 @@ public abstract class ItemFilter<T extends InventoryItem> {
|
|||||||
|
|
||||||
@SuppressWarnings("serial")
|
@SuppressWarnings("serial")
|
||||||
private class RemoveButton extends JLabel implements ILocalRepaint {
|
private class RemoveButton extends JLabel implements ILocalRepaint {
|
||||||
protected JLabelSkin<RemoveButton> skin = FSkin.get(this);
|
|
||||||
private final SkinColor iconColor = FSkin.getColor(Colors.CLR_TEXT);
|
private final SkinColor iconColor = FSkin.getColor(Colors.CLR_TEXT);
|
||||||
private boolean pressed, hovered;
|
private boolean pressed, hovered;
|
||||||
|
|
||||||
@@ -267,10 +265,10 @@ public abstract class ItemFilter<T extends InventoryItem> {
|
|||||||
if (pressed) {
|
if (pressed) {
|
||||||
g.translate(1, 1); //translate icon to give pressed button look
|
g.translate(1, 1); //translate icon to give pressed button look
|
||||||
}
|
}
|
||||||
skin.setGraphicsColor(g2d, iconColor);
|
FSkin.setGraphicsColor(g2d, iconColor);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skin.setGraphicsColor(g2d, iconColor.alphaColor(150));
|
FSkin.setGraphicsColor(g2d, iconColor.alphaColor(150));
|
||||||
}
|
}
|
||||||
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
|
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
|
||||||
g2d.setStroke(new BasicStroke(thickness));
|
g2d.setStroke(new BasicStroke(thickness));
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ import java.awt.event.MouseEvent;
|
|||||||
import javax.swing.JLabel;
|
import javax.swing.JLabel;
|
||||||
import forge.gui.deckeditor.CDeckEditorUI;
|
import forge.gui.deckeditor.CDeckEditorUI;
|
||||||
import forge.gui.toolbox.FSkin;
|
import forge.gui.toolbox.FSkin;
|
||||||
import forge.gui.toolbox.FSkin.JLabelSkin;
|
|
||||||
import forge.gui.toolbox.FSkin.SkinImage;
|
import forge.gui.toolbox.FSkin.SkinImage;
|
||||||
import forge.item.InventoryItem;
|
import forge.item.InventoryItem;
|
||||||
|
|
||||||
@@ -37,8 +36,6 @@ public class DeckQuantityRenderer extends ItemCellRenderer {
|
|||||||
private static final SkinImage imgRemove = FSkin.getIcon(FSkin.InterfaceIcons.ICO_MINUS);
|
private static final SkinImage imgRemove = FSkin.getIcon(FSkin.InterfaceIcons.ICO_MINUS);
|
||||||
private static final int imgSize = 13;
|
private static final int imgSize = 13;
|
||||||
|
|
||||||
private final JLabelSkin<DeckQuantityRenderer> skin = FSkin.get(this);
|
|
||||||
|
|
||||||
public DeckQuantityRenderer() {
|
public DeckQuantityRenderer() {
|
||||||
this.setHorizontalAlignment(JLabel.CENTER);
|
this.setHorizontalAlignment(JLabel.CENTER);
|
||||||
}
|
}
|
||||||
@@ -75,7 +72,7 @@ public class DeckQuantityRenderer extends ItemCellRenderer {
|
|||||||
super.paint(g);
|
super.paint(g);
|
||||||
|
|
||||||
int y = (this.getHeight() - imgSize) / 2;
|
int y = (this.getHeight() - imgSize) / 2;
|
||||||
skin.drawImage(g, imgAdd, 0, y, imgSize, imgSize);
|
FSkin.drawImage(g, imgAdd, 0, y, imgSize, imgSize);
|
||||||
skin.drawImage(g, imgRemove, this.getWidth() - imgSize, y, imgSize, imgSize);
|
FSkin.drawImage(g, imgRemove, this.getWidth() - imgSize, y, imgSize, imgSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -109,6 +109,6 @@ public class StarRenderer extends ItemCellRenderer {
|
|||||||
if (size > width) {
|
if (size > width) {
|
||||||
size = width;
|
size = width;
|
||||||
}
|
}
|
||||||
FSkin.get(this).drawImage(g, skinImage, (width - size) / 2, (height - size) / 2, size, size);
|
FSkin.drawImage(g, skinImage, (width - size) / 2, (height - size) / 2, size, size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -119,18 +119,22 @@ public class PhaseLabel extends JLabel {
|
|||||||
// Set color according to skip or active or hover state of label
|
// Set color according to skip or active or hover state of label
|
||||||
if (this.hover) {
|
if (this.hover) {
|
||||||
c = FSkin.getColor(FSkin.Colors.CLR_HOVER);
|
c = FSkin.getColor(FSkin.Colors.CLR_HOVER);
|
||||||
} else if (this.active && this.enabled) {
|
}
|
||||||
|
else if (this.active && this.enabled) {
|
||||||
c = FSkin.getColor(FSkin.Colors.CLR_PHASE_ACTIVE_ENABLED);
|
c = FSkin.getColor(FSkin.Colors.CLR_PHASE_ACTIVE_ENABLED);
|
||||||
} else if (!this.active && this.enabled) {
|
}
|
||||||
|
else if (!this.active && this.enabled) {
|
||||||
c = FSkin.getColor(FSkin.Colors.CLR_PHASE_INACTIVE_ENABLED);
|
c = FSkin.getColor(FSkin.Colors.CLR_PHASE_INACTIVE_ENABLED);
|
||||||
} else if (this.active && !this.enabled) {
|
}
|
||||||
|
else if (this.active && !this.enabled) {
|
||||||
c = FSkin.getColor(FSkin.Colors.CLR_PHASE_ACTIVE_DISABLED);
|
c = FSkin.getColor(FSkin.Colors.CLR_PHASE_ACTIVE_DISABLED);
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
c = FSkin.getColor(FSkin.Colors.CLR_PHASE_INACTIVE_DISABLED);
|
c = FSkin.getColor(FSkin.Colors.CLR_PHASE_INACTIVE_DISABLED);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Center vertically and horizontally. Show border if active.
|
// Center vertically and horizontally. Show border if active.
|
||||||
FSkin.get(this).setGraphicsColor(g, c);
|
FSkin.setGraphicsColor(g, c);
|
||||||
g.fillRoundRect(1, 1, w - 2, h - 2, 5, 5);
|
g.fillRoundRect(1, 1, w - 2, h - 2, 5, 5);
|
||||||
super.paintComponent(g);
|
super.paintComponent(g);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -127,7 +127,7 @@ public class FDialog extends JDialog implements ITitleBarOwner, KeyEventDispatch
|
|||||||
if (antiAliasBorder) {
|
if (antiAliasBorder) {
|
||||||
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
|
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
|
||||||
}
|
}
|
||||||
skin.setGraphicsColor(g2d, borderColor);
|
FSkin.setGraphicsColor(g2d, borderColor);
|
||||||
if (isSetShapeSupported) {
|
if (isSetShapeSupported) {
|
||||||
g2d.drawRoundRect(0, 0, this.getWidth() - 1, this.getHeight() - 1, cornerDiameter, cornerDiameter);
|
g2d.drawRoundRect(0, 0, this.getWidth() - 1, this.getHeight() - 1, cornerDiameter, cornerDiameter);
|
||||||
}
|
}
|
||||||
@@ -328,8 +328,6 @@ public class FDialog extends JDialog implements ITitleBarOwner, KeyEventDispatch
|
|||||||
private static class BackdropPanel extends JPanel {
|
private static class BackdropPanel extends JPanel {
|
||||||
private static final SkinColor backColor = FSkin.getColor(FSkin.Colors.CLR_OVERLAY).alphaColor(120);
|
private static final SkinColor backColor = FSkin.getColor(FSkin.Colors.CLR_OVERLAY).alphaColor(120);
|
||||||
|
|
||||||
private FSkin.JComponentSkin<BackdropPanel> skin = FSkin.get(this);
|
|
||||||
|
|
||||||
private BackdropPanel() {
|
private BackdropPanel() {
|
||||||
setOpaque(false);
|
setOpaque(false);
|
||||||
setVisible(false);
|
setVisible(false);
|
||||||
@@ -339,7 +337,7 @@ public class FDialog extends JDialog implements ITitleBarOwner, KeyEventDispatch
|
|||||||
@Override
|
@Override
|
||||||
public void paintComponent(final Graphics g) {
|
public void paintComponent(final Graphics g) {
|
||||||
super.paintComponent(g);
|
super.paintComponent(g);
|
||||||
skin.setGraphicsColor(g, backColor);
|
FSkin.setGraphicsColor(g, backColor);
|
||||||
g.fillRect(0, 0, this.getWidth(), this.getHeight());
|
g.fillRect(0, 0, this.getWidth(), this.getHeight());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,6 @@ import forge.gui.menus.LayoutMenu;
|
|||||||
import forge.gui.toolbox.FButton;
|
import forge.gui.toolbox.FButton;
|
||||||
import forge.gui.toolbox.FDigitalClock;
|
import forge.gui.toolbox.FDigitalClock;
|
||||||
import forge.gui.toolbox.FSkin;
|
import forge.gui.toolbox.FSkin;
|
||||||
import forge.gui.toolbox.FSkin.JLabelSkin;
|
|
||||||
import forge.gui.toolbox.FSkin.SkinColor;
|
import forge.gui.toolbox.FSkin.SkinColor;
|
||||||
import forge.properties.ForgePreferences.FPref;
|
import forge.properties.ForgePreferences.FPref;
|
||||||
import forge.util.ReflectionUtil;
|
import forge.util.ReflectionUtil;
|
||||||
@@ -466,15 +465,14 @@ public class FNavigationBar extends FTitleBarBase {
|
|||||||
int height = visibleHeight - 1;
|
int height = visibleHeight - 1;
|
||||||
int radius = 6;
|
int radius = 6;
|
||||||
backColor = this.selected ? bottomEdgeColor : (this.hovered ? buttonHoverColor : buttonHoverColor.alphaColor(unhoveredAlpha));
|
backColor = this.selected ? bottomEdgeColor : (this.hovered ? buttonHoverColor : buttonHoverColor.alphaColor(unhoveredAlpha));
|
||||||
skin.setGraphicsGradientPaint(g2d, 0, 0, backColor.stepColor(30), 0, height, backColor);
|
FSkin.setGraphicsGradientPaint(g2d, 0, 0, backColor.stepColor(30), 0, height, backColor);
|
||||||
g.fillRoundRect(0, 0, width, height, radius, radius);
|
g.fillRoundRect(0, 0, width, height, radius, radius);
|
||||||
skin.setGraphicsColor(g, buttonBorderColor);
|
FSkin.setGraphicsColor(g, buttonBorderColor);
|
||||||
g.drawRoundRect(0, 0, width, height, radius, radius);
|
g.drawRoundRect(0, 0, width, height, radius, radius);
|
||||||
super.paintComponent(g);
|
super.paintComponent(g);
|
||||||
}
|
}
|
||||||
|
|
||||||
private class CloseButton extends JLabel implements ILocalRepaint {
|
private class CloseButton extends JLabel implements ILocalRepaint {
|
||||||
protected JLabelSkin<CloseButton> skin = FSkin.get(this);
|
|
||||||
private boolean pressed, hovered;
|
private boolean pressed, hovered;
|
||||||
|
|
||||||
private CloseButton() {
|
private CloseButton() {
|
||||||
@@ -534,12 +532,12 @@ public class FNavigationBar extends FTitleBarBase {
|
|||||||
|
|
||||||
if (hovered) {
|
if (hovered) {
|
||||||
if (pressed) {
|
if (pressed) {
|
||||||
skin.setGraphicsColor(g, backColor.stepColor(-40));
|
FSkin.setGraphicsColor(g, backColor.stepColor(-40));
|
||||||
g.fillRect(0, 0, getWidth(), getHeight());
|
g.fillRect(0, 0, getWidth(), getHeight());
|
||||||
g.translate(1, 1); //translate icon to give pressed button look
|
g.translate(1, 1); //translate icon to give pressed button look
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skin.setGraphicsColor(g, backColor.getContrastColor(20));
|
FSkin.setGraphicsColor(g, backColor.getContrastColor(20));
|
||||||
g.fillRect(0, 0, getWidth(), getHeight());
|
g.fillRect(0, 0, getWidth(), getHeight());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -556,7 +554,7 @@ public class FNavigationBar extends FTitleBarBase {
|
|||||||
if (!NavigationTab.this.isEnabled()) {
|
if (!NavigationTab.this.isEnabled()) {
|
||||||
iconColor = iconColor.alphaColor(100);
|
iconColor = iconColor.alphaColor(100);
|
||||||
}
|
}
|
||||||
skin.setGraphicsColor(g2d, iconColor);
|
FSkin.setGraphicsColor(g2d, iconColor);
|
||||||
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
|
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
|
||||||
g2d.setStroke(new BasicStroke(thickness));
|
g2d.setStroke(new BasicStroke(thickness));
|
||||||
g2d.drawLine(x1, y1, x2, y2);
|
g2d.drawLine(x1, y1, x2, y2);
|
||||||
|
|||||||
@@ -194,21 +194,21 @@ public abstract class FTitleBarBase extends JMenuBar {
|
|||||||
public void paintComponent(Graphics g) {
|
public void paintComponent(Graphics g) {
|
||||||
if (hovered) {
|
if (hovered) {
|
||||||
if (pressed) {
|
if (pressed) {
|
||||||
skin.setGraphicsColor(g, buttonDownColor);
|
FSkin.setGraphicsColor(g, buttonDownColor);
|
||||||
g.fillRect(0, 0, getWidth(), getHeight());
|
g.fillRect(0, 0, getWidth(), getHeight());
|
||||||
g.translate(1, 1); //translate icon to give pressed button look
|
g.translate(1, 1); //translate icon to give pressed button look
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skin.setGraphicsColor(g, buttonHoverColor);
|
FSkin.setGraphicsColor(g, buttonHoverColor);
|
||||||
g.fillRect(0, 0, getWidth(), getHeight());
|
g.fillRect(0, 0, getWidth(), getHeight());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (isToggled()) {
|
else if (isToggled()) {
|
||||||
int width = getWidth() - 2;
|
int width = getWidth() - 2;
|
||||||
int height = getHeight() - 2;
|
int height = getHeight() - 2;
|
||||||
skin.setGraphicsColor(g, buttonToggleColor);
|
FSkin.setGraphicsColor(g, buttonToggleColor);
|
||||||
g.fillRect(1, 1, width, height);
|
g.fillRect(1, 1, width, height);
|
||||||
skin.setGraphicsColor(g, buttonBorderColor);
|
FSkin.setGraphicsColor(g, buttonBorderColor);
|
||||||
g.drawRect(1, 1, width - 1, height - 1);
|
g.drawRect(1, 1, width - 1, height - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -239,7 +239,7 @@ public abstract class FTitleBarBase extends JMenuBar {
|
|||||||
int y1 = (getHeight() - knobHeight) / 2 - 1;
|
int y1 = (getHeight() - knobHeight) / 2 - 1;
|
||||||
int y2 = y1 + knobHeight - 1;
|
int y2 = y1 + knobHeight - 1;
|
||||||
|
|
||||||
skin.setGraphicsColor(g, foreColor);
|
FSkin.setGraphicsColor(g, foreColor);
|
||||||
|
|
||||||
g.drawRect(x1, y1, knobWidth - 1, knobHeight - 1);
|
g.drawRect(x1, y1, knobWidth - 1, knobHeight - 1);
|
||||||
g.drawLine(x2 - 1, y1 + 1, x2 - 1, y2 - 1);
|
g.drawLine(x2 - 1, y1 + 1, x2 - 1, y2 - 1);
|
||||||
@@ -268,7 +268,7 @@ public abstract class FTitleBarBase extends JMenuBar {
|
|||||||
int y = getHeight() - offsetY - thickness;
|
int y = getHeight() - offsetY - thickness;
|
||||||
|
|
||||||
Graphics2D g2d = (Graphics2D) g;
|
Graphics2D g2d = (Graphics2D) g;
|
||||||
skin.setGraphicsColor(g2d, foreColor);
|
FSkin.setGraphicsColor(g2d, foreColor);
|
||||||
g2d.setStroke(new BasicStroke(thickness));
|
g2d.setStroke(new BasicStroke(thickness));
|
||||||
g2d.drawLine(x1, y, x2, y);
|
g2d.drawLine(x1, y, x2, y);
|
||||||
}
|
}
|
||||||
@@ -295,7 +295,7 @@ public abstract class FTitleBarBase extends JMenuBar {
|
|||||||
int y2 = getHeight() - offset - 1;
|
int y2 = getHeight() - offset - 1;
|
||||||
|
|
||||||
Graphics2D g2d = (Graphics2D) g;
|
Graphics2D g2d = (Graphics2D) g;
|
||||||
skin.setGraphicsColor(g2d, foreColor);
|
FSkin.setGraphicsColor(g2d, foreColor);
|
||||||
|
|
||||||
if (owner.isFullScreen()) { //draw arrows facing inward
|
if (owner.isFullScreen()) { //draw arrows facing inward
|
||||||
g2d.drawLine(x1 + arrowLength, y1, x1 + arrowLength, y1 + arrowLength);
|
g2d.drawLine(x1 + arrowLength, y1, x1 + arrowLength, y1 + arrowLength);
|
||||||
@@ -353,7 +353,7 @@ public abstract class FTitleBarBase extends JMenuBar {
|
|||||||
int height = getHeight() - 2 * offsetY;
|
int height = getHeight() - 2 * offsetY;
|
||||||
|
|
||||||
Graphics2D g2d = (Graphics2D) g;
|
Graphics2D g2d = (Graphics2D) g;
|
||||||
skin.setGraphicsColor(g2d, foreColor);
|
FSkin.setGraphicsColor(g2d, foreColor);
|
||||||
g2d.setStroke(new BasicStroke(thickness));
|
g2d.setStroke(new BasicStroke(thickness));
|
||||||
|
|
||||||
if (owner.isMaximized()) { //draw 2 rectangles offset if icon to restore window
|
if (owner.isMaximized()) { //draw 2 rectangles offset if icon to restore window
|
||||||
@@ -403,7 +403,7 @@ public abstract class FTitleBarBase extends JMenuBar {
|
|||||||
iconColor = iconColor.alphaColor(100);
|
iconColor = iconColor.alphaColor(100);
|
||||||
}
|
}
|
||||||
Graphics2D g2d = (Graphics2D) g;
|
Graphics2D g2d = (Graphics2D) g;
|
||||||
skin.setGraphicsColor(g2d, iconColor);
|
FSkin.setGraphicsColor(g2d, iconColor);
|
||||||
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
|
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
|
||||||
g2d.setStroke(new BasicStroke(thickness));
|
g2d.setStroke(new BasicStroke(thickness));
|
||||||
g2d.drawLine(x1, y1, x2, y2);
|
g2d.drawLine(x1, y1, x2, y2);
|
||||||
|
|||||||
Reference in New Issue
Block a user