forked from External/mage
* Draft - Added possibility to mark a card to draft on timeout. Added sounds to draft. Changed compression of some sound files.
This commit is contained in:
parent
c3adb1337b
commit
e6c7fa5f96
28 changed files with 317 additions and 90 deletions
|
|
@ -428,6 +428,8 @@ public class CardPanel extends MagePermanent implements MouseListener, MouseMoti
|
|||
this.isSelected = isSelected;
|
||||
if (isSelected) {
|
||||
this.titleText.setGlowColor(Color.green);
|
||||
} else {
|
||||
this.titleText.setGlowColor(Color.black);
|
||||
}
|
||||
// noxx: bad idea is to call repaint in setter method
|
||||
////repaint();
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ public class GlowText extends JLabel {
|
|||
this.wrap = wrap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Dimension getPreferredSize () {
|
||||
Dimension size = super.getPreferredSize();
|
||||
size.width += glowSize;
|
||||
|
|
@ -37,12 +38,16 @@ public class GlowText extends JLabel {
|
|||
return size;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setText (String text) {
|
||||
super.setText(text);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paint (Graphics g) {
|
||||
if (getText().length() == 0) return;
|
||||
if (getText().length() == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
Graphics2D g2d = (Graphics2D)g;
|
||||
g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
|
||||
|
|
@ -62,14 +67,17 @@ public class GlowText extends JLabel {
|
|||
while (measurer.getPosition() < charIterator.getEndIndex()) {
|
||||
//TextLayout textLayout = measurer.nextLayout(wrapWidth);
|
||||
lineCount++;
|
||||
if (lineCount > 2) break;
|
||||
if (lineCount > 2) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
charIterator.first();
|
||||
// Use char wrap if word wrap would cause more than two lines of text.
|
||||
if (lineCount > 2)
|
||||
if (lineCount > 2) {
|
||||
measurer = new LineBreakMeasurer(charIterator, BreakIterator.getCharacterInstance(Locale.ENGLISH), fontContext);
|
||||
else
|
||||
} else {
|
||||
measurer.setPosition(0);
|
||||
}
|
||||
while (measurer.getPosition() < charIterator.getEndIndex()) {
|
||||
TextLayout textLayout = measurer.nextLayout(wrapWidth);
|
||||
float ascent = textLayout.getAscent();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue