package org.openslx.dozmod.gui.activity; import javax.swing.BorderFactory; import javax.swing.JPanel; import javax.swing.border.CompoundBorder; import org.openslx.dozmod.gui.MainWindow; public abstract class ActivityPanel extends JPanel { /** * Version for serialization. */ private static final long serialVersionUID = -3207947029817052277L; /** * If this activity wants to prevent the user from closing the application, * it should return true. This makes the application ask the user to confirm * quitting. * * @return true to ask the user for confirmation */ public abstract boolean wantConfirmQuit(); public ActivityPanel() { setBorder(new CompoundBorder(BorderFactory.createRaisedSoftBevelBorder(), BorderFactory.createEmptyBorder(3, 3, 3, 3))); } protected final void close() { MainWindow.removeActivity(this); } }