Skip to content

Commit

Permalink
Remove redundant methods in XYScaledGraphics
Browse files Browse the repository at this point in the history
Both ScaledGraphics and XYScaledGraphics share the same Graphics
instance. Overwriting methods such as getAlpha(), which simply delegate
to this Graphics object, are therefore unnecessary.
  • Loading branch information
ptziegler authored and azoitl committed Oct 7, 2024
1 parent c4dc821 commit fa41058
Showing 1 changed file with 1 addition and 169 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2000, 2007 IBM Corporation and others.
* Copyright (c) 2000, 2024 IBM Corporation and others.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
Expand Down Expand Up @@ -417,28 +417,6 @@ public double getAbsoluteScale() {
return xZoom * graphics.getAbsoluteScale();
}

/**
* @see Graphics#getAlpha()
*/
@Override
public int getAlpha() {
return graphics.getAlpha();
}

/**
* @see Graphics#getAntialias()
*/
@Override
public int getAntialias() {
return graphics.getAntialias();
}

/** @see Graphics#getBackgroundColor() */
@Override
public Color getBackgroundColor() {
return graphics.getBackgroundColor();
}

Font getCachedFont(FontKey key) {
Font font = fontCache.get(key);
if (font != null) {
Expand Down Expand Up @@ -481,14 +459,6 @@ public Rectangle getClip(Rectangle rect) {
return rect;
}

/**
* @see Graphics#getFillRule()
*/
@Override
public int getFillRule() {
return graphics.getFillRule();
}

/** @see Graphics#getFont() */
@Override
public Font getFont() {
Expand All @@ -501,42 +471,6 @@ public FontMetrics getFontMetrics() {
return FigureUtilities.getFontMetrics(localFont);
}

/** @see Graphics#getForegroundColor() */
@Override
public Color getForegroundColor() {
return graphics.getForegroundColor();
}

/**
* @see Graphics#getInterpolation()
*/
@Override
public int getInterpolation() {
return graphics.getInterpolation();
}

/**
* @see Graphics#getLineCap()
*/
@Override
public int getLineCap() {
return graphics.getLineCap();
}

/**
* @see Graphics#getLineJoin()
*/
@Override
public int getLineJoin() {
return graphics.getLineJoin();
}

/** @see Graphics#getLineStyle() */
@Override
public int getLineStyle() {
return graphics.getLineStyle();
}

/** @see Graphics#getLineWidth() */
@Override
public int getLineWidth() {
Expand All @@ -551,20 +485,6 @@ private int getLocalLineWidth() {
return localLineWidth;
}

/**
* @see Graphics#getTextAntialias()
*/
@Override
public int getTextAntialias() {
return graphics.getTextAntialias();
}

/** @see Graphics#getXORMode() */
@Override
public boolean getXORMode() {
return graphics.getXORMode();
}

/** @see Graphics#popState() */
@Override
public void popState() {
Expand Down Expand Up @@ -615,92 +535,18 @@ public void scale(double amount) {
throw new UnsupportedOperationException("Operation not supported, use scale(x, y)"); //$NON-NLS-1$
}

/**
* @see Graphics#setAlpha(int)
*/
@Override
public void setAlpha(int alpha) {
graphics.setAlpha(alpha);
}

/**
* @see Graphics#setAntialias(int)
*/
@Override
public void setAntialias(int value) {
graphics.setAntialias(value);
}

/** @see Graphics#setBackgroundColor(Color) */
@Override
public void setBackgroundColor(Color rgb) {
graphics.setBackgroundColor(rgb);
}

/** @see Graphics#setClip(Rectangle) */
@Override
public void setClip(Rectangle r) {
graphics.setClip(zoomClipRect(r));
}

/**
* @see Graphics#setFillRule(int)
*/
@Override
public void setFillRule(int rule) {
graphics.setFillRule(rule);
}

/** @see Graphics#setFont(Font) */
@Override
public void setFont(Font f) {
setLocalFont(f);
}

/** @see Graphics#setForegroundColor(Color) */
@Override
public void setForegroundColor(Color rgb) {
graphics.setForegroundColor(rgb);
}

/**
* @see org.eclipse.draw2d.Graphics#setInterpolation(int)
*/
@Override
public void setInterpolation(int interpolation) {
graphics.setInterpolation(interpolation);
}

/**
* @see Graphics#setLineCap(int)
*/
@Override
public void setLineCap(int cap) {
graphics.setLineCap(cap);
}

/**
* @see Graphics#setLineDash(int[])
*/
@Override
public void setLineDash(int[] dash) {
graphics.setLineDash(dash);
}

/**
* @see Graphics#setLineJoin(int)
*/
@Override
public void setLineJoin(int join) {
graphics.setLineJoin(join);
}

/** @see Graphics#setLineStyle(int) */
@Override
public void setLineStyle(int style) {
graphics.setLineStyle(style);
}

/** @see Graphics#setLineWidth(int) */
@Override
public void setLineWidth(int width) {
Expand Down Expand Up @@ -737,20 +583,6 @@ void setScale(double value) {
*/
}

/**
* @see Graphics#setTextAntialias(int)
*/
@Override
public void setTextAntialias(int value) {
graphics.setTextAntialias(value);
}

/** @see Graphics#setXORMode(boolean) */
@Override
public void setXORMode(boolean b) {
graphics.setXORMode(b);
}

/** @see Graphics#translate(int, int) */
@Override
public void translate(int dx, int dy) {
Expand Down

0 comments on commit fa41058

Please sign in to comment.