Skip to content

Commit

Permalink
[Mondernize Code] Typified the last generics in draw2d
Browse files Browse the repository at this point in the history
  • Loading branch information
azoitl authored and ptziegler committed Jan 10, 2024
1 parent f884464 commit 441cc2b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
6 changes: 3 additions & 3 deletions org.eclipse.draw2d/src/org/eclipse/draw2d/ButtonGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ public class ButtonGroup {

private ButtonModel selectedModel;
private ButtonModel defaultModel;
private List<ButtonModel> members = new ArrayList<>();
private List<PropertyChangeListener> listeners = new ArrayList<>();
private final List<ButtonModel> members = new ArrayList<>();
private final List<PropertyChangeListener> listeners = new ArrayList<>();

/**
* Constructs a ButtonGroup with no default selection.
Expand Down Expand Up @@ -96,7 +96,7 @@ public ButtonModel getDefault() {
* @return The List of ButtonModels in this ButtonGroup
* @since 2.0
*/
public List getElements() {
public List<ButtonModel> getElements() {
return members;
}

Expand Down
13 changes: 7 additions & 6 deletions org.eclipse.draw2d/src/org/eclipse/draw2d/LayoutAnimator.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,22 +105,21 @@ public final boolean layout(IFigure container) {
*
* @see Animator#playback(IFigure)
*/
@SuppressWarnings("unchecked")
@Override
protected boolean playback(IFigure container) {
Map initial = (Map) Animation.getInitialState(this, container);
Map ending = (Map) Animation.getFinalState(this, container);
Map<IFigure, Rectangle> initial = (Map<IFigure, Rectangle>) Animation.getInitialState(this, container);
Map<IFigure, Rectangle> ending = (Map<IFigure, Rectangle>) Animation.getFinalState(this, container);
if (initial == null) {
return false;
}

float progress = Animation.getProgress();
float ssergorp = 1 - progress;

Rectangle rect1, rect2;

for (IFigure child : container.getChildren()) {
rect1 = (Rectangle) initial.get(child);
rect2 = (Rectangle) ending.get(child);
Rectangle rect1 = initial.get(child);
Rectangle rect2 = ending.get(child);

// TODO need to change this to hide the figure until the end.
if (rect1 == null) {
Expand Down Expand Up @@ -153,6 +152,7 @@ public final void postLayout(IFigure container) {
*/
@Override
public final void remove(IFigure child) {
// unused
}

/**
Expand All @@ -162,6 +162,7 @@ public final void remove(IFigure child) {
*/
@Override
public final void setConstraint(IFigure child, Object constraint) {
// unused
}

}

0 comments on commit 441cc2b

Please sign in to comment.