fix for drawing area and optimization

This commit is contained in:
bancika
2011-03-02 18:13:34 +00:00
parent 085732fb2c
commit d89a500a5f
3 changed files with 15 additions and 10 deletions
@@ -102,6 +102,9 @@ public abstract class AbstractCurvedComponent<T> extends AbstractTransparentComp
@EditableProperty(name = "Point Count")
public PointCount getPointCount() {
if (pointCount == null) {
pointCount = PointCount.FOUR;
}
return pointCount;
}
@@ -115,7 +118,7 @@ public abstract class AbstractCurvedComponent<T> extends AbstractTransparentComp
@Override
public int getControlPointCount() {
switch (pointCount) {
switch (getPointCount()) {
case TWO:
return 2;
case THREE:
@@ -139,7 +142,7 @@ public abstract class AbstractCurvedComponent<T> extends AbstractTransparentComp
@Override
public boolean canControlPointOverlap(int index) {
// Only shape control points may overlap.
switch (pointCount) {
switch (getPointCount()) {
case TWO:
return false;
case THREE:
@@ -155,7 +158,7 @@ public abstract class AbstractCurvedComponent<T> extends AbstractTransparentComp
if (index == 0) {
return controlPoints[0];
}
switch (pointCount) {
switch (getPointCount()) {
case TWO:
switch (index) {
case 1:
@@ -186,7 +189,7 @@ public abstract class AbstractCurvedComponent<T> extends AbstractTransparentComp
if (index == 0) {
controlPoints[0].setLocation(point);
} else {
switch (pointCount) {
switch (getPointCount()) {
case TWO:
switch (index) {
case 1:
@@ -66,9 +66,6 @@ public abstract class AbstractLeadedComponent<T> extends AbstractTransparentComp
Shape shape = getBodyShape();
// If there's no body, just draw the line connecting the ending points.
if (shape == null) {
if (checkPointsClipped(g2d.getClip())) {
return;
}
drawLead(g2d, componentState);
} else if (supportsStandingMode()
&& length.convertToPixels() > points[0].distance(points[1])) {