Code Style Update / Cleanup / Repackaging

This commit is contained in:
Konloch 2024-09-26 03:41:20 -06:00
parent 515495e378
commit f59823b185

AI 샘플 코드 생성 중입니다

Loading...
9 changed files with 18 additions and 25 deletions

View File

@ -29,8 +29,8 @@ import the.bytecode.club.bytecodeviewer.translation.TranslatedComponents;
import the.bytecode.club.bytecodeviewer.translation.TranslatedStrings;
import the.bytecode.club.bytecodeviewer.translation.components.TranslatedJButton;
import the.bytecode.club.bytecodeviewer.translation.components.TranslatedVisibleComponent;
import the.bytecode.club.uikit.tabpopup.closer.JTabbedPanePopupMenuTabsCloser;
import the.bytecode.club.uikit.tabpopup.closer.PopupMenuTabsCloseConfiguration;
import the.bytecode.club.bytecodeviewer.gui.tabpopup.closer.JTabbedPanePopupMenuTabsCloser;
import the.bytecode.club.bytecodeviewer.gui.tabpopup.closer.PopupMenuTabsCloseConfiguration;
import javax.swing.*;
import java.awt.*;

View File

@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
package the.bytecode.club.uikit.tabpopup;
package the.bytecode.club.bytecodeviewer.gui.tabpopup;
import javax.swing.*;
import java.awt.*;

View File

@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
package the.bytecode.club.uikit.tabpopup;
package the.bytecode.club.bytecodeviewer.gui.tabpopup;
import javax.swing.*;

View File

@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
package the.bytecode.club.uikit.tabpopup;
package the.bytecode.club.bytecodeviewer.gui.tabpopup;
import javax.swing.*;

View File

@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
package the.bytecode.club.uikit.tabpopup;
package the.bytecode.club.bytecodeviewer.gui.tabpopup;
import javax.swing.*;
import java.awt.*;
@ -68,16 +68,16 @@ public class JTabbedPanePopupEventHandler
if (e.isPopupTrigger())
{
int index = tabbedPane.indexAtLocation(e.getX(), e.getY());
if (index != -1)
{
Component popupOnTab = tabbedPane.getComponentAt(index);
if (this.tabPopupEventListener != null)
{
this.tabPopupEventListener.onTabPopupEvent(tabbedPane, index, new TabPopupEvent(e, popupOnTab));
}
}
}
}
public JTabbedPane getTabbedPane()
{

View File

@ -16,16 +16,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
package the.bytecode.club.uikit.tabpopup;
package the.bytecode.club.bytecodeviewer.gui.tabpopup;
import java.awt.*;
import java.awt.event.MouseEvent;
public class TabPopupEvent extends MouseEvent
{
/**
*
*/
private static final long serialVersionUID = 2510164400674753411L;
private final Component popupOnTab;

View File

@ -16,9 +16,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
package the.bytecode.club.uikit.tabpopup.closer;
package the.bytecode.club.bytecodeviewer.gui.tabpopup.closer;
import the.bytecode.club.uikit.tabpopup.ITabZeroComponentEventListener;
import the.bytecode.club.bytecodeviewer.gui.tabpopup.ITabZeroComponentEventListener;
import javax.swing.*;
import java.awt.*;
@ -61,18 +61,16 @@ public class JTabbedPaneCloser
protected void removeOtherComponents(Component component, boolean equalStop)
{
int i = this.tabbedPane.getTabCount();
while (i-- > 0)
{
Component c = this.tabbedPane.getComponentAt(i);
if (c != component)
{
this.tabbedPane.remove(i);
}
else if (equalStop)
{
break;
}
}
tryTriggerTabZeroComponentEvent();
}
@ -82,6 +80,7 @@ public class JTabbedPaneCloser
int count = this.tabbedPane.getTabCount();
int i = 0;
List<Component> removeTabs = new ArrayList<>();
do
{
Component c = this.tabbedPane.getComponentAt(i);
@ -117,8 +116,6 @@ public class JTabbedPaneCloser
private void tryTriggerTabZeroComponentEvent()
{
if (this.tabbedPane.getTabCount() == 0 && tabZeroComponentEventListener != null)
{
tabZeroComponentEventListener.onTabZeroComponent(this.tabbedPane);
}
}
}

View File

@ -16,9 +16,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
package the.bytecode.club.uikit.tabpopup.closer;
package the.bytecode.club.bytecodeviewer.gui.tabpopup.closer;
import the.bytecode.club.uikit.tabpopup.AbstractJTabbedPanePopupMenuHandler;
import the.bytecode.club.bytecodeviewer.gui.tabpopup.AbstractJTabbedPanePopupMenuHandler;
import javax.swing.*;
import java.awt.*;
@ -79,8 +79,7 @@ public class JTabbedPanePopupMenuTabsCloser extends AbstractJTabbedPanePopupMenu
protected void addItemCloseOtherTabs(JPopupMenu popUpMenu, Component popupOnTab)
{
addMenuItem(popUpMenu, "Close Others", e ->
{tabbedPaneCloser.removeOtherComponents(popupOnTab);});
addMenuItem(popUpMenu, "Close Others", e -> tabbedPaneCloser.removeOtherComponents(popupOnTab));
}
protected void addItemCloseAllTabs(JPopupMenu popUpMenu)

View File

@ -16,7 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
***************************************************************************/
package the.bytecode.club.uikit.tabpopup.closer;
package the.bytecode.club.bytecodeviewer.gui.tabpopup.closer;
/**
* PopupMenu items configuration of close tabs