From 5922a3d9da968886b48e944d02b43270d2d958de Mon Sep 17 00:00:00 2001 From: Igor Maznitsa Date: Wed, 7 Oct 2015 23:59:03 +0300 Subject: [PATCH] added edge width editing into options, small improvements --- .../mindmap/swing/panel/MindMapPanel.java | 10 +- .../swing/panel/ui/ElementLevelFirst.java | 3 +- .../swing/panel/ui/ElementLevelOther.java | 7 - .../mindmap/swing/panel/ui/ElementRoot.java | 3 +- .../nbmindmap/nb/options/MMDCfgPanel.form | 150 +++++++++++------- .../nbmindmap/nb/options/MMDCfgPanel.java | 143 ++++++++++------- .../nbmindmap/nb/swing/AboutPanel.form | 2 +- .../nbmindmap/nb/swing/AboutPanel.java | 2 +- .../nbmindmap/i18n/Bundle.properties | 1 + mind-map/pom.xml | 2 +- 10 files changed, 190 insertions(+), 133 deletions(-) diff --git a/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/MindMapPanel.java b/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/MindMapPanel.java index 9d153e652..3ec1b149a 100644 --- a/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/MindMapPanel.java +++ b/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/MindMapPanel.java @@ -1277,13 +1277,17 @@ private static void drawSelection(final Graphics2D g, final MindMapPanelConfig c g.setColor(cfg.getSelectLineColor()); final Stroke dashed = new BasicStroke(cfg.safeScaleFloatValue(cfg.getSelectLineWidth(), 0.1f), BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 0, new float[]{cfg.safeScaleFloatValue(1.0f, 0.1f), cfg.safeScaleFloatValue(4.0f, 0.1f)}, 0); g.setStroke(dashed); - final double selectLineGap = cfg.getSelectLineGap() * cfg.getScale(); - final double dblLineGap = selectLineGap * 2.0d; + final double selectLineGap = (double)cfg.safeScaleFloatValue(cfg.getSelectLineGap(),0.05f); + final double selectLineGapX2 = selectLineGap + selectLineGap; for (final Topic s : selectedTopics) { final AbstractElement e = (AbstractElement) s.getPayload(); if (e != null) { - g.drawRect((int) Math.round(e.getBounds().getX() - selectLineGap), (int) Math.round(e.getBounds().getY() - selectLineGap), (int) Math.round(e.getBounds().getWidth() + dblLineGap), (int) Math.round(e.getBounds().getHeight() + dblLineGap)); + final int x = (int) Math.round(e.getBounds().getX() - selectLineGap); + final int y = (int) Math.round(e.getBounds().getY() - selectLineGap); + final int w = (int) Math.round(e.getBounds().getWidth() + selectLineGapX2); + final int h = (int) Math.round(e.getBounds().getHeight()+ selectLineGapX2); + g.drawRect(x,y,w,h); } } } diff --git a/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/ui/ElementLevelFirst.java b/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/ui/ElementLevelFirst.java index 7d2e98899..15e288e92 100644 --- a/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/ui/ElementLevelFirst.java +++ b/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/ui/ElementLevelFirst.java @@ -39,8 +39,7 @@ public AbstractElement makeCopy() { } protected Shape makeShape(final MindMapPanelConfig cfg, final float x, final float y) { - final float border = cfg.safeScaleFloatValue(cfg.getElementBorderWidth(), 0.5f); - return new Rectangle2D.Float(x, y, (float) this.bounds.getWidth() - border, (float) this.bounds.getHeight() - border); + return new Rectangle2D.Float(x, y, (float) this.bounds.getWidth(), (float) this.bounds.getHeight()); } @Override diff --git a/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/ui/ElementLevelOther.java b/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/ui/ElementLevelOther.java index 4778c680c..7e25233e1 100644 --- a/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/ui/ElementLevelOther.java +++ b/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/ui/ElementLevelOther.java @@ -38,13 +38,6 @@ public AbstractElement makeCopy() { return new ElementLevelOther(this); } - - @Override - protected Shape makeShape(final MindMapPanelConfig cfg, final float x, final float y) { - final float border = cfg.safeScaleFloatValue(cfg.getElementBorderWidth(), 0.5f); - return new Rectangle2D.Float(x, y, (float) this.bounds.getWidth() - border, (float) this.bounds.getHeight() - border); - } - @Override public void drawComponent(final Graphics2D g, final MindMapPanelConfig cfg) { g.setStroke(new BasicStroke(cfg.safeScaleFloatValue(cfg.getElementBorderWidth(),0.1f))); diff --git a/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/ui/ElementRoot.java b/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/ui/ElementRoot.java index fda5430d0..359efde4b 100644 --- a/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/ui/ElementRoot.java +++ b/mind-map/mind-map-swing-panel/src/main/java/com/igormaznitsa/mindmap/swing/panel/ui/ElementRoot.java @@ -64,8 +64,7 @@ public boolean isCollapsed() { private Shape makeShape(final MindMapPanelConfig cfg, final float x, final float y) { final float round = cfg.safeScaleFloatValue(10.0f, 0.1f); - final float border = cfg.safeScaleFloatValue(cfg.getElementBorderWidth(), 0.5f); - return new RoundRectangle2D.Float(x, y, (float) this.bounds.getWidth()-border, (float) this.bounds.getHeight()-border, round, round); + return new RoundRectangle2D.Float(x, y, (float) this.bounds.getWidth(), (float) this.bounds.getHeight(), round, round); } @Override diff --git a/mind-map/nb-mind-map/src/main/java/com/igormaznitsa/nbmindmap/nb/options/MMDCfgPanel.form b/mind-map/nb-mind-map/src/main/java/com/igormaznitsa/nbmindmap/nb/options/MMDCfgPanel.form index 099dbf33d..9a6a84dfc 100644 --- a/mind-map/nb-mind-map/src/main/java/com/igormaznitsa/nbmindmap/nb/options/MMDCfgPanel.form +++ b/mind-map/nb-mind-map/src/main/java/com/igormaznitsa/nbmindmap/nb/options/MMDCfgPanel.form @@ -12,7 +12,7 @@ - + @@ -51,20 +51,18 @@ - + - - - - - - - - - - - + + + + + + + + + @@ -87,45 +85,49 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - + + - + + + + + + + + - - + + + + + + + + + + + + + + - - - + + + + + + + + + + @@ -412,26 +414,31 @@ + + + + + + - - - - - - - - - - - - + + + + + + + - + + + + + - + @@ -467,8 +474,13 @@ - + + + + + + @@ -650,7 +662,6 @@ - @@ -668,6 +679,23 @@ + + + + + + + + + + + + + + + + + @@ -811,7 +839,7 @@ - + diff --git a/mind-map/nb-mind-map/src/main/java/com/igormaznitsa/nbmindmap/nb/options/MMDCfgPanel.java b/mind-map/nb-mind-map/src/main/java/com/igormaznitsa/nbmindmap/nb/options/MMDCfgPanel.java index 8ddb5a03c..1db74f18e 100644 --- a/mind-map/nb-mind-map/src/main/java/com/igormaznitsa/nbmindmap/nb/options/MMDCfgPanel.java +++ b/mind-map/nb-mind-map/src/main/java/com/igormaznitsa/nbmindmap/nb/options/MMDCfgPanel.java @@ -90,6 +90,8 @@ private void initComponents() { slider2ndLevelVertGap = new javax.swing.JSlider(); jPanel7 = new javax.swing.JPanel(); buttonFont = new javax.swing.JButton(); + labelBorderWidth = new javax.swing.JLabel(); + spinnerElementBorderWidth = new javax.swing.JSpinner(); jPanel1 = new javax.swing.JPanel(); checkboxUseInsideBrowser = new javax.swing.JCheckBox(); checkboxRelativePathsForFilesInTheProject = new javax.swing.JCheckBox(); @@ -177,42 +179,46 @@ public void stateChanged(javax.swing.event.ChangeEvent evt) { jPanel3Layout.setHorizontalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel3Layout.createSequentialGroup() - .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addContainerGap() .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() - .addComponent(colorChooserJumpLink, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(colorChooserConnectorColor, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() - .addComponent(colorChooserCollapsatorBackground, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(colorChooserCollapsatorBorder, javax.swing.GroupLayout.PREFERRED_SIZE, 155, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() - .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addComponent(jLabel7) - .addComponent(jLabel2)) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addComponent(spinnerJumpLinkWidth) - .addComponent(spinnerConnectorWidth, javax.swing.GroupLayout.DEFAULT_SIZE, 158, Short.MAX_VALUE)))) .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() - .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) - .addGroup(jPanel3Layout.createSequentialGroup() - .addComponent(jLabel5) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)) - .addGroup(jPanel3Layout.createSequentialGroup() - .addComponent(jLabel6) - .addGap(12, 12, 12))) - .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addComponent(spinnerCollapsatorSize, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 151, Short.MAX_VALUE) - .addComponent(spinnerCollapsatorWidth, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 151, Short.MAX_VALUE)))) + .addGap(0, 0, Short.MAX_VALUE) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addComponent(jLabel7) + .addComponent(jLabel2)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(spinnerJumpLinkWidth) + .addComponent(spinnerConnectorWidth, javax.swing.GroupLayout.DEFAULT_SIZE, 158, Short.MAX_VALUE))) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) + .addGroup(jPanel3Layout.createSequentialGroup() + .addComponent(jLabel5) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)) + .addGroup(jPanel3Layout.createSequentialGroup() + .addComponent(jLabel6) + .addGap(12, 12, 12))) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(spinnerCollapsatorSize, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 151, Short.MAX_VALUE) + .addComponent(spinnerCollapsatorWidth, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 151, Short.MAX_VALUE))))) + .addGroup(jPanel3Layout.createSequentialGroup() + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) + .addComponent(colorChooserJumpLink, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(colorChooserCollapsatorBackground, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(colorChooserCollapsatorBorder, javax.swing.GroupLayout.PREFERRED_SIZE, 222, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(colorChooserConnectorColor, javax.swing.GroupLayout.PREFERRED_SIZE, 222, javax.swing.GroupLayout.PREFERRED_SIZE)))) .addContainerGap()) ); jPanel3Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {spinnerCollapsatorSize, spinnerCollapsatorWidth, spinnerConnectorWidth}); - jPanel3Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {colorChooserCollapsatorBackground, colorChooserCollapsatorBorder, colorChooserConnectorColor}); + jPanel3Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {colorChooserCollapsatorBackground, colorChooserJumpLink}); + + jPanel3Layout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {colorChooserCollapsatorBorder, colorChooserConnectorColor}); jPanel3Layout.setVerticalGroup( jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) @@ -452,11 +458,19 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { jPanel7Layout.setVerticalGroup( jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel7Layout.createSequentialGroup() - .addContainerGap() .addComponent(buttonFont) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); + labelBorderWidth.setText(bundle.getString("MMDCfgPanel.labelBorderWidth.text")); // NOI18N + + spinnerElementBorderWidth.setModel(new javax.swing.SpinnerNumberModel(Float.valueOf(0.5f), Float.valueOf(0.05f), Float.valueOf(50.0f), Float.valueOf(0.1f))); + spinnerElementBorderWidth.addChangeListener(new javax.swing.event.ChangeListener() { + public void stateChanged(javax.swing.event.ChangeEvent evt) { + spinnerElementBorderWidthStateChanged(evt); + } + }); + javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2); jPanel2.setLayout(jPanel2Layout); jPanel2Layout.setHorizontalGroup( @@ -469,22 +483,26 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addComponent(slider2ndLevelHorzGap, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(slider2ndLevelVertGap, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup() + .addGap(0, 0, Short.MAX_VALUE) + .addComponent(labelBorderWidth) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(spinnerElementBorderWidth, javax.swing.GroupLayout.PREFERRED_SIZE, 161, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(jPanel2Layout.createSequentialGroup() .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addGroup(jPanel2Layout.createSequentialGroup() - .addComponent(colorChooserRootBackground, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(colorChooserRootText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addGroup(jPanel2Layout.createSequentialGroup() - .addComponent(colorChooser1stBackground, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(colorChooser1stText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addComponent(checkBoxDropShadow) .addGroup(jPanel2Layout.createSequentialGroup() - .addComponent(colorChooser2ndBackground, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addGap(23, 23, 23) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) + .addComponent(colorChooser1stBackground, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(colorChooserRootBackground, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) + .addComponent(colorChooser2ndBackground, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(colorChooser2ndText, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))) - .addGap(0, 69, Short.MAX_VALUE))) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addComponent(colorChooser1stText, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 172, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(colorChooserRootText, javax.swing.GroupLayout.PREFERRED_SIZE, 172, javax.swing.GroupLayout.PREFERRED_SIZE) + .addComponent(colorChooser2ndText, javax.swing.GroupLayout.PREFERRED_SIZE, 172, javax.swing.GroupLayout.PREFERRED_SIZE)))) + .addGap(0, 0, Short.MAX_VALUE))) .addContainerGap()) ); @@ -516,10 +534,16 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(slider2ndLevelVertGap, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) - .addContainerGap()) + .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER) + .addComponent(labelBorderWidth) + .addComponent(spinnerElementBorderWidth, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jPanel7, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); + jPanel2Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {labelBorderWidth, spinnerElementBorderWidth}); + jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(bundle.getString("MMDCfgPanel.jPanel1.border.title"))); // NOI18N checkboxUseInsideBrowser.setText(bundle.getString("MMDCfgPanel.checkboxUseInsideBrowser.text")); // NOI18N @@ -632,7 +656,7 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(spinnerSelectLineGap, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel4)) - .addContainerGap(24, Short.MAX_VALUE)) + .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel5Layout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jLabel3, spinnerSelectLineWidth}); @@ -668,18 +692,17 @@ public void actionPerformed(java.awt.event.ActionEvent evt) { jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel6Layout.createSequentialGroup() .addContainerGap() - .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) + .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(buttonAbout) - .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) - .addGroup(jPanel6Layout.createSequentialGroup() - .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) - .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) - .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) - .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) + .addGroup(jPanel6Layout.createSequentialGroup() + .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) + .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) + .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) + .addComponent(jPanel2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); @@ -899,6 +922,12 @@ private void checkBoxKnowledgeFolderAutogenerationAllowedActionPerformed(java.aw } }//GEN-LAST:event_checkBoxKnowledgeFolderAutogenerationAllowedActionPerformed + private void spinnerElementBorderWidthStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spinnerElementBorderWidthStateChanged + if (changeNotificationAllowed) { + this.controller.changed(); + } + }//GEN-LAST:event_spinnerElementBorderWidthStateChanged + void load() { this.config.loadFrom(NbUtils.getPreferences()); @@ -928,6 +957,7 @@ void load() { this.spinnerJumpLinkWidth.setValue(this.config.getJumpLinkWidth()); this.spinnerCollapsatorWidth.setValue(this.config.getCollapsatorBorderWidth()); this.spinnerCollapsatorSize.setValue(this.config.getCollapsatorSize()); + this.spinnerElementBorderWidth.setValue(this.config.getElementBorderWidth()); this.colorChooserCollapsatorBackground.setValue(this.config.getCollapsatorBackgroundColor()); this.colorChooserCollapsatorBorder.setValue(this.config.getCollapsatorBorderColor()); @@ -978,6 +1008,7 @@ void store() { this.config.setJumpLinkWidth((Float) this.spinnerJumpLinkWidth.getValue()); this.config.setSelectLineWidth((Float) this.spinnerSelectLineWidth.getValue()); this.config.setCollapsatorBorderWidth((Float) this.spinnerCollapsatorWidth.getValue()); + this.config.setElementBorderWidth((Float) this.spinnerElementBorderWidth.getValue()); this.config.setFirstLevelHorizontalInset(this.slider1stLevelHorzGap.getValue()); this.config.setFirstLevelVerticalInset(this.slider1stLevelVertGap.getValue()); @@ -1040,6 +1071,7 @@ boolean valid() { private javax.swing.JPanel jPanel6; private javax.swing.JPanel jPanel7; private javax.swing.JScrollPane jScrollPane1; + private javax.swing.JLabel labelBorderWidth; private javax.swing.JSlider slider1stLevelHorzGap; private javax.swing.JSlider slider1stLevelVertGap; private javax.swing.JSlider slider2ndLevelHorzGap; @@ -1047,6 +1079,7 @@ boolean valid() { private javax.swing.JSpinner spinnerCollapsatorSize; private javax.swing.JSpinner spinnerCollapsatorWidth; private javax.swing.JSpinner spinnerConnectorWidth; + private javax.swing.JSpinner spinnerElementBorderWidth; private javax.swing.JSpinner spinnerGridStep; private javax.swing.JSpinner spinnerJumpLinkWidth; private javax.swing.JSpinner spinnerSelectLineGap; diff --git a/mind-map/nb-mind-map/src/main/java/com/igormaznitsa/nbmindmap/nb/swing/AboutPanel.form b/mind-map/nb-mind-map/src/main/java/com/igormaznitsa/nbmindmap/nb/swing/AboutPanel.form index 507338a3a..eedd9628b 100644 --- a/mind-map/nb-mind-map/src/main/java/com/igormaznitsa/nbmindmap/nb/swing/AboutPanel.form +++ b/mind-map/nb-mind-map/src/main/java/com/igormaznitsa/nbmindmap/nb/swing/AboutPanel.form @@ -31,7 +31,7 @@ - + diff --git a/mind-map/nb-mind-map/src/main/java/com/igormaznitsa/nbmindmap/nb/swing/AboutPanel.java b/mind-map/nb-mind-map/src/main/java/com/igormaznitsa/nbmindmap/nb/swing/AboutPanel.java index 0de36f5db..c9acdf642 100644 --- a/mind-map/nb-mind-map/src/main/java/com/igormaznitsa/nbmindmap/nb/swing/AboutPanel.java +++ b/mind-map/nb-mind-map/src/main/java/com/igormaznitsa/nbmindmap/nb/swing/AboutPanel.java @@ -93,7 +93,7 @@ private void initComponents() { .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) - .addComponent(textLabel) + .addComponent(textLabel, javax.swing.GroupLayout.DEFAULT_SIZE, 319, Short.MAX_VALUE) .addGroup(layout.createSequentialGroup() .addComponent(labelIcon) .addGap(0, 0, Short.MAX_VALUE))) diff --git a/mind-map/nb-mind-map/src/main/resources/com/igormaznitsa/nbmindmap/i18n/Bundle.properties b/mind-map/nb-mind-map/src/main/resources/com/igormaznitsa/nbmindmap/i18n/Bundle.properties index f91b59d2e..551ba768a 100644 --- a/mind-map/nb-mind-map/src/main/resources/com/igormaznitsa/nbmindmap/i18n/Bundle.properties +++ b/mind-map/nb-mind-map/src/main/resources/com/igormaznitsa/nbmindmap/i18n/Bundle.properties @@ -160,6 +160,7 @@ MMDCfgPanel.jPanel5.border.title=Selection frame MMDCfgPanel.colorChooserSelectLine.text=Select frame color MMDCfgPanel.colorChooserGridColor.text=Grid color MMDCfgPanel.checkBoxKnowledgeFolderAutogenerationAllowed.text=Enable autocreation .projectKnowledge folder +MMDCfgPanel.labelBorderWidth.text=Border width: # ColorAttributePanel ColorAttributePanel.colorChooserBorder.text=Border color diff --git a/mind-map/pom.xml b/mind-map/pom.xml index 5db31709b..87f07d93f 100644 --- a/mind-map/pom.xml +++ b/mind-map/pom.xml @@ -14,8 +14,8 @@ mind-map-model - nb-mind-map mind-map-swing-panel + nb-mind-map