[refactoring][minor] Replaced all tabs with four spaces.

This commit is contained in:
North 2012-06-19 23:50:20 +03:00
parent e646e4768d
commit 239a4fb100
2891 changed files with 79411 additions and 79411 deletions

View file

@ -28,14 +28,14 @@ public class DialogContainer extends JPanel {
private boolean drawContainer = true;
private DialogManager.MTGDialogs dialogType;
public DialogContainer(DialogManager.MTGDialogs dialogType, DlgParams params) {
setOpaque(false);
this.dialogType = dialogType;
setLayout(null);
drawContainer = true;
if (dialogType == DialogManager.MTGDialogs.MessageDialog) {
//backgroundColor = new Color(0, 255, 255, 60);
if (params.type.equals(MessageDlg.Types.Warning)) {
@ -74,10 +74,10 @@ public class DialogContainer extends JPanel {
//backgroundColor = new Color(200, 200, 172, 120);
//backgroundColor = new Color(180, 150, 200, 120);
//backgroundColor = new Color(0, 255, 0, 60);
//latest:
backgroundColor = new Color(139, 46, 173, 20);
//backgroundColor = new Color(139, 46, 173, 0);
//latest:
backgroundColor = new Color(139, 46, 173, 20);
//backgroundColor = new Color(139, 46, 173, 0);
alpha = 0;
ChoiceDialog dlg = new ChoiceDialog(params);
@ -150,12 +150,12 @@ public class DialogContainer extends JPanel {
@Override
protected void paintComponent(Graphics g) {
if (!drawContainer) {
return;
}
int x = X_OFFSET;
if (!drawContainer) {
return;
}
int x = X_OFFSET;
int y = Y_OFFSET;
int w = getWidth() - 2 * X_OFFSET;
int h = getHeight() - 2 * Y_OFFSET;
@ -205,9 +205,9 @@ public class DialogContainer extends JPanel {
public void showDialog(boolean bShow) {
setVisible(bShow);
}
public DialogManager.MTGDialogs getType() {
return this.dialogType;
return this.dialogType;
}
/**

View file

@ -72,11 +72,11 @@ public class DialogManager extends JComponent implements MouseListener,
/*if (h < 200) {
h = 200;
}*/
if (w > 800) {
w = 800;
w = 800;
}
int height = getHeight();
int width = getWidth();
@ -101,7 +101,7 @@ public class DialogManager extends JComponent implements MouseListener,
setVisible(true);
}
public void setDlgBounds(Rectangle r) {
if (currentDialog == MTGDialogs.DialogContainer) {
dialogContainer.setBounds(r.x, r.y, r.width, r.height);
@ -109,7 +109,7 @@ public class DialogManager extends JComponent implements MouseListener,
}
public void fadeOut() {
if (dialogContainer != null) {
dialogContainer.showDialog(false);
removeAll();
@ -123,8 +123,8 @@ public class DialogManager extends JComponent implements MouseListener,
}
public void fadeOut(DialogContainer dc) {
//log.debug("start:fadeOut:"+dc.toString());
//log.debug("start:fadeOut:"+dc.toString());
dc.showDialog(false);
remove(dc);
@ -135,7 +135,7 @@ public class DialogManager extends JComponent implements MouseListener,
bFound = true;
}
}
if (!bFound) {
setVisible(false);
}
@ -176,18 +176,18 @@ public class DialogManager extends JComponent implements MouseListener,
public void mouseExited(MouseEvent e) {
}
public void mousePressed(MouseEvent e) {
if (e.getButton() == MouseEvent.BUTTON1) {
j = (JComponent) getComponentAt(e.getX(), e.getY());
public void mousePressed(MouseEvent e) {
if (e.getButton() == MouseEvent.BUTTON1) {
j = (JComponent) getComponentAt(e.getX(), e.getY());
if (j != null && j instanceof DialogContainer) {
rec = j.getBounds();
bDragged = true;
mx = e.getX();
my = e.getY();
}
}
}
if (j != null && j instanceof DialogContainer) {
rec = j.getBounds();
bDragged = true;
mx = e.getX();
my = e.getY();
}
}
}
public void mouseReleased(MouseEvent e) {
bDragged = false;
@ -214,14 +214,14 @@ public class DialogManager extends JComponent implements MouseListener,
j = null;
}
public void mouseWheelMoved(MouseWheelEvent e) {
int notches = e.getWheelRotation();
System.out.println("outx:"+notches);
if (currentDialog != null && currentDialog.equals(MTGDialogs.ChooseCommonDialog)) {
System.out.println("out:"+1);
}
}
public void mouseWheelMoved(MouseWheelEvent e) {
int notches = e.getWheelRotation();
System.out.println("outx:"+notches);
if (currentDialog != null && currentDialog.equals(MTGDialogs.ChooseCommonDialog)) {
System.out.println("out:"+1);
}
}
/**
* Default UID.
*/

View file

@ -22,7 +22,7 @@ public class DlgParams {
public BigCard bigCard;
public FeedbackPanel feedbackPanel;
public UUID gameId;
private int playerID;
private CardsView cards;
@ -30,16 +30,16 @@ public class DlgParams {
//private ArrayList<DeckInfo> deckList;
private ArrayList<Object> objectList;
private String title;
private String title;
private int opponentID;
boolean isOptional = false;
boolean isChooseAbility = false;
boolean isCancelStopsPlaying = true;
boolean isAI = false;
public HashSet<String> manaChoices = new HashSet<String>();
public HashSet<String> manaChoices = new HashSet<String>();
public int getPlayerID() {
return playerID;
}
@ -55,7 +55,7 @@ public class DlgParams {
public void setOpponentID(int opponentID) {
this.opponentID = opponentID;
}
public String getTitle() {
return title;
}
@ -73,7 +73,7 @@ public class DlgParams {
public void setMessage(String message) {
this.message = message;
}
public HashSet<String> getManaChoices() {
return manaChoices;
}
@ -81,7 +81,7 @@ public class DlgParams {
public void setManaChoices(HashSet<String> manaChoices) {
this.manaChoices = manaChoices;
}
public boolean isOptional() {
return isOptional;
}
@ -90,53 +90,53 @@ public class DlgParams {
this.isOptional = isOptional;
}
public boolean isChooseAbility() {
return isChooseAbility;
}
public boolean isChooseAbility() {
return isChooseAbility;
}
public void setChooseAbility(boolean isChooseAbility) {
this.isChooseAbility = isChooseAbility;
}
public void setChooseAbility(boolean isChooseAbility) {
this.isChooseAbility = isChooseAbility;
}
public ArrayList<String> getStringList() {
return stringList;
}
return stringList;
}
public void setStringList(ArrayList<String> stringList) {
this.stringList = stringList;
}
public void setStringList(ArrayList<String> stringList) {
this.stringList = stringList;
}
/*public ArrayList<DeckInfo> getDeckList() {
return deckList;
}
/*public ArrayList<DeckInfo> getDeckList() {
return deckList;
}
public void setDeckList(ArrayList<DeckInfo> deckList) {
this.deckList = deckList;
}*/
public ArrayList<Object> getObjectList() {
return objectList;
}
public void setDeckList(ArrayList<DeckInfo> deckList) {
this.deckList = deckList;
}*/
public void setObjectList(ArrayList<Object> objectList) {
this.objectList = objectList;
}
public ArrayList<Object> getObjectList() {
return objectList;
}
public void setObjectList(ArrayList<Object> objectList) {
this.objectList = objectList;
}
public boolean isAI() {
return isAI;
}
return isAI;
}
public void setAI(boolean isAI) {
this.isAI = isAI;
}
public void setAI(boolean isAI) {
this.isAI = isAI;
}
public boolean isCancelStopsPlaying() {
return isCancelStopsPlaying;
}
return isCancelStopsPlaying;
}
public void setCancelStopsPlaying(boolean isCancelStopsPlaying) {
this.isCancelStopsPlaying = isCancelStopsPlaying;
}
public void setCancelStopsPlaying(boolean isCancelStopsPlaying) {
this.isCancelStopsPlaying = isCancelStopsPlaying;
}
public CardsView getCards() {
return cards;

View file

@ -10,9 +10,9 @@ import java.awt.*;
* @author mw, noxx
*/
abstract public class IDialogPanel extends JXPanel {
private DlgParams params;
public DlgParams getDlgParams() {
return params;
}
@ -25,24 +25,24 @@ abstract public class IDialogPanel extends JXPanel {
super();
this.params = params;
}
protected void updateSize(int newWidth, int newHeight) {
Rectangle r0 = getBounds();
r0.width = newWidth;
r0.height = newHeight;
setBounds(r0);
}
/**
* Make inner component transparent.
*/
protected void makeTransparent() {
setOpaque(false);
for (int i = 0; i < getComponentCount(); i++) {
Component c = getComponent(i);
if (c instanceof AbstractButton && !(c instanceof JButton)) {
@ -52,11 +52,11 @@ abstract public class IDialogPanel extends JXPanel {
}
}
}
protected void makeTransparent(JLayeredPane jLayeredPane) {
setOpaque(false);
for (int i = 0; i < getComponentCount(); i++) {
Component c = jLayeredPane.getComponent(i);
if (c instanceof AbstractButton && !(c instanceof JButton)) {
@ -66,7 +66,7 @@ abstract public class IDialogPanel extends JXPanel {
}
}
}
/**
* Default UID.
*/

View file

@ -34,24 +34,24 @@ public class StackDialog extends IDialogPanel {
private JLayeredPane jLayeredPane;
private FeedbackPanel feedbackPanel;
private class CustomLabel extends JLabel {
@Override
public void paintComponent(Graphics g) {
Graphics2D g2D = (Graphics2D)g;
g2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
@Override
public void paintComponent(Graphics g) {
Graphics2D g2D = (Graphics2D)g;
g2D.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
g2D.setColor(Color.black);
g2D.drawString(getText(), 1, 11);
g2D.setColor(Color.white);
g2D.drawString(getText(), 0, 10);
}
private static final long serialVersionUID = 1L;
g2D.setColor(Color.black);
g2D.drawString(getText(), 1, 11);
g2D.setColor(Color.white);
g2D.drawString(getText(), 0, 10);
}
private static final long serialVersionUID = 1L;
};
/**
* This is the default constructor
*/
@ -69,15 +69,15 @@ public class StackDialog extends IDialogPanel {
*/
private void initialize() {
int w = getDlgParams().rect.width;
int w = getDlgParams().rect.width;
int h = getDlgParams().rect.height;
jLayeredPane = new JLayeredPane();
jLayeredPane = new JLayeredPane();
add(jLayeredPane);
jLayeredPane.setSize(w, h);
jLayeredPane.setVisible(true);
jLayeredPane.setOpaque(false);
jTitle = new CustomLabel();
jTitle.setBounds(new Rectangle(5, 3, w, 16));
jTitle.setFont(new Font("Dialog", Font.BOLD, 14));
@ -90,7 +90,7 @@ public class StackDialog extends IDialogPanel {
this.setLayout(null);
jLayeredPane.setLayout(null);
jLayeredPane.add(jTitle, null);
//jLayeredPane.add(jTitle2, null);
jLayeredPane.add(getJButtonAccept(), null);
@ -98,19 +98,19 @@ public class StackDialog extends IDialogPanel {
makeTransparent(jLayeredPane);
}
private void displayStack(CardsView cards, UUID gameId, BigCard bigCard) {
if (cards == null || cards.size() == 0) {
return;
}
/**
* Display spells and theis targets above them
*/
int dx = (SettingsManager.getInstance().getCardSize().width + 15) * (cards.size() - 1);
int dy = 30;
for (CardView card : cards.values()) {
if (card instanceof StackAbilityView) {
@ -127,7 +127,7 @@ public class StackDialog extends IDialogPanel {
cardImg.setLocation(dx, dy);
jLayeredPane.add(cardImg, JLayeredPane.DEFAULT_LAYER, 1);
dx -= (SettingsManager.getInstance().getCardSize().width + 15);
}
}
@ -138,7 +138,7 @@ public class StackDialog extends IDialogPanel {
}
return cardDimension;
}
private HoverButton getJButtonAccept() {
if (jButtonAccept == null) {
jButtonAccept = new HoverButton("", ImageManagerImpl.getInstance().getDlgAcceptButtonImage(),
@ -149,11 +149,11 @@ public class StackDialog extends IDialogPanel {
int h = getDlgParams().rect.height - 90;
jButtonAccept.setBounds(new Rectangle(w / 2 - 80, h - 50, 60, 60));
//jButtonAccept.setBorder(BorderFactory.createLineBorder(Color.red));
jButtonAccept.setObserver(new Command() {
@Override
public void execute() {
DialogManager.getManager().fadeOut((DialogContainer)getParent());
DialogManager.getManager().fadeOut((DialogContainer)getParent());
//GameManager.getInputControl().getInput().selectButtonOK();
StackDialog.this.feedbackPanel.doClick();
}
@ -172,11 +172,11 @@ public class StackDialog extends IDialogPanel {
int w = getDlgParams().rect.width - 90;
int h = getDlgParams().rect.height - 90;
jButtonResponse.setBounds(new Rectangle(w / 2 + 5, h - 48, 60, 60));
jButtonResponse.setObserver(new Command() {
@Override
public void execute() {
DialogManager.getManager().fadeOut((DialogContainer)getParent());
DialogManager.getManager().fadeOut((DialogContainer)getParent());
}
private static final long serialVersionUID = 1L;
});