Skip to content

Commit

Permalink
Merge pull request #683 from fesch/bugfix
Browse files Browse the repository at this point in the history
Version 3.29-03 candidate (from bugfix branch)
  • Loading branch information
fesch authored Feb 17, 2019
2 parents 9c0161b + 1b888b3 commit 5eafca0
Show file tree
Hide file tree
Showing 60 changed files with 3,777 additions and 2,750 deletions.
4 changes: 2 additions & 2 deletions buildapp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
name="Structorizer"
displayname="Structorizer"
identifier="lu.fisch.Structorizer"
shortversion="3.29-02"
version="3.29-02"
shortversion="3.29-03"
version="3.29-03"
icon="icons/Structorizer.icns"
mainclassname="Structorizer"
copyright="Bob Fisch"
Expand Down
28 changes: 25 additions & 3 deletions src/lu/fisch/structorizer/arranger/Arranger.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
* Kay Gürtzig 2019-01-16 Enh. #655: Workaround for key listener (using keybinding) created (not needed)
* Kay Gürtzig 2019-01-17 Enh. #657: Accelerator key (^R) for rearrange function added
* Kay Gürtzig 2019-01-18 Enh. #657: Order of popup menu items modified
* Kay Gürtzig 2019-02-05 Bugfix #674: L&F update of popup menu ensured
*
******************************************************************************************************
*
Expand Down Expand Up @@ -106,6 +107,7 @@
import javax.swing.JOptionPane;
import javax.swing.JScrollPane;
import javax.swing.KeyStroke;
import javax.swing.SwingUtilities;
import javax.swing.event.ChangeEvent;

