Skip to content

Commit

Permalink
[Clean-up] added missing @OverRide annotations
Browse files Browse the repository at this point in the history
Using Eclipse IDE's quickfix all missing @OverRide annotations where
added.
  • Loading branch information
azoitl committed Aug 15, 2023
1 parent f144464 commit 92f2b8e
Show file tree
Hide file tree
Showing 485 changed files with 2,931 additions and 183 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
*******************************************************************************/
package org.eclipse.draw2d.examples.zoom;

import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

import org.eclipse.draw2d.ButtonBorder;
import org.eclipse.draw2d.Figure;
import org.eclipse.draw2d.GroupBoxBorder;
Expand All @@ -22,11 +28,6 @@
import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.draw2d.parts.Thumbnail;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;

/**
* This class demonstrates Draw2d's zoom capabilities.
Expand All @@ -37,7 +38,7 @@
public class ZoomExample {

private static Figure contents;
//private static Shell overviewShell;
// private static Shell overviewShell;

public static void main(String args[]) {
Display d = new Display();
Expand All @@ -49,7 +50,7 @@ public static void main(String args[]) {
fig.setLayoutManager(new ToolbarLayout());

final ScrollBar bar = new ScrollBar();
final Label l = new Label("Zoom"); //$NON-NLS-1$
final Label l = new Label("< Zoom >"); //$NON-NLS-1$

l.setBorder(new SchemeBorder(ButtonBorder.SCHEMES.BUTTON_SCROLLBAR));
bar.setThumb(l);
Expand All @@ -75,21 +76,20 @@ public static void main(String args[]) {

lws.setContents(fig);

// overviewShell = new Shell(shell, SWT.TITLE| SWT.RESIZE | SWT.NO_REDRAW_RESIZE | SWT.NO_BACKGROUND);
// overviewShell.setText("Overview Shell");
// overviewShell.setLayout(new FillLayout());
// LightweightSystem overviewLWS = new LightweightSystem(overviewShell);
// overviewLWS.setContents(createThumbnail(getContents()));
// overviewShell.setSize(200, 200);
// overviewShell = new Shell(shell, SWT.TITLE| SWT.RESIZE | SWT.NO_REDRAW_RESIZE
// | SWT.NO_BACKGROUND);
// overviewShell.setText("Overview Shell");
// overviewShell.setLayout(new FillLayout());
// LightweightSystem overviewLWS = new LightweightSystem(overviewShell);
// overviewLWS.setContents(createThumbnail(getContents()));
// overviewShell.setSize(200, 200);

shell.open();
// overviewShell.open();
while (!shell.isDisposed())
{
while (!d.readAndDispatch())
{
// overviewShell.open();
while (!shell.isDisposed()) {
while (!d.readAndDispatch()) {
d.sleep();
// overviewShell.dispose();
// overviewShell.dispose();
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ static class TestBorder extends AbstractFlowBorder {
this.insets = insets;
}

@Override
public Insets getInsets(IFigure figure) {
return insets;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ private void assertImageEquality(int width, int height) {
private void displayImage() {
final Shell shell = new Shell(SWT.DIALOG_TRIM);
shell.addPaintListener(new PaintListener() {
@Override
public void paintControl(PaintEvent e) {
e.gc.drawImage(image, 0, 0);
}
Expand All @@ -79,6 +80,7 @@ public void paintControl(PaintEvent e) {
shell.open();
Display d = shell.getDisplay();
d.asyncExec(new Runnable() {
@Override
public void run() {
if (!shell.isDisposed())
shell.close();
Expand Down Expand Up @@ -151,6 +153,7 @@ class AntialiasSettings implements Runnable {
this.color = color;
}

@Override
public void run() {
g.setAntialias(normal);
g.setTextAntialias(text);
Expand All @@ -167,6 +170,7 @@ public void run() {
tests[2] = new AntialiasSettings(SWT.DEFAULT, SWT.ON, ColorConstants.black);
tests[3] = new AntialiasSettings(SWT.ON, SWT.DEFAULT, ColorConstants.darkGreen);
performTestcase(new Runnable() {
@Override
public void run() {
g.drawPolyline(LINE);
g.drawString("OWVO", 35, 20);
Expand All @@ -186,6 +190,7 @@ class FillRules implements Runnable {
this.aa = aa;
}

@Override
public void run() {
g.setFillRule(rule);
// $TODO
Expand All @@ -200,6 +205,7 @@ public void run() {
tests[1] = new FillRules(SWT.FILL_WINDING, SWT.OFF);
tests[2] = new FillRules(SWT.FILL_EVEN_ODD, SWT.DEFAULT);
performTestcase(new Runnable() {
@Override
public void run() {
g.fillPolygon(POLY);
}
Expand Down Expand Up @@ -245,6 +251,7 @@ class LineSettings implements Runnable {
this.style = style;
}

@Override
public void run() {
g.setLineCap(cap);
g.setLineJoin(join);
Expand All @@ -260,6 +267,7 @@ public void run() {
new LineSettings(SWT.JOIN_ROUND, SWT.CAP_SQUARE, SWT.LINE_SOLID) };

performTestcase(new Runnable() {
@Override
public void run() {
g.drawPolyline(LINE);
}
Expand All @@ -281,6 +289,7 @@ public LineSettings(LineAttributes attributes) {
this.attributes = attributes;
}

@Override
public void run() {
g.setLineAttributes(attributes);
}
Expand All @@ -301,6 +310,7 @@ public void run() {
new LineAttributes(9.5f, SWT.CAP_FLAT, SWT.JOIN_ROUND, SWT.LINE_CUSTOM, dash, 5, 10)), };

performTestcase(new Runnable() {
@Override
public void run() {
g.drawPolyline(LINE);
}
Expand Down Expand Up @@ -402,6 +412,7 @@ class SetPattern implements Runnable {
this.fg = fg;
}

@Override
public void run() {
g.setBackgroundPattern(bg);
g.setForegroundPattern(fg);
Expand All @@ -424,6 +435,7 @@ public void run() {
Runnable tests[] = new Runnable[1];
tests[0] = new SetPattern(image, gradient);
performTestcase(new Runnable() {
@Override
public void run() {
g.fillText("W", 0, 0);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ public class TestPolylineConnection extends PolylineConnection {
/**
* @see org.eclipse.draw2d.PolylineConnection#anchorMoved(org.eclipse.draw2d.ConnectionAnchor)
*/
@Override
public void anchorMoved(ConnectionAnchor anchor) {
super.anchorMoved(anchor);
count++;
Expand All @@ -67,6 +68,7 @@ public void anchorMoved(ConnectionAnchor anchor) {
private LocalCoordinates nestedCoordinates;

public class LocalCoordinates extends Figure {
@Override
protected boolean useLocalCoordinates() {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public void test_ColorConstantInit() {
result[1] = Boolean.FALSE;

Thread testThread = new Thread() {
@Override
public void run() {
try {
Class.forName("org.eclipse.draw2d.ColorConstants");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Alexander Ny�en (itemis AG) - initial API and implementation
* Alexander Nyßen (itemis AG) - initial API and implementation
*******************************************************************************/
package org.eclipse.draw2d.test;

import org.eclipse.swt.graphics.Image;

import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.swt.graphics.Image;

import org.junit.Test;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public void testContainsPointInLayer() {

public class MyLayer extends Layer {

@Override
protected boolean useLocalCoordinates() {
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ public void testLineStyleBackwardsCompatibility() {
attributes.style = SWT.LINE_DASHDOT;
Shape shape = new Shape() {

@Override
protected void fillShape(Graphics graphics) {
// NOTHING TO DO
}

@Override
protected void outlineShape(Graphics graphics) {
// NOTHING TO DO
}
Expand All @@ -44,10 +46,12 @@ public void testLineWidthBackwardsCompatibility() {
LineAttributes attributes = new LineAttributes(4);
Shape shape = new Shape() {

@Override
protected void fillShape(Graphics graphics) {
// NOTHING TO DO
}

@Override
protected void outlineShape(Graphics graphics) {
// NOTHING TO DO
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
public class ThumbnailTest extends Assert {

class TestThumbnail extends Thumbnail {
@Override
public Image getThumbnailImage() {
return super.getThumbnailImage();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public AbsoluteBendpoint(int x, int y) {
/**
* @see org.eclipse.draw2d.Bendpoint#getLocation()
*/
@Override
public Point getLocation() {
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public class AbstractBackground extends AbstractBorder {
/**
* {@inheritDoc}
*/
@Override
public Insets getInsets(IFigure figure) {
return IFigure.NO_INSETS;
}
Expand All @@ -36,6 +37,7 @@ public Insets getInsets(IFigure figure) {
* {@inheritDoc} By default, this method is stubbed out for backgrounds which
* only paint underneath a figure.
*/
@Override
public void paint(IFigure figure, Graphics graphics, Insets insets) {
}

Expand Down
2 changes: 2 additions & 0 deletions org.eclipse.draw2d/src/org/eclipse/draw2d/AbstractBorder.java
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,15 @@ protected static final Rectangle getPaintRectangle(IFigure figure, Insets insets
/**
* @see org.eclipse.draw2d.Border#getPreferredSize(IFigure)
*/
@Override
public Dimension getPreferredSize(IFigure f) {
return EMPTY;
}

/**
* @see org.eclipse.draw2d.Border#isOpaque()
*/
@Override
public boolean isOpaque() {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public AbstractConnectionAnchor(IFigure owner) {
* @param listener Listener to be added
* @see #removeAnchorListener(AnchorListener)
*/
@Override
public void addAnchorListener(AnchorListener listener) {
if (listener == null)
return;
Expand All @@ -62,19 +63,22 @@ public void addAnchorListener(AnchorListener listener) {
* @param figure Anchor-owning Figure which has moved
* @see org.eclipse.draw2d.AncestorListener#ancestorMoved(IFigure)
*/
@Override
public void ancestorMoved(IFigure figure) {
fireAnchorMoved();
}

/**
* @see org.eclipse.draw2d.AncestorListener#ancestorAdded(IFigure)
*/
@Override
public void ancestorAdded(IFigure ancestor) {
}

/**
* @see org.eclipse.draw2d.AncestorListener#ancestorRemoved(IFigure)
*/
@Override
public void ancestorRemoved(IFigure ancestor) {
}

Expand All @@ -85,6 +89,7 @@ public void ancestorRemoved(IFigure ancestor) {
* @return Owner of this anchor
* @see #setOwner(IFigure)
*/
@Override
public IFigure getOwner() {
return owner;
}
Expand All @@ -98,6 +103,7 @@ public IFigure getOwner() {
* @return The reference point of this anchor
* @see org.eclipse.draw2d.ConnectionAnchor#getReferencePoint()
*/
@Override
public Point getReferencePoint() {
if (getOwner() == null)
return null;
Expand All @@ -116,6 +122,7 @@ public Point getReferencePoint() {
* @param listener Listener to be removed from this anchors listeners list
* @see #addAnchorListener(AnchorListener)
*/
@Override
public void removeAnchorListener(AnchorListener listener) {
super.removeAnchorListener(listener);
if (listeners.size() == 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ protected Dimension calculateMinimumSize(IFigure container, int wHint, int hHint
/**
* @see org.eclipse.draw2d.LayoutManager#getMinimumSize(IFigure, int, int)
*/
@Override
public Dimension getMinimumSize(IFigure container, int w, int h) {
boolean flush = cachedMinimumHint.width != w && isSensitiveHorizontally(container);
flush |= cachedMinimumHint.height != h && isSensitiveVertically(container);
Expand All @@ -71,6 +72,7 @@ public Dimension getMinimumSize(IFigure container, int w, int h) {
/**
* @see org.eclipse.draw2d.LayoutManager#getPreferredSize(IFigure, int, int)
*/
@Override
public final Dimension getPreferredSize(IFigure container, int w, int h) {
boolean flush = cachedPreferredHint.width != w && isSensitiveHorizontally(container);
flush |= cachedPreferredHint.height != h && isSensitiveVertically(container);
Expand All @@ -87,6 +89,7 @@ public final Dimension getPreferredSize(IFigure container, int w, int h) {
*
* @see org.eclipse.draw2d.LayoutManager#invalidate()
*/
@Override
public void invalidate() {
minimumSize = null;
super.invalidate();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ public abstract class AbstractImageFigure extends Figure implements IImageFigure

private List<ImageChangedListener> imageListeners = new ArrayList<>();

@Override
public final void addImageChangedListener(ImageChangedListener listener) {
if (listener == null) {
throw new IllegalArgumentException();
}
imageListeners.add(listener);
}

@Override
public final void removeImageChangedListener(ImageChangedListener listener) {
if (listener == null) {
throw new IllegalArgumentException();
Expand Down
Loading

0 comments on commit 92f2b8e

Please sign in to comment.