|
From: <de...@us...> - 2015-09-10 16:57:19
|
Revision: 9166
http://sourceforge.net/p/fudaa/svn/9166
Author: deniger
Date: 2015-09-10 16:57:17 +0000 (Thu, 10 Sep 2015)
Log Message:
-----------
CRUE-657
Modified Paths:
--------------
trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/InitPerspectiveInstaller.java
trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/common/LoiDefaultCourbeModel.java
Added Paths:
-----------
trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/swing/CrueBasicComponentFactory.java
trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/swing/JidePaletteButton.java
trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/swing/JideToolButton.java
Modified: trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/InitPerspectiveInstaller.java
===================================================================
--- trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/InitPerspectiveInstaller.java 2015-09-10 16:56:03 UTC (rev 9165)
+++ trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/InitPerspectiveInstaller.java 2015-09-10 16:57:17 UTC (rev 9166)
@@ -1,6 +1,5 @@
package org.fudaa.fudaa.crue.common;
-import com.jidesoft.plaf.UIDefaultsLookup;
import com.memoire.bu.BuResource;
import java.awt.BorderLayout;
import java.awt.Color;
@@ -23,6 +22,7 @@
import org.fudaa.fudaa.crue.common.pdt.PrendreClicheFinPermanentEditor;
import org.fudaa.fudaa.crue.common.services.PerspectiveService;
import org.fudaa.fudaa.crue.common.services.SelectedPerspectiveService;
+import org.fudaa.fudaa.crue.common.swing.CrueBasicComponentFactory;
import org.openide.modules.ModuleInstall;
import org.openide.util.Lookup;
import org.openide.util.Lookup.Item;
@@ -33,31 +33,31 @@
import org.openide.windows.WindowManager;
public class InitPerspectiveInstaller extends ModuleInstall implements Runnable {
-
+
@Override
protected void initialize() {
BuResource.BU.setIconFamily("crystal");
BPalettePlage.setDisplayReversed();
WindowManager.getDefault().invokeWhenUIReady(this);
}
-
+
@Override
public void validate() throws IllegalStateException {
super.validate();
}
-
+
@Override
public void restored() {
BuResource.BU.setIconFamily("crystal");
BPalettePlage.setDisplayReversed();
-
+
WindowManager.getDefault().invokeWhenUIReady(this);
}
-
+
@Override
@Messages("FudaaCrueClosing.Label=Fudaa-Crue est en cours de fermeture...")
public boolean closing() {
-
+
SelectedPerspectiveService selectedPerspectiveService = Lookup.getDefault().lookup(SelectedPerspectiveService.class);
boolean closing = true;
if (selectedPerspectiveService.getCurrentPerspectiveService() != null) {
@@ -72,7 +72,7 @@
if (perspectiveService != null) {
closing = perspectiveService.closing();
}
-
+
JDialog d = new JDialog();
JLabel jLabel = new JLabel(FudaaCrueClosing_Label());
d.setTitle(jLabel.getText());
@@ -88,13 +88,13 @@
}
return closing;
}
-
+
@Override
public void run() {
UIManager.put("ToggleButton.select", Color.RED);
UIManager.put("ToggleButton.focus", Color.RED);
UIManager.put("ToggleButton.highlight", Color.RED);
- EbliComponentFactory.INSTANCE.setUseSelectedIcon(UIDefaultsLookup.getColor("JideButton.highlight"));
+ EbliComponentFactory.INSTANCE.setComponentFactory(new CrueBasicComponentFactory());
DurationPropertyEditor.registerEditor();
LocalDateTimeEditor.registerEditor();
PrendreClicheFinPermanentEditor.registerAllClicheEditors();
Added: trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/swing/CrueBasicComponentFactory.java
===================================================================
--- trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/swing/CrueBasicComponentFactory.java (rev 0)
+++ trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/swing/CrueBasicComponentFactory.java 2015-09-10 16:57:17 UTC (rev 9166)
@@ -0,0 +1,51 @@
+/*
+ GPL 2
+ */
+package org.fudaa.fudaa.crue.common.swing;
+
+import com.jidesoft.swing.JideButton;
+import com.jidesoft.swing.JideMenu;
+import com.jidesoft.swing.JideToggleButton;
+import javax.swing.AbstractButton;
+import javax.swing.JMenuItem;
+import org.fudaa.ebli.commun.EbliActionPaletteAbstract;
+import org.fudaa.ebli.commun.EbliActionSimple;
+import org.fudaa.ebli.commun.EbliBasicComponentFactory;
+
+/**
+ *
+ * @author Frederic Deniger
+ */
+public class CrueBasicComponentFactory extends EbliBasicComponentFactory {
+
+ @Override
+ public AbstractButton createToolToggleButton() {
+ final JideToggleButton jideToggleButton = new JideToggleButton();
+ jideToggleButton.setButtonStyle(JideButton.TOOLBAR_STYLE);
+ return jideToggleButton;
+ }
+
+ @Override
+ public AbstractButton createToggleButton() {
+ return new JideToggleButton();
+ }
+
+
+ @Override
+ public AbstractButton createToolButton(EbliActionSimple _a) {
+ JideButton button = new JideToolButton(_a);
+ return button;
+ }
+
+ @Override
+ public AbstractButton createButton() {
+ return new JideButton();
+ }
+
+
+ @Override
+ public AbstractButton createPaletteButton(EbliActionPaletteAbstract _a) {
+ return new JidePaletteButton(_a);
+ }
+
+}
Added: trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/swing/JidePaletteButton.java
===================================================================
--- trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/swing/JidePaletteButton.java (rev 0)
+++ trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/swing/JidePaletteButton.java 2015-09-10 16:57:17 UTC (rev 9166)
@@ -0,0 +1,37 @@
+/*
+ GPL 2
+ */
+package org.fudaa.fudaa.crue.common.swing;
+
+import com.jidesoft.swing.JideToggleButton;
+import com.memoire.bu.BuDesktop;
+import org.fudaa.ebli.commun.EbliActionPaletteAbstract;
+
+/**
+ *
+ * @author Frederic Deniger
+ */
+public class JidePaletteButton extends JideToggleButton {
+
+ EbliActionPaletteAbstract ac_;
+
+ /**
+ *
+ */
+ public JidePaletteButton(final EbliActionPaletteAbstract _ac) {
+ ac_ = _ac;
+ }
+
+ @Override
+ public final void setVisible(final boolean _b) {
+ if (_b != isVisible()) {
+ ac_.setMainButtonVisible(_b);
+ super.setVisible(_b);
+ }
+
+ }
+
+ public void setDesktop(final BuDesktop _d) {
+ ac_.setDesktop(_d);
+ }
+}
Added: trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/swing/JideToolButton.java
===================================================================
--- trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/swing/JideToolButton.java (rev 0)
+++ trunk/soft/fudaa-crue/ui-common/src/main/java/org/fudaa/fudaa/crue/common/swing/JideToolButton.java 2015-09-10 16:57:17 UTC (rev 9166)
@@ -0,0 +1,60 @@
+/*
+ GPL 2
+ */
+package org.fudaa.fudaa.crue.common.swing;
+
+import com.jidesoft.swing.JideButton;
+import java.awt.event.KeyEvent;
+import javax.swing.Action;
+import javax.swing.KeyStroke;
+import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
+import org.fudaa.ebli.commun.EbliActionInterface;
+
+/**
+ *
+ * @author Frederic Deniger
+ */
+public class JideToolButton extends JideButton {
+
+ KeyStroke key_;
+
+ public JideToolButton(final EbliActionInterface _action) {
+ super(null, null);
+ setAction(_action);
+ setFocusable(true);
+ setButtonStyle(JideButton.TOOLBAR_STYLE);
+ key_ = (KeyStroke) _action.getValue(Action.ACCELERATOR_KEY);
+ if (key_ != null) {
+ final KeyStroke accelerator = key_;
+ final String acceleratorDelimiter
+ = UIManager.getString("MenuItem.acceleratorDelimiter");
+ String acceleratorText = "";
+ if (accelerator != null) {
+ final int modifiers = accelerator.getModifiers();
+ if (modifiers > 0) {
+ acceleratorText = KeyEvent.getKeyModifiersText(modifiers);
+ //acceleratorText += "-";
+ acceleratorText += acceleratorDelimiter;
+ }
+
+ final int keyCode = accelerator.getKeyCode();
+ if (keyCode == 0) {
+ acceleratorText += accelerator.getKeyChar();
+ } else {
+ acceleratorText += KeyEvent.getKeyText(keyCode);
+ }
+ }
+ setToolTipText(super.getToolTipText() + " " + acceleratorText);
+ }
+ }
+
+ @Override
+ protected boolean processKeyBinding(final KeyStroke _ks, final KeyEvent _e, final int _condition, final boolean _pressed) {
+ if (isEnabled() && key_ != null && key_.equals(_ks)) {
+ return SwingUtilities.notifyAction(getAction(), _ks, _e, this, _e.getModifiers());
+ }
+ return super.processKeyBinding(_ks, _e, _condition, _pressed);
+ }
+
+}
Modified: trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/common/LoiDefaultCourbeModel.java
===================================================================
--- trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/common/LoiDefaultCourbeModel.java 2015-09-10 16:56:03 UTC (rev 9165)
+++ trunk/soft/fudaa-crue/ui-loi/src/main/java/org/fudaa/fudaa/crue/loi/common/LoiDefaultCourbeModel.java 2015-09-10 16:57:17 UTC (rev 9166)
@@ -204,7 +204,6 @@
@Override
public void fillWithInfo(InfoData _table, CtuluListSelectionInterface _selectedPt) {
- throw new UnsupportedOperationException("Not supported yet.");
}
@Override
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|