Skip to content

Commit

Permalink
added edge width editing into options, small improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
raydac committed Oct 7, 2015
1 parent 1164557 commit 5922a3d
Show file tree
Hide file tree
Showing 10 changed files with 190 additions and 133 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
<Group type="102" alignment="0" attributes="0">
<EmptySpace max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="textLabel" max="32767" attributes="0"/>
<Component id="textLabel" pref="319" max="32767" attributes="0"/>
<Group type="102" attributes="0">
<Component id="labelIcon" min="-2" max="-2" attributes="0"/>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mind-map/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

<modules>
<module>mind-map-model</module>
<module>nb-mind-map</module>
<module>mind-map-swing-panel</module>
<module>nb-mind-map</module>
</modules>

<developers>
Expand Down

0 comments on commit 5922a3d

Please sign in to comment.