|
From: <bma...@us...> - 2011-06-15 13:53:34
|
Revision: 6296
http://fudaa.svn.sourceforge.net/fudaa/?rev=6296&view=rev
Author: bmarchan
Date: 2011-06-15 13:53:25 +0000 (Wed, 15 Jun 2011)
Log Message:
-----------
Pr?\195?\169f?\195?\169rences : Composants enfichables dans un panneau de pr?\195?\169f?\195?\169rence g?\195?\169n?\195?\169rique.
Modified Paths:
--------------
trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuAbstractPreferencesPanel.java
Added Paths:
-----------
trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuAbstractPreferencesComponent.java
trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuContainerPreferencesPanel.java
Added: trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuAbstractPreferencesComponent.java
===================================================================
--- trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuAbstractPreferencesComponent.java (rev 0)
+++ trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuAbstractPreferencesComponent.java 2011-06-15 13:53:25 UTC (rev 6296)
@@ -0,0 +1,101 @@
+package com.memoire.bu;
+
+import com.memoire.fu.FuPreferences;
+import javax.swing.JPanel;
+
+/**
+ * Un composant enfichable dans un panneau de pr\xE9f\xE9rences. Le composant est
+ * ajout\xE9 \xE0 la suite des autres dans le panneau, verticalement.
+ *
+ * @author mar...@de...
+ */
+public abstract class BuAbstractPreferencesComponent extends JPanel {
+ BuContainerPreferencesPanel container_;
+ protected FuPreferences options_;
+
+ boolean isSavabled_=true;
+ boolean dirty_;
+
+ void setContainer(BuContainerPreferencesPanel _container) {
+ container_=_container;
+ }
+
+ /**
+ * @return true : Les pr\xE9f\xE9rences peuvent \xEAtre ecrites. false sinon.
+ */
+ public boolean isPreferencesValidable() { return false; }
+
+ /**
+ * Enregistrement des modifications apportees dans ce panel.
+ */
+ public void validatePreferences() {
+ updateProperties();
+ options_.writeIniFile();
+ setModified(false);
+ }
+
+ /**
+ * @return true : Les pr\xE9f\xE9rences peuvent \xEAtre appliqu\xE9es sans sortie du dialogue.
+ * false sinon.
+ */
+ public boolean isPreferencesApplyable() { return false; }
+
+ /**
+ * A surcharger si les pr\xE9f\xE9rences peuvent \xEAtre appliqu\xE9es.
+ */
+ public void applyPreferences() { }
+
+ /**
+ * @return true : Les pr\xE9f\xE9rences peuvent \xEAtre annul\xE9es.
+ * false sinon.
+ */
+ public boolean isPreferencesCancelable() { return false; }
+
+ /**
+ * Annuler les modifications (relit les preferences).
+ */
+ public void cancelPreferences() {
+ options_.readIniFile();
+ updateComponent();
+ setModified(false);
+ }
+
+ /**
+ * Le titre du composant
+ */
+ public abstract String getTitle();
+
+ /**
+ * Met a jour le composant \xE0 partir des propri\xE9t\xE9s
+ */
+ protected abstract void updateComponent();
+
+ /**
+ * Met a jour les propri\xE9t\xE9s \xE0 partir du composant.
+ */
+ protected abstract void updateProperties();
+
+ /**
+ * @return True : Le composant est modifi\xE9.
+ */
+ protected boolean isModified() {
+ return dirty_;
+ }
+
+ protected void setModified(boolean _b) {
+ dirty_=_b;
+ container_.firePropertyChange();
+ }
+
+ /**
+ * @return True : Le composant est sauvable, autrement dit les valeurs donn\xE9es sont correctes.
+ */
+ protected boolean isSavabled() {
+ return isSavabled_;
+ }
+
+ protected void setSavabled(boolean _b) {
+ isSavabled_=_b;
+ container_.firePropertyChange();
+ }
+}
Property changes on: trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuAbstractPreferencesComponent.java
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
Modified: trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuAbstractPreferencesPanel.java
===================================================================
--- trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuAbstractPreferencesPanel.java 2011-06-15 13:50:23 UTC (rev 6295)
+++ trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuAbstractPreferencesPanel.java 2011-06-15 13:53:25 UTC (rev 6296)
@@ -53,13 +53,36 @@
}
}
+ /**
+ * @return true : Les pr\xE9f\xE9rences peuvent \xEAtre ecrites. false sinon.
+ */
public boolean isPreferencesValidable() { return false; }
+
+ /**
+ * A surcharger si les pr\xE9f\xE9rences peuvent \xEAtre ecrites.
+ */
public void validatePreferences() { }
+ /**
+ * @return true : Les pr\xE9f\xE9rences peuvent \xEAtre appliqu\xE9es sans sortie du dialogue.
+ * false sinon.
+ */
public boolean isPreferencesApplyable() { return false; }
+
+ /**
+ * A surcharger si les pr\xE9f\xE9rences peuvent \xEAtre appliqu\xE9es.
+ */
public void applyPreferences() { }
+ /**
+ * @return true : Les pr\xE9f\xE9rences peuvent \xEAtre annul\xE9es.
+ * false sinon.
+ */
public boolean isPreferencesCancelable() { return false; }
+
+ /**
+ * A surcharger si les pr\xE9f\xE9rences peuvent \xEAtre annul\xE9es.
+ */
public void cancelPreferences() { }
public void keyPressed (KeyEvent _evt) { }
Added: trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuContainerPreferencesPanel.java
===================================================================
--- trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuContainerPreferencesPanel.java (rev 0)
+++ trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuContainerPreferencesPanel.java 2011-06-15 13:53:25 UTC (rev 6296)
@@ -0,0 +1,131 @@
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package com.memoire.bu;
+
+import java.awt.BorderLayout;
+import javax.swing.JPanel;
+import javax.swing.border.CompoundBorder;
+import javax.swing.border.EmptyBorder;
+import javax.swing.border.TitledBorder;
+
+/**
+ * Un panneau contenant des composants pr\xE9f\xE9rences. Les composants sont globalement
+ * enregistrables, s'il n'y a pas d'erreur dessus (ils sont dans ce cas "savabled").
+ *
+ * @author mar...@de...
+ */
+public class BuContainerPreferencesPanel extends BuAbstractPreferencesPanel {
+ private BuAbstractPreferencesComponent[] cmps_;
+ private String category_;
+ private String title_;
+ private boolean isDirty_=false;
+
+ public BuContainerPreferencesPanel(BuAbstractPreferencesComponent[] _cmps, String _category, String _title) {
+ cmps_=_cmps;
+ category_=_category;
+ title_=_title;
+
+ setLayout(new BuVerticalLayout(5,true,false));
+
+ for (BuAbstractPreferencesComponent cmp : cmps_) {
+ cmp.setContainer(this);
+
+ JPanel pn=new JPanel();
+ pn.setLayout(new BorderLayout());
+ pn.setBorder(new CompoundBorder(
+ new TitledBorder(cmp.getTitle()),
+ new EmptyBorder(5, 5, 5, 5)));
+ pn.add(cmp,BorderLayout.CENTER);
+ add(pn);
+ }
+ }
+
+ @Override
+ public String getCategory() {
+ return category_;
+ }
+
+ @Override
+ public String getTitle() {
+ return title_;
+ }
+
+ @Override
+ public boolean isPreferencesValidable() {
+ for (BuAbstractPreferencesComponent cmp : cmps_) {
+ if (!cmp.isPreferencesValidable()) return false;
+ }
+ return true;
+ }
+
+ @Override
+ public void validatePreferences() {
+ for (BuAbstractPreferencesComponent cmp : cmps_) {
+ cmp.validatePreferences();
+ }
+ }
+
+ @Override
+ public boolean isPreferencesApplyable() {
+ for (BuAbstractPreferencesComponent cmp : cmps_) {
+ if (!cmp.isPreferencesApplyable()) return false;
+ }
+ return true;
+ }
+
+ @Override
+ public void applyPreferences() {
+ for (BuAbstractPreferencesComponent cmp : cmps_) {
+ cmp.applyPreferences();
+ }
+ }
+
+ @Override
+ public boolean isPreferencesCancelable() {
+ for (BuAbstractPreferencesComponent cmp : cmps_) {
+ if (!cmp.isPreferencesCancelable()) return false;
+ }
+ return true;
+ }
+
+ @Override
+ public void cancelPreferences() {
+ for (BuAbstractPreferencesComponent cmp : cmps_) {
+ cmp.cancelPreferences();
+ }
+ }
+
+ @Override
+ public boolean isDirty() {
+ for (BuAbstractPreferencesComponent cmp : cmps_) {
+ if (!cmp.isSavabled()) {
+ isDirty_=false;
+ return isDirty_;
+ }
+ }
+ for (BuAbstractPreferencesComponent cmp : cmps_) {
+ if (cmp.isModified()) {
+ isDirty_=true;
+ return isDirty_;
+ }
+ }
+
+ isDirty_=false;
+ return isDirty_;
+ }
+
+ /** Ne fait rien, l'\xE9tat dirty est determin\xE9 par les composants sous jacents */
+ @Override
+ public void setDirty(boolean _b) {
+ }
+
+ public void firePropertyChange() {
+ boolean oldDirty=isDirty_;
+ if (isDirty()!=oldDirty)
+ {
+ firePropertyChange("dirty",oldDirty,isDirty_);
+ }
+ }
+}
Property changes on: trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuContainerPreferencesPanel.java
___________________________________________________________________
Added: svn:keywords
+ Id
Added: svn:eol-style
+ native
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bma...@us...> - 2011-06-27 10:31:19
|
Revision: 6316
http://fudaa.svn.sourceforge.net/fudaa/?rev=6316&view=rev
Author: bmarchan
Date: 2011-06-27 10:31:13 +0000 (Mon, 27 Jun 2011)
Log Message:
-----------
Ame : Sauvegarde/restitution des largeurs de colonnes left/right en pr?\195?\169f?\195?\169rences
Modified Paths:
--------------
trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuApplication.java
trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuPreferences.java
Modified: trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuApplication.java
===================================================================
--- trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuApplication.java 2011-06-24 15:23:01 UTC (rev 6315)
+++ trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuApplication.java 2011-06-27 10:31:13 UTC (rev 6316)
@@ -253,6 +253,9 @@
BuPreferences.BU.putIntegerProperty("window.w", d.width);
BuPreferences.BU.putIntegerProperty("window.h", d.height);
}
+
+ BuPreferences.BU.putIntegerProperty("leftcolumn.width",getMainPanel().getLeftColumn().getWidth());
+ BuPreferences.BU.putIntegerProperty("rightcolumn.width",getMainPanel().getRightColumn().getWidth());
BuPreferences.BU.writeIniFile();
Modified: trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuPreferences.java
===================================================================
--- trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuPreferences.java 2011-06-24 15:23:01 UTC (rev 6315)
+++ trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuPreferences.java 2011-06-27 10:31:13 UTC (rev 6316)
@@ -455,9 +455,21 @@
boolean va = getBooleanProperty("assistant.visible", true);
_main.getLeftColumn().toggleComponent("ASSISTANT", va);
_main.getRightColumn().toggleComponent("ASSISTANT", va);
+
+ int lcwidth=getIntegerProperty("leftcolumn.width",-1);
+ if (lcwidth!=-1) {
+ int height=_main.getLeftColumn().getPreferredSize().height;
+ _main.getLeftColumn().setPreferredSize(new Dimension(lcwidth,height));
+ }
+
+ int rcwidth=getIntegerProperty("rightcolumn.width",-1);
+ if (rcwidth!=-1) {
+ int height=_main.getRightColumn().getPreferredSize().height;
+ _main.getRightColumn().setPreferredSize(new Dimension(rcwidth,height));
+ }
if (getBooleanProperty("columns.swapped", false) ^ _main.isColumnsSwapped()) _main.swapColumns();
-
+
_main.revalidate();
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2012-11-14 10:19:28
|
Revision: 7881
http://fudaa.svn.sourceforge.net/fudaa/?rev=7881&view=rev
Author: deniger
Date: 2012-11-14 10:19:17 +0000 (Wed, 14 Nov 2012)
Log Message:
-----------
Modified Paths:
--------------
trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuDialog.java
trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuSplashScreen.java
trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuToolButton.java
Modified: trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuDialog.java
===================================================================
--- trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuDialog.java 2012-11-14 08:38:46 UTC (rev 7880)
+++ trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuDialog.java 2012-11-14 10:19:17 UTC (rev 7881)
@@ -1,14 +1,13 @@
/**
* @modification $Date: 2007-03-09 08:37:38 $
- * @statut unstable
- * @file BuDialog.java
- * @version 0.43
- * @author Guillaume Desnoix
- * @email gui...@de...
- * @license GNU General Public License 2 (GPL2)
- * @copyright 1998-2005 Guillaume Desnoix
+ * @statut unstable
+ * @file BuDialog.java
+ * @version 0.43
+ * @author Guillaume Desnoix
+ * @email gui...@de...
+ * @license GNU General Public License 2 (GPL2)
+ * @copyright 1998-2005 Guillaume Desnoix
*/
-
package com.memoire.bu;
import java.awt.Color;
@@ -34,84 +33,83 @@
import com.memoire.fu.FuLog;
/**
- * An abstract class for dialogs.
- * Better to use than JOptionPane.
+ * An abstract class for dialogs. Better to use than JOptionPane.
*/
public abstract class BuDialog
- extends JDialog
- implements ActionListener, BuBorders
-{
- private static final int GAP=
- BuPreferences.BU.getIntegerProperty("layout.gap",5);
+ extends JDialog
+ implements ActionListener, BuBorders {
- protected Frame frame_;
- protected JComponent content_;
- protected JComponent lbMessage_;
- protected BuScrollPane scrollpane_;
+ private static final int GAP =
+ BuPreferences.BU.getIntegerProperty("layout.gap", 5);
+ protected Frame frame_;
+ protected JComponent content_;
+ protected JComponent lbMessage_;
+ protected BuScrollPane scrollpane_;
protected BuBorderLayout layout_;
- protected int reponse_;
- protected Object message_;
+ protected int reponse_;
+ protected Object message_;
- public BuDialog(BuCommonInterface _parent,
- BuInformationsSoftware _isoft,
- String _titre)
- {
- this(_parent,_isoft,_titre,null);
+ public BuDialog(BuCommonInterface _parent,
+ BuInformationsSoftware _isoft,
+ String _titre) {
+ this(_parent, _isoft, _titre, null);
}
- public BuDialog(BuCommonInterface _parent,
- BuInformationsSoftware _isoft,
- String _titre,
- Object _message)
- {
- super(_parent==null ? BuLib.HELPER : _parent.getFrame());
+ public BuDialog(BuCommonInterface _parent,
+ BuInformationsSoftware _isoft,
+ String _titre,
+ Object _message) {
+ super(_parent == null ? BuLib.HELPER : _parent.getFrame());
- if(_parent!=null) frame_=_parent.getFrame();
- reponse_=JOptionPane.CANCEL_OPTION;
+ if (_parent != null) {
+ frame_ = _parent.getFrame();
+ }
+ reponse_ = JOptionPane.CANCEL_OPTION;
- BuBorderLayout mlo=new BuBorderLayout();
+ BuBorderLayout mlo = new BuBorderLayout();
- JComponent mct=(JComponent)getContentPane();
+ JComponent mct = (JComponent) getContentPane();
mct.setLayout(mlo);
- BuInformationsSoftware isoft=_isoft;
+ BuInformationsSoftware isoft = _isoft;
/*if((_parent!=null)&&(isoft==null))
- isoft=_parent.getInformationsSoftware();*/
+ isoft=_parent.getInformationsSoftware();*/
- if(isoft!=null)
- {
- BuPanel mpi=new BuPanel();
+ if (isoft != null) {
+ BuPanel mpi = new BuPanel();
mpi.setLayout(new BuVerticalLayout(GAP));
mpi.setBorder(BuLib.getEmptyBorder(GAP)); //10,10,10,10));
- Color bg=BuLib.getColor(mpi.getBackground().darker());
- Color fg=BuLib.getColor(Color.white);
- if(bg.equals(fg)) fg=BuLib.getColor(Color.black);
+ Color bg = BuLib.getColor(mpi.getBackground().darker());
+ Color fg = BuLib.getColor(Color.white);
+ if (bg.equals(fg)) {
+ fg = BuLib.getColor(Color.black);
+ }
mpi.setBackground(bg);
mpi.setForeground(fg);
-
- BuPicture ml_logo=null;
- if(isoft.logo!=null)
- {
- ml_logo=new BuPicture(isoft.logo);
- // setIconImage(BuResource.BU.getImage("dialog"));
+
+ BuPicture ml_logo = null;
+ if (isoft.logo != null) {
+ ml_logo = new BuPicture(isoft.logo);
+ // setIconImage(BuResource.BU.getImage("dialog"));
}
-
- BuLabelMultiLine ml_isoft=new BuLabelMultiLine
- (isoft.name+"\nversion: "+isoft.version+"\ndate: "+isoft.date);
- ml_isoft.setFont(BuLib.deriveFont("Label",Font.PLAIN,-2));
+
+ BuLabelMultiLine ml_isoft = new BuLabelMultiLine(isoft.name + "\nversion: " + isoft.version + "\ndate: " + isoft.date);
+ ml_isoft.setFont(BuLib.deriveFont("Label", Font.PLAIN, -2));
ml_isoft.setForeground(fg);//Color.white);
- if(ml_logo!=null) mpi.add(ml_logo);
+ if (ml_logo != null) {
+ mpi.add(ml_logo);
+ }
mpi.add(ml_isoft);
- mct.add(mpi,BuBorderLayout.WEST);
+ mct.add(mpi, BuBorderLayout.WEST);
}
- layout_=new BuBorderLayout();
+ layout_ = new BuBorderLayout();
layout_.setHgap(GAP);
layout_.setVgap(GAP);
- content_=new BuPanel();
+ content_ = new BuPanel();
content_.setBorder(BuLib.getEmptyBorder(GAP));//BuBorders.EMPTY5555);
content_.setLayout(layout_);
- mct.add(content_,BuBorderLayout.CENTER);
+ mct.add(content_, BuBorderLayout.CENTER);
setMessage(_message);
setResizable(false);
@@ -121,160 +119,163 @@
addWindowListener(new WAD());
}
- public void setMessage(Object _message)
- {
- if((lbMessage_!=null)&&(lbMessage_.getParent()==content_))
+ public void setMessage(Object _message) {
+ if ((lbMessage_ != null) && (lbMessage_.getParent() == content_)) {
content_.remove(lbMessage_);
- if((scrollpane_!=null)&&(scrollpane_.getParent()==content_))
+ }
+ if ((scrollpane_ != null) && (scrollpane_.getParent() == content_)) {
content_.remove(scrollpane_);
- Object message=_message;
- if(message==null)
- message=getComponent();
- if(message==null)
- message="Please overload getComponent() in BuDialog.";
+ }
+ Object message = _message;
+ if (message == null) {
+ message = getComponent();
+ }
+ if (message == null) {
+ message = "Please overload getComponent() in BuDialog.";
+ }
- message_=message;
+ message_ = message;
- if(message instanceof JComponent)
- lbMessage_=(JComponent)message;
- else
- {
- String text=message.toString();
- if(text.startsWith("<HTML>"))
- {
- BuEditorPane html=new BuEditorPane();
+ if (message instanceof JComponent) {
+ lbMessage_ = (JComponent) message;
+ } else {
+ String text = message.toString();
+ if (text.startsWith("<HTML>") || text.startsWith("<html>")) {
+ BuEditorPane html = new BuEditorPane();
/*GCJ-BEGIN*/
- EditorKit ek =html.getEditorKitForContentType("text/html");
- Document dk =ek.createDefaultDocument();
+ EditorKit ek = html.getEditorKitForContentType("text/html");
+ Document dk = ek.createDefaultDocument();
- try { ek.read(new StringReader(text),dk,0); }
- catch(Exception ex) { FuLog.warning(ex); }
+ try {
+ ek.read(new StringReader(text), dk, 0);
+ } catch (Exception ex) {
+ FuLog.warning(ex);
+ }
- html.setOpaque(false);
- html.setBorder(EMPTY0000);
- html.setEditable(false);
- html.setEditorKit(ek);
- html.setDocument(dk);
+ html.setOpaque(false);
+ html.setBorder(EMPTY0000);
+ html.setEditable(false);
+ html.setEditorKit(ek);
+ html.setDocument(dk);
/*GCJ-END*/
- lbMessage_=html;
+ lbMessage_ = html;
+ } else {
+ lbMessage_ = new BuLabelMultiLine(text);
+ ((BuLabelMultiLine) lbMessage_).setPreferredWidth(440);
+ ((BuLabelMultiLine) lbMessage_).setWrapMode(BuLabelMultiLine.WORD);
+ lbMessage_.setFont(BuLib.deriveFont("Label", Font.PLAIN, 0));
+ lbMessage_.setBorder(EMPTY5555);
}
- else
- {
- lbMessage_=new BuLabelMultiLine(text);
- ((BuLabelMultiLine)lbMessage_).setPreferredWidth(440);
- ((BuLabelMultiLine)lbMessage_).setWrapMode(BuLabelMultiLine.WORD);
- lbMessage_.setFont(BuLib.deriveFont("Label",Font.PLAIN, 0));
- lbMessage_.setBorder(EMPTY5555);
- }
}
- if(needsScrollPane())
- {
- scrollpane_=new BuScrollPane(lbMessage_);
- int h=lbMessage_.getFont().getSize();
- scrollpane_.getHorizontalScrollBar().setUnitIncrement (150);
- scrollpane_.getVerticalScrollBar() .setUnitIncrement (h+1);
+ if (needsScrollPane()) {
+ scrollpane_ = new BuScrollPane(lbMessage_);
+ int h = lbMessage_.getFont().getSize();
+ scrollpane_.getHorizontalScrollBar().setUnitIncrement(150);
+ scrollpane_.getVerticalScrollBar().setUnitIncrement(h + 1);
- if((lbMessage_ instanceof BuLabelMultiLine)&&
- (((BuLabelMultiLine)lbMessage_).getWrapMode()
- !=BuLabelMultiLine.NONE))
- {
- scrollpane_.setHorizontalScrollBarPolicy
- (ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
- scrollpane_.setVerticalScrollBarPolicy
- (ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
- scrollpane_.setPreferredSize(scrollpane_.getPreferredSize());
- scrollpane_.setVerticalScrollBarPolicy
- (ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
+ if ((lbMessage_ instanceof BuLabelMultiLine)
+ && (((BuLabelMultiLine) lbMessage_).getWrapMode()
+ != BuLabelMultiLine.NONE)) {
+ scrollpane_.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
+ scrollpane_.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS);
+ scrollpane_.setPreferredSize(scrollpane_.getPreferredSize());
+ scrollpane_.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
}
- content_.add(scrollpane_,BuBorderLayout.CENTER);
+ content_.add(scrollpane_, BuBorderLayout.CENTER);
+ } else {
+ content_.add(lbMessage_, BuBorderLayout.CENTER);
}
- else
- {
- content_.add(lbMessage_,BuBorderLayout.CENTER);
- }
- if(lbMessage_.isFocusable())
+ if (lbMessage_.isFocusable()) {
lbMessage_.requestFocus();
- else
+ } else {
transferFocus();
+ }
//if(content_.isShowing()) content_.revalidate();
}
- class WAD extends WindowAdapter
- {
- public void windowActivated(WindowEvent _evt)
- {
+ class WAD extends WindowAdapter {
+
+ public void windowActivated(WindowEvent _evt) {
//System.err.println("Dialog.Activated");
- JButton db=getRootPane().getDefaultButton();
+ JButton db = getRootPane().getDefaultButton();
//System.err.println("Dialog.defaultButton="+db);
//System.err.println("Dialog.focusOwner="+getFocusOwner());
- if((getFocusOwner()==null)&&(db!=null)) db.requestFocus();
+ if ((getFocusOwner() == null) && (db != null)) {
+ db.requestFocus();
+ }
}
}
// Resource
-
- protected String _(String _s)
- {
+ protected String _(String _s) {
return BuResource.BU.getString(_s);
}
- protected static final String __(String _s)
- {
+ protected static final String __(String _s) {
return BuResource.BU.getString(_s);
}
// Anti-aliasing
-
- public final void paint(Graphics _g)
- {
- BuLib.setAntialiasing(this,_g);
+ public final void paint(Graphics _g) {
+ BuLib.setAntialiasing(this, _g);
super.paint(_g);
}
public abstract JComponent getComponent();
+
public abstract void actionPerformed(ActionEvent _evt);
- public boolean needsScrollPane()
- {
+ public boolean needsScrollPane() {
return true;
}
- public final int activate()
- {
- reponse_=JOptionPane.CANCEL_OPTION;
+ public final int activate() {
+ reponse_ = JOptionPane.CANCEL_OPTION;
- JComponent mct=(JComponent)getContentPane();
+ JComponent mct = (JComponent) getContentPane();
- Dimension d=mct.getPreferredSize();
- Dimension ecran=getToolkit().getScreenSize();
+ Dimension d = mct.getPreferredSize();
+ Dimension ecran = getToolkit().getScreenSize();
//d.width+=30; d.height+=30;
- if(!(message_ instanceof JComponent))
- {
- if(d.width <450) d.width =450;
- if(d.width >550) d.width =550;
- if(d.height<150) d.height=150;
- if(d.height>250) d.height=250;
+ if (!(message_ instanceof JComponent)) {
+ if (d.width < 450) {
+ d.width = 450;
+ }
+ if (d.width > 550) {
+ d.width = 550;
+ }
+ if (d.height < 150) {
+ d.height = 150;
+ }
+ if (d.height > 250) {
+ d.height = 250;
+ }
}
- if(d.width >ecran.width *3/4) d.width=ecran.width *3/4;
- if(d.height>ecran.height*3/4) d.height=ecran.height*3/4;
+ if (d.width > ecran.width * 3 / 4) {
+ d.width = ecran.width * 3 / 4;
+ }
+ if (d.height > ecran.height * 3 / 4) {
+ d.height = ecran.height * 3 / 4;
+ }
- boolean resizable=isResizable();
+ boolean resizable = isResizable();
setResizable(true);
//setSize(d);
mct.setPreferredSize(d);
pack();
//setSize(getPreferredSize());
- Point p=getLocation();
- if((p.x==0)&&(p.y==0))
- setLocation((ecran.width-d.width)/2,(ecran.height-d.height)/2);
+ Point p = getLocation();
+ if ((p.x == 0) && (p.y == 0)) {
+ setLocation((ecran.width - d.width) / 2, (ecran.height - d.height) / 2);
+ }
setResizable(resizable);
@@ -284,14 +285,15 @@
show();
// release native resources
- if(isModal()) dispose();
+ if (isModal()) {
+ dispose();
+ }
return reponse_;
}
- public void show()
- {
- BuLib.computeMnemonics(getRootPane(),this);
+ public void show() {
+ BuLib.computeMnemonics(getRootPane(), this);
super.show();
}
}
Modified: trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuSplashScreen.java
===================================================================
--- trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuSplashScreen.java 2012-11-14 08:38:46 UTC (rev 7880)
+++ trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuSplashScreen.java 2012-11-14 10:19:17 UTC (rev 7881)
@@ -1,14 +1,13 @@
/**
* @modification $Date: 2006-09-19 14:35:07 $
- * @statut unstable
- * @file BuSplashScreen.java
- * @version 0.43
- * @author Guillaume Desnoix
- * @email gui...@de...
- * @license GNU General Public License 2 (GPL2)
- * @copyright 1998-2005 Guillaume Desnoix
+ * @statut unstable
+ * @file BuSplashScreen.java
+ * @version 0.43
+ * @author Guillaume Desnoix
+ * @email gui...@de...
+ * @license GNU General Public License 2 (GPL2)
+ * @copyright 1998-2005 Guillaume Desnoix
*/
-
package com.memoire.bu;
import java.awt.Color;
@@ -30,7 +29,7 @@
* An easy-to-use splash screen which takes a list of classes to load.
*/
public class BuSplashScreen extends JWindow // BuPopupWindow
- implements BuBorders // Runnable
+ implements BuBorders // Runnable
{
/*
* class XLabel extends BuLabel { protected void paintComponent(Graphics _g) { Color old=getForeground();
@@ -43,15 +42,12 @@
* old=getForeground(); setForeground(Color.white); for(int i=-1;i<=1;i++) for(int j=-1;j<=1;j++) { _g.translate(i,j);
* super.paintComponent(_g); _g.translate(-i,-j); } setForeground(old); super.paintComponent(_g); } }
*/
-
private ClassLoader loader_;
private BuInformationsSoftware info_;
private long delai_;
private String[][] classes_;
// private String base_;
-
protected JComponent content_;
-
protected JPanel panel_;
protected BuPanel left_;
protected BuProgressBar progression_;
@@ -63,7 +59,6 @@
* this(_info,_delai,new String[][]{_classes}); } public BuSplashScreen(BuInformationsSoftware _info, long _delai,
* String[][] _classes, String _base) { this(_info,_delai,_classes); }
*/
-
public BuSplashScreen(BuInformationsSoftware _info, long _delai, String[][] _classes) {
this(_info, _delai, _classes, null);
}
@@ -77,7 +72,9 @@
// base_ =_base;
loader_ = _loader;
- if (loader_ == null) loader_ = getClass().getClassLoader();
+ if (loader_ == null) {
+ loader_ = getClass().getClassLoader();
+ }
content_ = new BuPanel();
content_.setLayout(new BuBorderLayout());
@@ -92,7 +89,9 @@
panel_.setLayout(new BuBorderLayout());
BuPicture ml_logo = null;
- if (info_.logo != null) ml_logo = new BuPicture(info_.logo);
+ if (info_.logo != null) {
+ ml_logo = new BuPicture(info_.logo);
+ }
BuVerticalLayout leftlo = new BuVerticalLayout();
leftlo.setVfilled(false);
@@ -106,7 +105,9 @@
Color bg = BuLib.getColor(left_.getBackground().darker());
left_.setBackground(bg);
- if (ml_logo != null) left_.add(ml_logo);
+ if (ml_logo != null) {
+ left_.add(ml_logo);
+ }
BuLabel l1 = new BuLabel();
BuLabel l2 = new BuLabel();
@@ -117,7 +118,9 @@
l1.setText(info_.name + " " + info_.version);
l2.setText(info_.date);
- l3.setText(info_.authors[0]);
+ if (info_.authors != null) {
+ l3.setText(info_.authors[0]);
+ }
l4.setText(info_.contact + "\n" + info_.http);
l1.setHorizontalAlignment(SwingConstants.CENTER);
@@ -221,7 +224,8 @@
if (!SwingUtilities.isEventDispatchThread()) {
try {
Thread.sleep(200L);
- } catch (InterruptedException ex) {}
+ } catch (InterruptedException ex) {
+ }
}
run();
@@ -243,22 +247,29 @@
pp = -1;
l = 0;
- for (i = 0; i < classes_.length; i++)
+ for (i = 0; i < classes_.length; i++) {
l += classes_[i].length;
+ }
m = 0;
- for (i = 0; i < classes_.length; i++)
+ for (i = 0; i < classes_.length; i++) {
for (j = 0; j < classes_[i].length; j++) {
String n = classes_[i][j];
// int k=n.lastIndexOf('.');
// setText(k>=0 ? n.substring(k+1) : n);
String t = n;
int k = t.indexOf('$');
- if (k >= 0) t = t.substring(0, k);
+ if (k >= 0) {
+ t = t.substring(0, k);
+ }
k = t.lastIndexOf('.');
- if (k >= 0) t = t.substring(0, k);
+ if (k >= 0) {
+ t = t.substring(0, k);
+ }
k = t.lastIndexOf('.');
- if (k >= 0) t = t.substring(k + 1);
+ if (k >= 0) {
+ t = t.substring(k + 1);
+ }
if (!t.equals(ps)) {
setText(t);
ps = t;
@@ -266,9 +277,11 @@
// if(k<0) n=paquet+n;
try {
- if (loader_ == null) Class.forName(n);
- else loader_.loadClass(n); // Class.forName(n,false,loader_);
-
+ if (loader_ == null) {
+ Class.forName(n);
+ } else {
+ loader_.loadClass(n); // Class.forName(n,false,loader_);
+ }
// Class c=Class.forName(n);
// FuClassLoaderDedicated.putGlobal(c);
} catch (Exception ex) {
@@ -288,6 +301,7 @@
pp = p;
}
}
+ }
setText("");
setProgression(100);
@@ -298,7 +312,8 @@
do {
try {
Thread.sleep(50);
- } catch (Exception ex) {}
+ } catch (Exception ex) {
+ }
diff = System.currentTimeMillis() - avant;
p = (int) (diff * 100 / delai_);
@@ -319,7 +334,8 @@
// BuUpdateGUI.repaintNow(message_);
}
});
- } catch (InterruptedException ex) {} catch (InvocationTargetException ex) {
+ } catch (InterruptedException ex) {
+ } catch (InvocationTargetException ex) {
FuLog.error(ex);
}
}
@@ -341,7 +357,8 @@
// BuUpdateGUI.repaintNow(progression_);
}
});
- } catch (InterruptedException ex) {} catch (InvocationTargetException ex) {
+ } catch (InterruptedException ex) {
+ } catch (InvocationTargetException ex) {
FuLog.error(ex);
}
}
Modified: trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuToolButton.java
===================================================================
--- trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuToolButton.java 2012-11-14 08:38:46 UTC (rev 7880)
+++ trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuToolButton.java 2012-11-14 10:19:17 UTC (rev 7881)
@@ -21,12 +21,9 @@
import java.awt.Point;
import java.awt.event.MouseEvent;
-import javax.swing.BorderFactory;
import javax.swing.Icon;
import javax.swing.JButton;
import javax.swing.JComponent;
-import javax.swing.UIManager;
-import javax.swing.border.Border;
import javax.swing.plaf.ColorUIResource;
import javax.swing.plaf.FontUIResource;
import javax.swing.plaf.InsetsUIResource;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <de...@us...> - 2014-10-14 20:07:07
|
Revision: 8879
http://sourceforge.net/p/fudaa/svn/8879
Author: deniger
Date: 2014-10-14 20:06:59 +0000 (Tue, 14 Oct 2014)
Log Message:
-----------
maj couleur par defaut ?\195?\160 similaire
Modified Paths:
--------------
trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuDesktop.java
trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuLookPreferencesPanel.java
trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuPreferences.java
Modified: trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuDesktop.java
===================================================================
--- trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuDesktop.java 2014-10-14 19:59:19 UTC (rev 8878)
+++ trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuDesktop.java 2014-10-14 20:06:59 UTC (rev 8879)
@@ -1206,8 +1206,8 @@
true);
mnCouleurs.addMenuItem(_("Similaire"), "DESKTOP_SIMILAIRE",
new BuColorIcon(UIManager.getColor("Panel.background")), true);
- mnCouleurs.addMenuItem(_("D\xE9faut"), "DESKTOP_DEFAUT", new BuColorIcon(UIManager.getColor("Desktop.background")),
- true);
+// mnCouleurs.addMenuItem(_("D\xE9faut"), "DESKTOP_DEFAUT", new BuColorIcon(UIManager.getColor("Desktop.background")),
+// true);
menu_.addSubMenu(mnTextures, true);
menu_.addSubMenu(mnCouleurs, true);
@@ -1267,7 +1267,7 @@
setBackground(UIManager.getColor("Panel.background"));
bp.setIcon(null);
} else if (action.equals("DESKTOP_DEFAUT")) {
- setBackground(UIManager.getColor("Desktop.background"));
+ setBackground(UIManager.getColor("Panel.background"));
bp.setIcon(null);
}
Modified: trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuLookPreferencesPanel.java
===================================================================
--- trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuLookPreferencesPanel.java 2014-10-14 19:59:19 UTC (rev 8878)
+++ trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuLookPreferencesPanel.java 2014-10-14 20:06:59 UTC (rev 8879)
@@ -134,7 +134,7 @@
optionsStr_.put
(itemStr="DESKTOP_DEFAUT",
itemOpt=new BuOptionItem(getS("D\xE9faut"),
- new BuColorIcon(UIManager.getColor("Desktop.background"))));
+ new BuColorIcon(UIManager.getColor("Panel.background"))));
optionsStr_.put(itemOpt, itemStr);
optionsStr_.put
(itemStr="ASPECT_DEFAUT",
Modified: trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuPreferences.java
===================================================================
--- trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuPreferences.java 2014-10-14 19:59:19 UTC (rev 8878)
+++ trunk/framework/ctulu-bu/src/main/java/com/memoire/bu/BuPreferences.java 2014-10-14 20:06:59 UTC (rev 8879)
@@ -496,7 +496,7 @@
_desktop.setBackground(UIManager.getColor("Panel.background"));
bp.setIcon(null);
} else if (getStringProperty("desktop.background").equals("DESKTOP_DEFAUT")) {
- _desktop.setBackground(UIManager.getColor("Desktop.background"));
+ _desktop.setBackground(UIManager.getColor("Panel.background"));
bp.setIcon(null);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|