Gestion de la désactivation des boutons de projet + curseur grille
This commit is contained in:
@@ -7,6 +7,14 @@ import java.awt.*;
|
||||
* @author V.BOULANGER
|
||||
*/
|
||||
public class AppThinkerStatusbar extends JPanel {
|
||||
|
||||
private JLabel _statusLabel;
|
||||
private JLabel _posXLabel;
|
||||
private JLabel _posYLabel;
|
||||
private JLabel _sizeXLabel;
|
||||
private JLabel _sizeYLabel;
|
||||
private JLabel _fileLabel;
|
||||
|
||||
/**
|
||||
* Constructeur de la classe AppThinkerStatusbar
|
||||
*/
|
||||
@@ -15,39 +23,94 @@ public class AppThinkerStatusbar extends JPanel {
|
||||
this.setBorder(new BevelBorder(BevelBorder.LOWERED));
|
||||
this.setLayout(new GridLayout(1,3));
|
||||
|
||||
JLabel statusLabel = new JLabel("Prêt");
|
||||
this.add(statusLabel);
|
||||
_statusLabel = new JLabel("Prêt.");
|
||||
this.add(_statusLabel);
|
||||
|
||||
JPanel actionBar = new JPanel();
|
||||
|
||||
JLabel posXLabel = new JLabel("PX : 0 | ");
|
||||
actionBar.add(posXLabel);
|
||||
JLabel posYLabel = new JLabel("PY : 0 | ");
|
||||
actionBar.add(posYLabel);
|
||||
JLabel sizeXLabel = new JLabel("SX : 0 | ");
|
||||
actionBar.add(sizeXLabel);
|
||||
JLabel sizeYLabel = new JLabel("SY : 0");
|
||||
actionBar.add(sizeYLabel);
|
||||
JButton editActionBtn = new JButton();
|
||||
editActionBtn.setIcon(new ImageIcon(getClass().getResource("img/x16/edit.png")));
|
||||
editActionBtn.setToolTipText("Éditer l'élément sélectionné.");
|
||||
editActionBtn.setOpaque(false);
|
||||
editActionBtn.setContentAreaFilled(false);
|
||||
editActionBtn.setBorderPainted(false);
|
||||
actionBar.add(editActionBtn);
|
||||
JButton deleteActionBtn = new JButton();
|
||||
deleteActionBtn.setIcon(new ImageIcon(getClass().getResource("img/x16/delete.png")));
|
||||
deleteActionBtn.setToolTipText("Supprimer l'élément sélectionné.");
|
||||
deleteActionBtn.setOpaque(false);
|
||||
deleteActionBtn.setContentAreaFilled(false);
|
||||
deleteActionBtn.setBorderPainted(false);
|
||||
actionBar.add(deleteActionBtn);
|
||||
|
||||
_posXLabel = new JLabel("PX : 0 |");
|
||||
actionBar.add(_posXLabel);
|
||||
_posYLabel = new JLabel("PY : 0 |");
|
||||
actionBar.add(_posYLabel);
|
||||
_sizeXLabel = new JLabel("SX : 0 |");
|
||||
actionBar.add(_sizeXLabel);
|
||||
_sizeYLabel = new JLabel("SY : 0");
|
||||
actionBar.add(_sizeYLabel);
|
||||
|
||||
this.add(actionBar);
|
||||
|
||||
JLabel fileLabel = new JLabel("Aucun projet ouvert");
|
||||
fileLabel.setHorizontalAlignment(JLabel.RIGHT);
|
||||
this.add(fileLabel);
|
||||
_fileLabel = new JLabel("Aucun projet ouvert");
|
||||
_fileLabel.setHorizontalAlignment(JLabel.RIGHT);
|
||||
this.add(_fileLabel);
|
||||
}
|
||||
|
||||
/**
|
||||
* Met à jour le texte de statut de la barre de statut.
|
||||
* @param msg Le message à afficher.
|
||||
*/
|
||||
public void setStatusMessage(String msg){
|
||||
this._statusLabel.setText(msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* Met à jour le nom du fichier dans la barre de statut.
|
||||
* @param file Le nom du fichier à afficher.
|
||||
*/
|
||||
public void setFileMessage(String file){
|
||||
this._fileLabel.setText(file);
|
||||
}
|
||||
|
||||
/**
|
||||
* Met à jour le label de position X.
|
||||
* @param posX La position X.
|
||||
*/
|
||||
public void setPosXLabel(int posX){
|
||||
this._posXLabel.setText(Integer.toString(posX));
|
||||
}
|
||||
|
||||
/**
|
||||
* Met à jour le label de position Y.
|
||||
* @param posY La position Y.
|
||||
*/
|
||||
public void setPosYLabel(int posY){
|
||||
this._posYLabel.setText(Integer.toString(posY));
|
||||
}
|
||||
|
||||
/**
|
||||
* Met à jour les labels de position.
|
||||
* @param posX La position X.
|
||||
* @param posY La position Y.
|
||||
*/
|
||||
public void setPosLabel(int posX, int posY){
|
||||
this._posXLabel.setText(Integer.toString(posX));
|
||||
this._posYLabel.setText(Integer.toString(posY));
|
||||
}
|
||||
|
||||
/**
|
||||
* Met à jour le label de taille X.
|
||||
* @param sizeX La taille X.
|
||||
*/
|
||||
public void setSizeXLabel(int sizeX){
|
||||
this._sizeXLabel.setText(Integer.toString(sizeX));
|
||||
}
|
||||
|
||||
/**
|
||||
* Met à jour le label de taille Y.
|
||||
* @param sizeY La taille Y.
|
||||
*/
|
||||
public void setSizeYLabel(int sizeY){
|
||||
this._sizeYLabel.setText(Integer.toString(sizeY));
|
||||
}
|
||||
|
||||
/**
|
||||
* Met à jour les labels de taille.
|
||||
* @param sizeX La taille X.
|
||||
* @param sizeY La taille Y.
|
||||
*/
|
||||
public void setSizeLabel(int sizeX, int sizeY){
|
||||
this._sizeXLabel.setText(Integer.toString(sizeX));
|
||||
this._sizeYLabel.setText(Integer.toString(sizeY));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user