Skip to content

Commit

Permalink
refactor: annotate deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
miurahr committed Mar 31, 2024
1 parent 3983709 commit 98507ad
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 76 deletions.
2 changes: 2 additions & 0 deletions src/main/java/com/vlsolutions/swing/docking/DockKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ public void setKey(String dockKey) {
* @see #getKey()
* @deprecated use getKey instead
*/
@Deprecated
public String getDockName() {
return getKey();
}
Expand All @@ -297,6 +298,7 @@ public String getDockName() {
* @see #setKey(String)
* @deprecated use setKey instead
*/
@Deprecated
public void setDockName(String name) {
setKey(name);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,9 @@ public enum ParentType {

/**
* @deprecated use the other createDockableContainer method
* ({@link #createDockableContainer(Dockable, int)}
* ({@link #createDockableContainer(Dockable, ParentType)}
*/
@Deprecated
public SingleDockableContainer createDockableContainer(Dockable dockable, boolean c) {
return createDockableContainer(dockable, ParentType.PARENT_SPLIT_CONTAINER);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public void actionPerformed(ActionEvent actionEvent) {
closingState = CONFIRM;
for (int i = 0; i < model.states.length; i++) {
DockableState state = model.states[i];
boolean newVisible = ((Boolean) visibleViews.get(state)).booleanValue();
boolean newVisible = visibleViews.get(state);
boolean oldVisible = state.getLocation() != DockableState.Location.CLOSED;
if (oldVisible != newVisible) {
if (newVisible) {
Expand All @@ -175,27 +175,7 @@ public void actionPerformed(ActionEvent actionEvent) {
}
});

<<<<<<< HEAD
Action closeAction = new AbstractAction("Cancel") {
=======
public void actionPerformed(ActionEvent actionEvent) {
closingState = CONFIRM;
for(int i = 0; i < model.states.length; i++) {
DockableState state = model.states[i];
boolean newVisible = visibleViews.get(state);
boolean oldVisible = state.getLocation() != DockableState.Location.CLOSED;
if(oldVisible != newVisible) {
if(newVisible) {
desktop.addDockable(state.getDockable(), state.getPosition());
} else {
desktop.close(state.getDockable());
}
}
}
DockingSelectorDialog.this.dispose();
}
});
>>>>>>> f214f69 (refactor: avoid redundant cast)

private static final long serialVersionUID = 1L;

Expand Down Expand Up @@ -304,7 +284,7 @@ class DockablesTableModel extends AbstractTableModel {

String[] colNames = { " ", "Name", "Visible" };

private DockableState[] states;
private final DockableState[] states;

DockablesTableModel(DockableState[] states) {
this.states = states;
Expand All @@ -328,14 +308,11 @@ public String getColumnName(int col) {
}

public boolean isCellEditable(int row, int col) {
if (col != 2)
return false;
Dockable dockable = states[row].getDockable();
if (dockable.getDockKey().isCloseEnabled()) {
return true;
} else {
if (col != 2) {
return false;
}
Dockable dockable = states[row].getDockable();
return dockable.getDockKey().isCloseEnabled();
}

public Class getColumnClass(int col) {
Expand All @@ -350,7 +327,6 @@ public Class getColumnClass(int col) {
return null;
}

<<<<<<< HEAD
public Object getValueAt(int row, int col) {
DockableState state = states[row];
switch (col) {
Expand All @@ -359,55 +335,10 @@ public Object getValueAt(int row, int col) {
case 1:
return state.getDockable().getDockKey().getName();
case 2:
return (Boolean) visibleViews.get(state);
return visibleViews.get(state);
}
return null;
}
=======
public boolean isCellEditable(int row, int col) {
if(col != 2)
return false;
Dockable dockable = states[row].getDockable();
if(dockable.getDockKey().isCloseEnabled()) {
return true;
} else {
return false;
}
}

public Class getColumnClass(int col) {
switch(col) {
case 0:
return Icon.class;
case 1:
return String.class;
case 2:
return Boolean.class;
}
return null;
}

public Object getValueAt(int row, int col) {
DockableState state = states[row];
switch(col) {
case 0:
return state.getDockable().getDockKey().getIcon();
case 1:
return state.getDockable().getDockKey().getName();
case 2:
return visibleViews.get(state);
}
return null;
}

public void setValueAt(Object v, int row, int col) {
DockableState state = states[row];
visibleViews.put(state, (Boolean) v);

}

}
>>>>>>> f214f69 (refactor: avoid redundant cast)

public void setValueAt(Object v, int row, int col) {
DockableState state = states[row];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ public static int findAnchors(Component base, Container ancestorContainer) {
*
* @deprecated use getInsertionDockingAction / applyDockingAction instead
*/
@Deprecated
public static SingleDockableContainer insertDockable(Container relativeAncestorContainer,
Dockable dockable, RelativeDockablePosition position) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public DockingSplitPaneUI() {
*
* @deprecated use UIManager.put("SplitContainer.drawDotsDelimitors", Boolean) instead
*/
@Deprecated
public static void setDrawDelimitors(boolean draw) {
drawDelimitors = draw;
}
Expand Down

0 comments on commit 98507ad

Please sign in to comment.