import lu.fisch.structorizer.elements.Element;
Expand All @@ -114,6 +116,7 @@
import lu.fisch.structorizer.executor.IRoutinePool;
import lu.fisch.structorizer.executor.IRoutinePoolListener;
import lu.fisch.structorizer.gui.AttributeInspector;
import lu.fisch.structorizer.gui.GUIScaler;
import lu.fisch.structorizer.gui.IconLoader;
import lu.fisch.structorizer.gui.Mainform;
import lu.fisch.structorizer.io.Ini;
Expand Down Expand Up @@ -684,6 +687,8 @@ public void stateChanged(ChangeEvent evt) {

this.initPopupMenu();

GUIScaler.rescaleComponents(this.statusbar);

// START KGU#117 2016-03-09: New for Enh. #77
this.doButtons();
// END KGU#117 2016-03-09
Expand Down Expand Up @@ -1834,12 +1839,12 @@ protected Set<Diagram> expandRootSetOrSelection(Set<Root> initialRoots, Componen
}
if (initiator != null) {
String message = msgSelectionExpanded.getText().replace("%", Integer.toString(nAdded));
if (duplicateRoots.count() > 0) {
if (!duplicateRoots.isEmpty()) {
message += msgAmbiguousSignatures.getText()
.replace("%1", Integer.toString(duplicateRoots.count()))
.replace("%2", duplicateRoots.concatenate("\n- "));
}
if (missingRoots.count() > 0) {
if (!missingRoots.isEmpty()) {
message += msgMissingDiagrams.getText()
.replace("%1", Integer.toString(missingRoots.count()))
.replace("%2", missingRoots.concatenate("\n- "));
Expand Down Expand Up @@ -2234,7 +2239,7 @@ public boolean saveAll(Component initiator, boolean goingToClose) {
if (initiator == null) {
initiator = this;
}
return this.surface.saveDiagrams(initiator, null, goingToClose, goingToClose && Element.E_AUTO_SAVE_ON_CLOSE) &&
return this.surface.saveDiagrams(initiator, null, goingToClose, goingToClose && Element.E_AUTO_SAVE_ON_CLOSE, false) &&
this.surface.saveGroups(initiator, goingToClose);
// END KGU#626 2019-01-06
}
Expand Down Expand Up @@ -2371,4 +2376,21 @@ public Collection<Group> getGroupsFromRoot(Root root, boolean suppressDefaultGro
return surface.getGroupsFromRoot(root, suppressDefaultGroup);
}

// START KGU#646 2019-02-05: Bugfix #674 - Update popup menu L&F (isn't member of the component tree)
public static void updateLookAndFeel()
{
if (mySelf != null)
{
SwingUtilities.updateComponentTreeUI(mySelf);
// Cater for the look and feel update of the popup menu.
if (popupMenu != null) {
try {
javax.swing.SwingUtilities.updateComponentTreeUI(popupMenu);
}
catch (Exception ex) {
}
}
}
}
// END KGU#646 2019-02-05
}
16 changes: 13 additions & 3 deletions src/lu/fisch/structorizer/arranger/ArrangerIndex.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
* Kay Gürtzig 2019-01-17 Enhancements (group nodes for external references) and corrections
* Kay Gürtzig 2019-01-25 Bugfix #670: Attempt to fix the scaling deficiency w.r.t. to the info trees
* Kay Gürtzig 2019-01-28 Issue #670: Update of the info box components on look & feel change
* Kay Gürtzig 2019-02-05 Bugfix #674: L&F update of popup menu ensured
*
******************************************************************************************************
*
Expand Down Expand Up @@ -139,6 +140,9 @@ public class ArrangerIndex extends LangTree implements MouseListener {
protected final JMenuItem popupIndexAttach = new JMenuItem("Add/move to group ...", IconLoader.getIcon(116));
protected final JMenuItem popupIndexInfo = new JMenuItem("Diagram/group info ...", IconLoader.getIcon(118));
protected final JCheckBoxMenuItem popupIndexDrawGroup = new JCheckBoxMenuItem("Show group bounds", IconLoader.getIcon(17));
// START KGU#646 2019-02-10: Issue #674 - The L&F adaptataion from Windows to others was defective if it hadn't been open before
private boolean wasPopupOpen = false;
// END KGU#646 2019-02-10

protected final JLabel lblSelectTargetGroup = new JLabel("Select the target group:");
protected final JComboBox<Group> cmbTargetGroup = new JComboBox<Group>();
Expand Down Expand Up @@ -366,6 +370,12 @@ private void showPopup(MouseEvent e)
}
doButtonsLocal();
requestFocusInWindow();
// START KGU#646 2019-02-10: workaround for issue #674
if (!wasPopupOpen) {
javax.swing.SwingUtilities.updateComponentTreeUI(popupIndex);
wasPopupOpen = true;
}
// END KGU#646 4019-02-10
popupIndex.show(e.getComponent(), e.getX(), e.getY());
}
// END KGU#318 2017-01-05
Expand Down Expand Up @@ -1270,13 +1280,13 @@ public void mouseEntered(MouseEvent e) {
public void mouseExited(MouseEvent e) {
}

// START KGU#643 2019-01-28: Issue #670 - Update info box L&F (aren't members of the component tree)
// START KGU#643 2019-01-28: Issues #670, #674 - Update info box and popup menu L&F (aren't members of the component tree)
@Override
public void updateUI()
{
super.updateUI();
// Cater for the look and feel update of the info boxes.
for (Component comp: new Component[] {this.scrollInfo, this.pnlGroupInfo}) {
// Cater for the look and feel update of the info boxes (2019-02-04: #674 - popupIndex added).
for (Component comp: new Component[] {this.scrollInfo, this.pnlGroupInfo, this.popupIndex}) {
if (comp != null) {
try {
javax.swing.SwingUtilities.updateComponentTreeUI(comp);
Expand Down
8 changes: 5 additions & 3 deletions src/lu/fisch/structorizer/arranger/Group.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
* Kay Gürtzig 2019-01-05 Substantial tuning for enh. #657
* Kay Gürtzig 2019-01-09 Enhancements for issue #662/2 (drawing capability prepared)
* Kay Gürtzig 2019-01-25 Issue #668: More intelligent file name proposal for default group
* Kay Gürtzig 2019-02-04 Colour icon revised (now double thin border like in Arranger).
*
******************************************************************************************************
*
Expand Down Expand Up @@ -475,7 +476,7 @@ public Vector<Root> getSortedRoots()
* Updates the sorted list of {@link Root}s that can be retrieved with
* {@link #getSortedRoots()}.
* @param completely - if true then {@link #routines} will be computed from scratch,
* othewise it is only re-sorted.
* otherwise it is only re-sorted.
*/
protected void updateSortedRoots(boolean completely) {
if (completely) {
Expand Down Expand Up @@ -597,11 +598,12 @@ else if (getFile() != null) {
graphics.setColor(color);
graphics.fillRect(size + offset + margin , margin, size - offset - 2*margin, size - 2*margin);
graphics.setColor(Color.WHITE);
graphics.fillRect(size + offset + 3 * margin, 3 * margin, size - offset - 6*margin, size - 6*margin);
graphics.fillRect(size + offset + 1 + margin, 1 + margin, size - offset - 2 - 2*margin, size - 2 - 2*margin);
graphics.setColor(color);
graphics.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 0.0625f));
graphics.fillRect(size + offset + 3 * margin, 3 * margin, size - offset - 6*margin, size - 6*margin);
graphics.fillRect(size + offset + 1 + margin, 1 + margin, size - offset - 2 - 2*margin, size - 2 - 2*margin);
graphics.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER, 1f));
graphics.drawRect(size + offset + 2 + margin, 2 + margin, size - offset - 5 - 2*margin, size - 5 - 2*margin);
graphics.dispose();
iconColor = new ImageIcon(image);
}
Expand Down
Loading

0 comments on commit 5eafca0

Please sign in to comment.