Move ABC up or down

This commit is contained in:
Jindra Petřík
2022-11-20 14:55:58 +01:00
parent 62f882b0c1
commit 0ad00a81ee
2 changed files with 11 additions and 11 deletions

View File

@@ -456,20 +456,20 @@ public final class MainPanel extends JPanel implements TreeSelectionListener, Se
}
public void moveSwfListUpDown(TreeItem item, boolean up) {
OpenableList swfList = null;
if (item instanceof SWF) {
SWF swf = (SWF) item;
if (swf.openableList != null && !swf.openableList.isBundle() && swf.openableList.size() == 1) {
swfList = swf.openableList;
OpenableList openableList = null;
if (item instanceof Openable) {
Openable openable = (Openable) item;
if (openable.getOpenableList() != null && !openable.getOpenableList().isBundle() && openable.getOpenableList().size() == 1) {
openableList = openable.getOpenableList();
} else {
return;
}
} else if (item instanceof OpenableList) {
swfList = (OpenableList) item;
openableList = (OpenableList) item;
} else {
return;
}
int index = openables.indexOf(swfList);
int index = openables.indexOf(openableList);
List<List<String>> expandedTagTree = View.getExpandedNodes(tagTree);
List<List<String>> expandedTagListTree = View.getExpandedNodes(tagListTree);

View File

@@ -942,9 +942,9 @@ public class TagTreeContextMenu extends JPopupMenu {
moveUpMenuItem.setVisible(true);
moveDownMenuItem.setVisible(true);
}
if (firstItem instanceof SWF) {
SWF firstSwf = (SWF) firstItem;
if (firstSwf.openableList != null && !firstSwf.openableList.isBundle() && firstSwf.openableList.size() == 1) {
if (firstItem instanceof Openable) {
Openable firstOpenable = (Openable) firstItem;
if (firstOpenable.getOpenableList() != null && !firstOpenable.getOpenableList().isBundle() && firstOpenable.getOpenableList().size() == 1) {
moveUpMenuItem.setVisible(true);
moveDownMenuItem.setVisible(true);
}
@@ -3034,7 +3034,7 @@ public class TagTreeContextMenu extends JPopupMenu {
}
public void moveUpDown(TreeItem item, boolean up) {
if ((item instanceof SWF) || (item instanceof OpenableList)) {
if ((item instanceof Openable) || (item instanceof OpenableList)) {
mainPanel.moveSwfListUpDown(item, up);
return;
}