Skip to content

Commit

Permalink
WIP: only code formatting changed
Browse files Browse the repository at this point in the history
  • Loading branch information
IOOI-SqAR committed Dec 6, 2024
1 parent 8f5b412 commit 0367035
Show file tree
Hide file tree
Showing 13 changed files with 5,414 additions and 5,799 deletions.
942 changes: 453 additions & 489 deletions JTCEMU/src/main/java/org/jens_mueller/jtcemu/platform/se/Main.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -18,123 +18,109 @@
import java.util.Set;


public class BaseDlg extends JDialog implements WindowListener
{
private static Set<String> suppressedMessages = new HashSet<>();
public class BaseDlg extends JDialog implements WindowListener {
private static Set<String> suppressedMessages = new HashSet<>();


protected BaseDlg( Window owner )
{
super( owner, ModalityType.DOCUMENT_MODAL );
setDefaultCloseOperation( DO_NOTHING_ON_CLOSE );
Main.setIconImages( this );
addWindowListener( this );
}
protected BaseDlg(Window owner) {
super(owner, ModalityType.DOCUMENT_MODAL);
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
Main.setIconImages(this);
addWindowListener(this);
}


protected boolean doClose()
{
setVisible( false );
dispose();
return true;
}
protected boolean doClose() {
setVisible(false);
dispose();
return true;
}


protected void setParentCentered()
{
setParentCentered( this );
}
protected void setParentCentered() {
setParentCentered(this);
}


public static void setParentCentered( Window window )
{
Component p = window.getParent();
if( p != null ) {
int x = p.getX() + ((p.getWidth() - window.getWidth()) / 2);
int y = p.getY() + ((p.getHeight() - window.getHeight()) / 2);
window.setLocation( x > 0 ? x : 0, y > 0 ? y : 0 );
public static void setParentCentered(Window window) {
Component p = window.getParent();
if (p != null) {
int x = p.getX() + ((p.getWidth() - window.getWidth()) / 2);
int y = p.getY() + ((p.getHeight() - window.getHeight()) / 2);
window.setLocation(x > 0 ? x : 0, y > 0 ? y : 0);
}
}
}


public static void showError( Component owner, String msg )
{
if( msg == null ) {
msg = "Unbekannter Fehler";
public static void showError(Component owner, String msg) {
if (msg == null) {
msg = "Unbekannter Fehler";
}
JOptionPane.showMessageDialog(
owner,
msg,
"Fehler",
JOptionPane.ERROR_MESSAGE);
}
JOptionPane.showMessageDialog(
owner,
msg,
"Fehler",
JOptionPane.ERROR_MESSAGE );
}


public static void showSuppressableInfoDlg( Component owner, String msg )
{
if( msg != null ) {
if( !suppressedMessages.contains( msg ) ) {
JCheckBox cb = new JCheckBox( "Diesen Hinweis nicht mehr anzeigen" );
JOptionPane.showMessageDialog(
owner,
new Object[] { msg, cb },
"Hinweis",
JOptionPane.INFORMATION_MESSAGE );
if( cb.isSelected() ) {
suppressedMessages.add( msg );
}
}


public static void showSuppressableInfoDlg(Component owner, String msg) {
if (msg != null) {
if (!suppressedMessages.contains(msg)) {
JCheckBox cb = new JCheckBox("Diesen Hinweis nicht mehr anzeigen");
JOptionPane.showMessageDialog(
owner,
new Object[]{msg, cb},
"Hinweis",
JOptionPane.INFORMATION_MESSAGE);
if (cb.isSelected()) {
suppressedMessages.add(msg);
}
}
}
}
}


/* --- WindowListener --- */
/* --- WindowListener --- */

@Override
public void windowActivated( WindowEvent e )
{
// leer;
}
@Override
public void windowActivated(WindowEvent e) {
// leer;
}


@Override
public void windowClosed( WindowEvent e )
{
// leer;
}
@Override
public void windowClosed(WindowEvent e) {
// leer;
}


@Override
public void windowClosing( WindowEvent e )
{
doClose();
}
@Override
public void windowClosing(WindowEvent e) {
doClose();
}


@Override
public void windowDeactivated( WindowEvent e )
{
// leer;
}
@Override
public void windowDeactivated(WindowEvent e) {
// leer;
}


@Override
public void windowDeiconified( WindowEvent e )
{
// leer;
}
@Override
public void windowDeiconified(WindowEvent e) {
// leer;
}


@Override
public void windowIconified( WindowEvent e )
{
// leer;
}
@Override
public void windowIconified(WindowEvent e) {
// leer;
}


@Override
public void windowOpened( WindowEvent e )
{
// leer
}
@Override
public void windowOpened(WindowEvent e) {
// leer
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,109 +16,94 @@
import java.awt.event.WindowListener;


public abstract class BaseFrm extends JFrame implements WindowListener
{
protected BaseFrm()
{
setDefaultCloseOperation( DO_NOTHING_ON_CLOSE );
Main.setIconImages( this );
addWindowListener( this );
}
public abstract class BaseFrm extends JFrame implements WindowListener {
protected BaseFrm() {
setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);
Main.setIconImages(this);
addWindowListener(this);
}


protected boolean doClose()
{
setVisible( false );
dispose();
return true;
}
protected boolean doClose() {
setVisible(false);
dispose();
return true;
}


public KeyStroke getMenuShortcut( int keyCode )
{
return KeyStroke.getKeyStroke(
keyCode,
GUIUtil.getMenuShortcutKeyMask( this ) );
}
public KeyStroke getMenuShortcut(int keyCode) {
return KeyStroke.getKeyStroke(
keyCode,
GUIUtil.getMenuShortcutKeyMask(this));
}


public KeyStroke getMenuShortcutWithShift( int keyCode )
{
return KeyStroke.getKeyStroke(
keyCode,
GUIUtil.getMenuShortcutKeyMask( this )
| InputEvent.SHIFT_DOWN_MASK );
}
public KeyStroke getMenuShortcutWithShift(int keyCode) {
return KeyStroke.getKeyStroke(
keyCode,
GUIUtil.getMenuShortcutKeyMask(this)
| InputEvent.SHIFT_DOWN_MASK);
}


public abstract String getPropPrefix();
public abstract String getPropPrefix();


public void lafChanged()
{
// leer
}
public void lafChanged() {
// leer
}


public void memorizeSettings()
{
GUIUtil.memorizeWindowSettings( this );
}
public void memorizeSettings() {
GUIUtil.memorizeWindowSettings(this);
}


public void settingsChanged()
{
// leer
}
public void settingsChanged() {
// leer
}


/* --- WindowListener --- */
/* --- WindowListener --- */

@Override
public void windowActivated( WindowEvent e )
{
// leer;
}
@Override
public void windowActivated(WindowEvent e) {
// leer;
}


@Override
public void windowClosed( WindowEvent e )
{
// leer;
}
@Override
public void windowClosed(WindowEvent e) {
// leer;
}


@Override
public void windowClosing( WindowEvent e )
{
doClose();
}
@Override
public void windowClosing(WindowEvent e) {
doClose();
}


@Override
public void windowDeactivated( WindowEvent e )
{
// leer;
}
@Override
public void windowDeactivated(WindowEvent e) {
// leer;
}


@Override
public void windowDeiconified( WindowEvent e )
{
// leer;
}
@Override
public void windowDeiconified(WindowEvent e) {
// leer;
}


@Override
public void windowIconified( WindowEvent e )
{
// leer;
}
@Override
public void windowIconified(WindowEvent e) {
// leer;
}


@Override
public void windowOpened( WindowEvent e )
{
// leer
}
@Override
public void windowOpened(WindowEvent e) {
// leer
}
}
Loading

0 comments on commit 0367035

Please sign in to comment.