Java Reference
In-Depth Information
erase();
myRadius = Math.abs(radius);
bounds =
null
;
repaint();
}
public void
setLineWidth(
int
width) {
super
.setLineWidth(width);
}
public
Rectangle getBounds() {
if
(bounds ==
null
) {
int
diameter = myRadius * 2;
bounds =
new
Rectangle(myCenter.x - myRadius,
myCenter.y - myRadius, diameter, diameter);
bounds.expand(lineWidth / 2, lineWidth / 2);
}
return
bounds;
}
public void
setLocation(Point p) {
if
(myCenter.equals(p)) {
return
;
}
myCenter.setLocation(p);
bounds =
null
;
}
public void
setReferencePoint(Point p) {
// ignore, does not make sense to rotate circle
}
}
To use this figure, we'll create a new
Custom Decoration
in our figure
gallery named
CircleDecoration
with a
Qualified Class Name
of
org.
eclipse.mindmap.diagram.figures.CircleDecoration
. In the
Source
Decoration
property of our
TopicSubtopicsFigure
, we'll select this deco-
rator and then regenerate our
mindmap.gmfgen
model from our
mindmap.
gmfmap
file.
Adding a Subtopic Action
Adding new subtopics to our mindmap is not very convenient right now. The
mouse and palette are required to first create a
Topic
and then a connection,
seriously impeding our “brainstorming” ability. We want to use the keyboard as
much as possible to add and insert new
Topic
elements. Adding keyboard short-
cuts and menu items to elements involves straightforward Eclipse platform code
that we can add to our customization plug-in. Note that here we don't use the
contributionItemProviders
extension-point that the runtime provides
Search WWH ::
Custom Search