merged UI changes
commit
1e0d7561b2
|
@ -128,7 +128,7 @@ public class MagicCondensedCardDefinition {
|
|||
public static final Comparator<MagicCondensedCardDefinition> TOUGHNESS_COMPARATOR_ASC=new Comparator<MagicCondensedCardDefinition>() {
|
||||
@Override
|
||||
public int compare(final MagicCondensedCardDefinition cardDefinition1,final MagicCondensedCardDefinition cardDefinition2) {
|
||||
return MagicCardDefinition.POWER_COMPARATOR_ASC.compare(cardDefinition1.getCard(), cardDefinition2.getCard());
|
||||
return MagicCardDefinition.TOUGHNESS_COMPARATOR_ASC.compare(cardDefinition1.getCard(), cardDefinition2.getCard());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package magic.ui;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.MouseAdapter;
|
||||
|
@ -11,6 +10,7 @@ import javax.swing.JPanel;
|
|||
import javax.swing.KeyStroke;
|
||||
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
import magic.ui.widget.FontsAndBorders;
|
||||
import magic.ui.widget.MenuButton;
|
||||
import magic.ui.widget.MenuPanel;
|
||||
import magic.ui.widget.TexturedPanel;
|
||||
|
@ -18,16 +18,13 @@ import magic.ui.widget.TexturedPanel;
|
|||
@SuppressWarnings("serial")
|
||||
public class CardExplorerScreenOptions extends TexturedPanel implements IMenuOverlay {
|
||||
|
||||
private static Color BACKGROUND_COLOR = new Color(0, 0, 0, 150);
|
||||
private static Color MENUPANEL_COLOR = new Color(0, 0, 0, 230);
|
||||
|
||||
private final MagicFrame frame;
|
||||
|
||||
public CardExplorerScreenOptions(final MagicFrame frame0) {
|
||||
|
||||
this.frame = frame0;
|
||||
|
||||
setBackground(BACKGROUND_COLOR);
|
||||
setBackground(FontsAndBorders.IMENUOVERLAY_BACKGROUND_COLOR);
|
||||
setLayout(new MigLayout("insets 0, gap 10, flowx, center, center"));
|
||||
add(getGeneralMenu());
|
||||
|
||||
|
@ -57,7 +54,7 @@ public class CardExplorerScreenOptions extends TexturedPanel implements IMenuOve
|
|||
}
|
||||
}));
|
||||
menuPanel.refreshLayout();
|
||||
menuPanel.setBackground(MENUPANEL_COLOR);
|
||||
menuPanel.setBackground(FontsAndBorders.IMENUOVERLAY_MENUPANEL_COLOR);
|
||||
return menuPanel;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package magic.ui;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.MouseAdapter;
|
||||
|
@ -11,15 +10,13 @@ import javax.swing.JPanel;
|
|||
import javax.swing.KeyStroke;
|
||||
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
import magic.ui.widget.FontsAndBorders;
|
||||
import magic.ui.widget.MenuPanel;
|
||||
import magic.ui.widget.TexturedPanel;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class DeckEditorScreenOptions extends TexturedPanel implements IMenuOverlay {
|
||||
|
||||
private static Color BACKGROUND_COLOR = new Color(0, 0, 0, 150);
|
||||
private static Color MENUPANEL_COLOR = new Color(0, 0, 0, 230);
|
||||
|
||||
private final MagicFrame frame;
|
||||
private final DeckEditorScreen screen;
|
||||
|
||||
|
@ -28,7 +25,7 @@ public class DeckEditorScreenOptions extends TexturedPanel implements IMenuOverl
|
|||
this.frame = frame0;
|
||||
this.screen = screen0;
|
||||
|
||||
setBackground(BACKGROUND_COLOR);
|
||||
setBackground(FontsAndBorders.IMENUOVERLAY_BACKGROUND_COLOR);
|
||||
setLayout(new MigLayout("insets 0, gap 10, flowx, center, center"));
|
||||
add(getScreenMenu());
|
||||
add(getGeneralMenu());
|
||||
|
@ -51,7 +48,7 @@ public class DeckEditorScreenOptions extends TexturedPanel implements IMenuOverl
|
|||
|
||||
private MenuPanel getGeneralMenu() {
|
||||
final MenuPanel menuPanel = new GeneralMenuPanel(frame, this);
|
||||
menuPanel.setBackground(MENUPANEL_COLOR);
|
||||
menuPanel.setBackground(FontsAndBorders.IMENUOVERLAY_MENUPANEL_COLOR);
|
||||
return menuPanel;
|
||||
}
|
||||
|
||||
|
@ -97,7 +94,7 @@ public class DeckEditorScreenOptions extends TexturedPanel implements IMenuOverl
|
|||
});
|
||||
|
||||
menu.refreshLayout();
|
||||
menu.setBackground(MENUPANEL_COLOR);
|
||||
menu.setBackground(FontsAndBorders.IMENUOVERLAY_MENUPANEL_COLOR);
|
||||
return menu;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package magic.ui;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.MouseAdapter;
|
||||
|
@ -11,15 +10,13 @@ import javax.swing.JPanel;
|
|||
import javax.swing.KeyStroke;
|
||||
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
import magic.ui.widget.FontsAndBorders;
|
||||
import magic.ui.widget.MenuPanel;
|
||||
import magic.ui.widget.TexturedPanel;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class DuelDecksScreenOptions extends TexturedPanel implements IMenuOverlay {
|
||||
|
||||
private static Color BACKGROUND_COLOR = new Color(0, 0, 0, 150);
|
||||
private static Color MENUPANEL_COLOR = new Color(0, 0, 0, 230);
|
||||
|
||||
private final MagicFrame frame;
|
||||
private final DuelDecksScreen screen;
|
||||
|
||||
|
@ -28,7 +25,7 @@ public class DuelDecksScreenOptions extends TexturedPanel implements IMenuOverla
|
|||
this.frame = frame0;
|
||||
this.screen = screen0;
|
||||
|
||||
setBackground(BACKGROUND_COLOR);
|
||||
setBackground(FontsAndBorders.IMENUOVERLAY_BACKGROUND_COLOR);
|
||||
setLayout(new MigLayout("insets 0, gap 10, flowx, center, center"));
|
||||
add(getScreenMenu());
|
||||
add(getGeneralMenu());
|
||||
|
@ -51,7 +48,7 @@ public class DuelDecksScreenOptions extends TexturedPanel implements IMenuOverla
|
|||
|
||||
private MenuPanel getGeneralMenu() {
|
||||
final MenuPanel menuPanel = new GeneralMenuPanel(frame, this);
|
||||
menuPanel.setBackground(MENUPANEL_COLOR);
|
||||
menuPanel.setBackground(FontsAndBorders.IMENUOVERLAY_MENUPANEL_COLOR);
|
||||
return menuPanel;
|
||||
}
|
||||
|
||||
|
@ -90,7 +87,7 @@ public class DuelDecksScreenOptions extends TexturedPanel implements IMenuOverla
|
|||
});
|
||||
|
||||
menu.refreshLayout();
|
||||
menu.setBackground(MENUPANEL_COLOR);
|
||||
menu.setBackground(FontsAndBorders.IMENUOVERLAY_MENUPANEL_COLOR);
|
||||
return menu;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,14 +1,12 @@
|
|||
package magic.ui;
|
||||
|
||||
import magic.data.IconImages;
|
||||
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JDialog;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JPanel;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.FlowLayout;
|
||||
import java.awt.event.ActionEvent;
|
||||
|
@ -48,7 +46,7 @@ public class DuelDialog extends JDialog implements ActionListener {
|
|||
buttonPanel.add(cancelButton);
|
||||
|
||||
duelSetupPanel = new DuelSetupPanel(frame);
|
||||
duelSetupPanel.setBackground(new Color(255, 255, 255, 0));
|
||||
duelSetupPanel.setOpaque(false);
|
||||
|
||||
getContentPane().setLayout(new BorderLayout());
|
||||
getContentPane().add(duelSetupPanel,BorderLayout.CENTER);
|
||||
|
|
|
@ -25,7 +25,6 @@ import javax.swing.JTabbedPane;
|
|||
import javax.swing.ScrollPaneConstants;
|
||||
import javax.swing.SpringLayout;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import java.awt.Container;
|
||||
import java.awt.event.ActionEvent;
|
||||
|
@ -55,7 +54,7 @@ public class DuelPanel extends TexturedPanel {
|
|||
this.frame=frame;
|
||||
this.duel=duel;
|
||||
|
||||
setBackground(new Color(255, 255, 255, 60));
|
||||
setBackground(FontsAndBorders.MAGSCREEN_FADE_COLOR);
|
||||
final SpringLayout springLayout = new SpringLayout();
|
||||
setLayout(springLayout);
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package magic.ui;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.MouseAdapter;
|
||||
|
@ -12,15 +11,13 @@ import javax.swing.KeyStroke;
|
|||
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
import magic.data.GeneralConfig;
|
||||
import magic.ui.widget.FontsAndBorders;
|
||||
import magic.ui.widget.MenuPanel;
|
||||
import magic.ui.widget.TexturedPanel;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class DuelScreenOptions extends TexturedPanel implements IMenuOverlay {
|
||||
|
||||
private static Color BACKGROUND_COLOR = new Color(0, 0, 0, 150);
|
||||
private static Color MENUPANEL_COLOR = new Color(0, 0, 0, 230);
|
||||
|
||||
private final MagicFrame frame;
|
||||
private final DuelScreen screen;
|
||||
|
||||
|
@ -29,7 +26,7 @@ public class DuelScreenOptions extends TexturedPanel implements IMenuOverlay {
|
|||
this.frame = frame0;
|
||||
this.screen = screen0;
|
||||
|
||||
setBackground(BACKGROUND_COLOR);
|
||||
setBackground(FontsAndBorders.IMENUOVERLAY_BACKGROUND_COLOR);
|
||||
setLayout(new MigLayout("insets 0, gap 10, flowx, center, center"));
|
||||
add(getScreenMenu());
|
||||
add(getGeneralMenu());
|
||||
|
@ -52,7 +49,7 @@ public class DuelScreenOptions extends TexturedPanel implements IMenuOverlay {
|
|||
|
||||
private MenuPanel getGeneralMenu() {
|
||||
final MenuPanel menuPanel = new GeneralMenuPanel(frame, this);
|
||||
menuPanel.setBackground(MENUPANEL_COLOR);
|
||||
menuPanel.setBackground(FontsAndBorders.IMENUOVERLAY_MENUPANEL_COLOR);
|
||||
return menuPanel;
|
||||
}
|
||||
|
||||
|
@ -92,7 +89,7 @@ public class DuelScreenOptions extends TexturedPanel implements IMenuOverlay {
|
|||
});
|
||||
|
||||
menu.refreshLayout();
|
||||
menu.setBackground(MENUPANEL_COLOR);
|
||||
menu.setBackground(FontsAndBorders.IMENUOVERLAY_MENUPANEL_COLOR);
|
||||
return menu;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,6 @@ import javax.swing.JTable;
|
|||
import javax.swing.ScrollPaneConstants;
|
||||
import javax.swing.SpringLayout;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Container;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
|
@ -72,7 +71,7 @@ public class ExplorerPanel extends TexturedPanel implements ActionListener {
|
|||
this.frame=frame;
|
||||
this.player=player;
|
||||
|
||||
setBackground(new Color(255, 255, 255, 60));
|
||||
setBackground(FontsAndBorders.MAGSCREEN_FADE_COLOR);
|
||||
|
||||
final SpringLayout springLayout = new SpringLayout();
|
||||
setLayout(springLayout);
|
||||
|
|
|
@ -23,13 +23,14 @@ import magic.ui.viewer.PlayerViewer;
|
|||
import magic.ui.viewer.StackCombatViewer;
|
||||
import magic.ui.viewer.StackViewer;
|
||||
import magic.ui.viewer.ViewerInfo;
|
||||
import magic.ui.widget.FontsAndBorders;
|
||||
import magic.ui.widget.ZoneBackgroundLabel;
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
|
||||
import javax.swing.AbstractAction;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.KeyStroke;
|
||||
import java.awt.Color;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.InputEvent;
|
||||
|
@ -45,7 +46,6 @@ public final class GamePanel extends JPanel {
|
|||
private static final String SWITCH_KEY="switch";
|
||||
private static final String PASS_KEY="pass";
|
||||
private static final Theme theme = ThemeFactory.getInstance().getCurrentTheme();
|
||||
private static final Color translucentPanelColor = new Color(255, 255, 255, 200);
|
||||
|
||||
private final MagicFrame frame;
|
||||
private final MagicGame game;
|
||||
|
@ -118,7 +118,7 @@ public final class GamePanel extends JPanel {
|
|||
opponentViewer=new PlayerViewer(viewerInfo,controller,true);
|
||||
|
||||
gameDuelViewer=new GameDuelViewer(game,controller);
|
||||
gameDuelViewer.setBackground(translucentPanelColor);
|
||||
gameDuelViewer.setBackground(FontsAndBorders.TRANSLUCENT_WHITE_STRONG);
|
||||
|
||||
controller.setGameViewer(gameDuelViewer.getGameViewer());
|
||||
|
||||
|
@ -131,7 +131,7 @@ public final class GamePanel extends JPanel {
|
|||
opponentPermanentViewer=new BattlefieldViewer(viewerInfo,controller,true);
|
||||
imageStackViewer=new StackViewer(viewerInfo,controller,true);
|
||||
logStackViewer = new LogStackViewer(logBookViewer, imageStackViewer);
|
||||
logStackViewer.setBackground(translucentPanelColor);
|
||||
logStackViewer.setBackground(FontsAndBorders.TRANSLUCENT_WHITE_STRONG);
|
||||
|
||||
imageHandGraveyardViewer=new ImageHandGraveyardExileViewer(viewerInfo,controller);
|
||||
imagePlayerPermanentViewer=new ImageBattlefieldViewer(viewerInfo,controller,false);
|
||||
|
|
|
@ -39,7 +39,7 @@ public class KeywordsScreen extends MagScreen implements IMagStatusBar, IMagActi
|
|||
|
||||
private static JPanel getScreenContent(final MagicFrame frame0) {
|
||||
final JPanel content = new TexturedPanel();
|
||||
content.setBackground(new Color(255, 255, 255, 220));
|
||||
content.setBackground(FontsAndBorders.TRANSLUCENT_WHITE_STRONG);
|
||||
content.setLayout(new MigLayout("insets 0, gap 0"));
|
||||
createScrollablePanel();
|
||||
addNewScrollPane(content);
|
||||
|
@ -106,9 +106,7 @@ public class KeywordsScreen extends MagScreen implements IMagStatusBar, IMagActi
|
|||
keywordPanel.add(nameLabel, "w 100%");
|
||||
|
||||
final JTextArea descriptionLabel = new JTextArea(keywordDefinition.description.replace("<br>", " "));
|
||||
descriptionLabel.setOpaque(false);
|
||||
// Nimbus LAF opaque bug workaround (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6687960).
|
||||
descriptionLabel.setBackground(new Color(0,0,0,0));
|
||||
descriptionLabel.setBackground(FontsAndBorders.TEXTAREA_TRANSPARENT_COLOR_HACK);
|
||||
descriptionLabel.setBorder(null);
|
||||
descriptionLabel.setLineWrap(true);
|
||||
descriptionLabel.setWrapStyleWord(true);
|
||||
|
|
|
@ -1,52 +0,0 @@
|
|||
package magic.ui;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseMotionAdapter;
|
||||
|
||||
import javax.swing.AbstractAction;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.KeyStroke;
|
||||
|
||||
import magic.ui.widget.TexturedPanel;
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
|
||||
@SuppressWarnings("serial")
|
||||
public class MagicHelpMenuOverlay extends TexturedPanel implements IMagicHelpOverlay {
|
||||
|
||||
public MagicHelpMenuOverlay(final MagicFrame frame0) {
|
||||
|
||||
setLayout(new MigLayout("insets 0, gap 0, flowy, center, center"));
|
||||
setBackground(new Color(0,0,0,150));
|
||||
|
||||
addMouseListener(new MouseAdapter() {});
|
||||
addMouseMotionListener(new MouseMotionAdapter() {});
|
||||
|
||||
getInputMap(JPanel.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("ESCAPE"), "closeMenu");
|
||||
getInputMap(JPanel.WHEN_IN_FOCUSED_WINDOW).put(KeyStroke.getKeyStroke("F1"), "closeMenu");
|
||||
getActionMap().put("closeMenu", new AbstractAction() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
setVisible(false);
|
||||
}
|
||||
});
|
||||
|
||||
final MagicHelpMenu optionsPanel = new MagicHelpMenu(frame0, this, true);
|
||||
optionsPanel.setBackground(new Color(0, 0, 0, 240));
|
||||
add(optionsPanel);
|
||||
|
||||
frame0.setGlassPane(this);
|
||||
setVisible(true);
|
||||
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see magic.ui.IMagicHelpOverlay#actionPerformed()
|
||||
*/
|
||||
@Override
|
||||
public void actionPerformed() {
|
||||
setVisible(false);
|
||||
}
|
||||
|
||||
}
|
|
@ -12,7 +12,6 @@ import javax.swing.JScrollPane;
|
|||
import javax.swing.JTextArea;
|
||||
import javax.swing.SwingUtilities;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -33,11 +32,11 @@ public class ReadmeScreen extends MagScreen implements IMagStatusBar, IMagAction
|
|||
|
||||
final JPanel content = new TexturedPanel();
|
||||
|
||||
content.setBackground(new Color(255, 255, 255, 60));
|
||||
content.setBackground(FontsAndBorders.TRANSLUCENT_WHITE_STRONG);
|
||||
content.setLayout(new MigLayout("insets 0, gap 0, center"));
|
||||
|
||||
final JTextArea readMeTextArea = new JTextArea();
|
||||
readMeTextArea.setBackground(new Color(255, 255, 255, 220));
|
||||
readMeTextArea.setBackground(FontsAndBorders.TEXTAREA_TRANSPARENT_COLOR_HACK);
|
||||
readMeTextArea.setEditable(false);
|
||||
readMeTextArea.setFont(FontsAndBorders.FONT_README);
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ import java.awt.GridLayout;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class DeckStatisticsViewer extends JPanel implements ChangeListener {
|
||||
public class DeckStatisticsViewer extends TexturedPanel implements ChangeListener {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
|
@ -35,19 +35,22 @@ public class DeckStatisticsViewer extends JPanel implements ChangeListener {
|
|||
private final Color textColor;
|
||||
|
||||
public DeckStatisticsViewer() {
|
||||
|
||||
textColor=ThemeFactory.getInstance().getCurrentTheme().getTextColor();
|
||||
|
||||
setPreferredSize(PREFERRED_SIZE);
|
||||
setBorder(FontsAndBorders.UP_BORDER);
|
||||
setBackground(FontsAndBorders.TRANSLUCENT_WHITE_STRONG);
|
||||
|
||||
setLayout(new BorderLayout());
|
||||
|
||||
titleBar=new TitleBar("Deck Statistics");
|
||||
add(titleBar,BorderLayout.NORTH);
|
||||
|
||||
final JPanel mainPanel=new TexturedPanel();
|
||||
final JPanel mainPanel = new JPanel();
|
||||
mainPanel.setLayout(new BorderLayout());
|
||||
mainPanel.setBorder(FontsAndBorders.BLACK_BORDER_2);
|
||||
mainPanel.setOpaque(false);
|
||||
add(mainPanel,BorderLayout.CENTER);
|
||||
|
||||
topPanel=new JPanel(new FlowLayout(FlowLayout.LEFT,10,5));
|
||||
|
|
|
@ -9,8 +9,8 @@ import magic.ui.widget.TitleBar;
|
|||
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JTextArea;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
import java.awt.Dimension;
|
||||
|
||||
public class HistoryViewer extends JPanel{
|
||||
|
@ -62,9 +62,7 @@ public class HistoryViewer extends JPanel{
|
|||
final JTextArea textArea = new JTextArea(8, 170);
|
||||
textArea.setEditable(false);
|
||||
textArea.setFocusable(false);
|
||||
// set background to get transparent effect
|
||||
// must be done this way because of use of TexturedPanel()
|
||||
textArea.setBackground(new Color(255, 255, 255, 0));
|
||||
textArea.setBackground(FontsAndBorders.TEXTAREA_TRANSPARENT_COLOR_HACK);
|
||||
textArea.setForeground(ThemeFactory.getInstance().getCurrentTheme().getTextColor());
|
||||
textArea.setTabSize(16);
|
||||
textArea.setText("Games played:\t" + gamesPlayed +
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package magic.ui.viewer;
|
||||
|
||||
import magic.data.GeneralConfig;
|
||||
import magic.data.IconImages;
|
||||
import magic.model.MagicLogBook;
|
||||
import magic.model.MagicMessage;
|
||||
import magic.ui.widget.FontsAndBorders;
|
||||
|
@ -10,25 +8,15 @@ import magic.ui.widget.TitleBar;
|
|||
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.BoxLayout;
|
||||
import javax.swing.JCheckBoxMenuItem;
|
||||
import javax.swing.JLabel;
|
||||
import javax.swing.JMenuItem;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JPopupMenu;
|
||||
import javax.swing.JScrollBar;
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.border.CompoundBorder;
|
||||
import javax.swing.event.MouseInputAdapter;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.Color;
|
||||
import java.awt.Cursor;
|
||||
import java.awt.Insets;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.awt.event.ComponentAdapter;
|
||||
import java.awt.event.ComponentEvent;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.util.ListIterator;
|
||||
|
||||
public class LogBookViewer extends JPanel {
|
||||
|
@ -45,9 +33,8 @@ public class LogBookViewer extends JPanel {
|
|||
private final MagicLogBook logBook;
|
||||
private final JPanel messagePanel;
|
||||
private final JScrollPane scrollPane;
|
||||
private final GeneralConfig config = GeneralConfig.getInstance();
|
||||
private boolean isScrollbarVisible = false; //config.isLogScrollbarVisible();
|
||||
private boolean isNewMessageAddedToTop = false; // config.isLogMessageAddedToTop();
|
||||
private boolean isScrollbarVisible = false;
|
||||
private boolean isNewMessageAddedToTop = false;
|
||||
|
||||
public LogBookViewer(final MagicLogBook logBook) {
|
||||
|
||||
|
@ -57,7 +44,6 @@ public class LogBookViewer extends JPanel {
|
|||
|
||||
TitleBar tb = new TitleBar("Log");
|
||||
tb.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Color.BLACK));
|
||||
//tb.add(getOptionsButton(), BorderLayout.EAST);
|
||||
add(tb, BorderLayout.NORTH);
|
||||
|
||||
final JPanel centerPanel=new JPanel();
|
||||
|
@ -91,7 +77,6 @@ public class LogBookViewer extends JPanel {
|
|||
|
||||
}
|
||||
|
||||
|
||||
public MagicLogBook getLogBook() {
|
||||
return logBook;
|
||||
}
|
||||
|
@ -137,57 +122,6 @@ public class LogBookViewer extends JPanel {
|
|||
return panel;
|
||||
}
|
||||
|
||||
private JLabel getOptionsButton() {
|
||||
JLabel lbl = new JLabel(IconImages.PROGRESS);
|
||||
lbl.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
|
||||
lbl.addMouseListener(new MouseInputAdapter() {
|
||||
@Override
|
||||
public void mouseClicked(MouseEvent e) {
|
||||
doPopup(e);
|
||||
}
|
||||
private void doPopup(MouseEvent e){
|
||||
JPopupMenu menu = getOptionsPopupMenu();
|
||||
menu.show(e.getComponent(), e.getX(), e.getY());
|
||||
}
|
||||
});
|
||||
return lbl;
|
||||
}
|
||||
|
||||
private JPopupMenu getOptionsPopupMenu() {
|
||||
JPopupMenu menu = new JPopupMenu();
|
||||
menu.add(getMenuItem_ScrollbarVisibility());
|
||||
menu.add(getMenuItem_TopInsert());
|
||||
return menu;
|
||||
}
|
||||
|
||||
private JMenuItem getMenuItem_TopInsert() {
|
||||
JCheckBoxMenuItem item = new JCheckBoxMenuItem("Add new message to top", isNewMessageAddedToTop);
|
||||
item.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
isNewMessageAddedToTop = !isNewMessageAddedToTop;
|
||||
update();
|
||||
config.setLogMessageAddedToTop(isNewMessageAddedToTop);
|
||||
config.save();
|
||||
}
|
||||
});
|
||||
return item;
|
||||
}
|
||||
|
||||
private JCheckBoxMenuItem getMenuItem_ScrollbarVisibility() {
|
||||
JCheckBoxMenuItem item = new JCheckBoxMenuItem("Show scroll-bar", isScrollbarVisible);
|
||||
item.addActionListener(new ActionListener() {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
isScrollbarVisible = !isScrollbarVisible;
|
||||
setVerticalScrollbarPolicy();
|
||||
config.setLogScrollbarVisible(isScrollbarVisible);
|
||||
config.save();
|
||||
}
|
||||
});
|
||||
return item;
|
||||
}
|
||||
|
||||
private void setVerticalScrollbarPolicy() {
|
||||
scrollPane.setVerticalScrollBarPolicy(getVerticalScrollbarPolicy());
|
||||
}
|
||||
|
|
|
@ -7,6 +7,17 @@ import java.awt.Font;
|
|||
|
||||
public class FontsAndBorders {
|
||||
|
||||
// Calling JTextArea.setOpaque(false) does not work with Nimbus LAF. This is a workaround.
|
||||
// (http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6687960).
|
||||
public static final Color TEXTAREA_TRANSPARENT_COLOR_HACK = new Color(255, 255, 255, 0);
|
||||
|
||||
public static final Color MAGSCREEN_FADE_COLOR = new Color(255, 255, 255, 60);
|
||||
public static final Color TRANSLUCENT_WHITE_STRONG = new Color(255, 255, 255, 220);
|
||||
public static final Color MAGSCREEN_BAR_COLOR = new Color(0, 0, 0, 220);
|
||||
public static final Color MENUPANEL_COLOR = new Color(0, 0, 0, 200);
|
||||
public static final Color IMENUOVERLAY_BACKGROUND_COLOR = new Color(0, 0, 0, 150);
|
||||
public static final Color IMENUOVERLAY_MENUPANEL_COLOR = new Color(0, 0, 0, 230);
|
||||
|
||||
public static final Color GRAY1=new Color(200,200,200);
|
||||
public static final Color GRAY2=new Color(210,210,210);
|
||||
public static final Color GRAY3=new Color(220,220,220);
|
||||
|
|
|
@ -14,14 +14,12 @@ import net.miginfocom.swing.MigLayout;
|
|||
@SuppressWarnings("serial")
|
||||
public class MagActionBar extends TexturedPanel {
|
||||
|
||||
private final static Color TRANSLUCENT_COLOR = new Color(0, 0, 0, 220);
|
||||
|
||||
private IMagActionBar actionProvider;
|
||||
|
||||
public MagActionBar(final IMagActionBar provider0) {
|
||||
actionProvider = provider0;
|
||||
setMinimumSize(new Dimension(getPreferredSize().width, 50));
|
||||
setBackground(TRANSLUCENT_COLOR);
|
||||
setBackground(FontsAndBorders.MAGSCREEN_BAR_COLOR);
|
||||
setMagActionBarLayout();
|
||||
}
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package magic.ui.widget;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Cursor;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.event.ActionEvent;
|
||||
|
@ -20,7 +19,6 @@ import magic.ui.MagicFrame;
|
|||
@SuppressWarnings("serial")
|
||||
public class MagStatusBar extends TexturedPanel {
|
||||
|
||||
private final static Color TRANSLUCENT_COLOR = new Color(0, 0, 0, 220);
|
||||
private final static ImageIcon optionsIcon = new ImageIcon(IconImages.OPTIONS_ICON);
|
||||
|
||||
private final MagScreen magScreen;
|
||||
|
@ -28,7 +26,7 @@ public class MagStatusBar extends TexturedPanel {
|
|||
public MagStatusBar(final MagScreen screen0, final MagicFrame frame0) {
|
||||
this.magScreen = screen0;
|
||||
setMinimumSize(new Dimension(getPreferredSize().width, 50));
|
||||
setBackground(TRANSLUCENT_COLOR);
|
||||
setBackground(FontsAndBorders.MAGSCREEN_BAR_COLOR);
|
||||
layoutMagStatusBar();
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ public class MenuPanel extends TexturedPanel {
|
|||
setMaximumSize(new Dimension(300, 380));
|
||||
|
||||
setBorder(FontsAndBorders.BLACK_BORDER);
|
||||
setBackground(new Color(0, 0, 0, 200));
|
||||
setBackground(FontsAndBorders.MENUPANEL_COLOR);
|
||||
|
||||
setMenuPanelLayout();
|
||||
|
||||
|
|
Loading…
Reference in New Issue