mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
Moar performance.
This commit is contained in:
@@ -154,7 +154,7 @@ public class ViewMessage extends FPanel {
|
||||
remindIsRunning = false;
|
||||
timer1.stop();
|
||||
}
|
||||
repaint();
|
||||
repaintOnlyThisPanel();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package forge.view.toolbox;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
@@ -132,6 +133,12 @@ public class DeckLister extends JPanel {
|
||||
return selectedDeck;
|
||||
}
|
||||
|
||||
/** Prevent panel from repainting the whole screen. */
|
||||
public void repaintOnlyThisPanel() {
|
||||
final Dimension d = DeckLister.this.getSize();
|
||||
repaint(0, 0, d.width, d.height);
|
||||
}
|
||||
|
||||
private class DeleteButton extends JButton {
|
||||
public DeleteButton(final RowPanel r0) {
|
||||
super();
|
||||
@@ -411,7 +418,7 @@ public class DeckLister extends JPanel {
|
||||
}
|
||||
|
||||
this.remove(r0);
|
||||
this.repaint();
|
||||
this.repaintOnlyThisPanel();
|
||||
this.revalidate();
|
||||
|
||||
if (cmdDelete != null) { cmdDelete.execute(); }
|
||||
|
||||
@@ -2,6 +2,7 @@ package forge.view.toolbox;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Cursor;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
@@ -31,12 +32,12 @@ public class SubTab extends JPanel {
|
||||
@Override
|
||||
public void mouseEntered(MouseEvent e) {
|
||||
hovering = true;
|
||||
repaint();
|
||||
repaintOnlyThisPanel();
|
||||
}
|
||||
@Override
|
||||
public void mouseExited(MouseEvent e) {
|
||||
hovering = false;
|
||||
repaint();
|
||||
repaintOnlyThisPanel();
|
||||
}
|
||||
};
|
||||
this.removeMouseListener(madHover);
|
||||
@@ -51,7 +52,7 @@ public class SubTab extends JPanel {
|
||||
/** @param b0   {@link java.lang.Boolean} */
|
||||
public void setEnabled(boolean b0) {
|
||||
this.enabled = b0;
|
||||
this.repaint();
|
||||
this.repaintOnlyThisPanel();
|
||||
}
|
||||
|
||||
/** @return {@link java.lang.Boolean} */
|
||||
@@ -59,6 +60,12 @@ public class SubTab extends JPanel {
|
||||
return this.enabled;
|
||||
}
|
||||
|
||||
/** Prevent panel from repainting the whole screen. */
|
||||
public void repaintOnlyThisPanel() {
|
||||
final Dimension d = SubTab.this.getSize();
|
||||
repaint(0, 0, d.width, d.height);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintComponent(Graphics g) {
|
||||
super.paintComponent(g);
|
||||
|
||||
Reference in New Issue
Block a user