-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
144 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package muon.panels; | ||
|
||
import muon.util.IconCode; | ||
import muon.util.IconFont; | ||
|
||
import javax.swing.*; | ||
import javax.swing.border.EmptyBorder; | ||
import java.awt.*; | ||
import java.awt.event.ActionListener; | ||
|
||
public class ErrorPanel extends JPanel { | ||
public ErrorPanel(ActionListener errorAction) { | ||
var label = new JLabel(); | ||
label.setFont(IconFont.getSharedInstance().getIconFont(48.0f)); | ||
label.setText(IconCode.RI_ACCOUNT_ALERT_FILL.getValue()); | ||
label.setAlignmentX(Component.CENTER_ALIGNMENT); | ||
|
||
var lblError = new JLabel("Operation failed"); | ||
lblError.setBorder(new EmptyBorder(10, 10, 10, 10)); | ||
lblError.setAlignmentX(Component.CENTER_ALIGNMENT); | ||
|
||
var button = new JButton("OK"); | ||
button.setAlignmentX(Component.CENTER_ALIGNMENT); | ||
button.addActionListener(errorAction); | ||
|
||
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); | ||
this.add(Box.createVerticalGlue()); | ||
this.add(label); | ||
this.add(lblError); | ||
this.add(button); | ||
this.add(Box.createVerticalGlue()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package muon.panels; | ||
|
||
import muon.util.IconCode; | ||
import muon.util.IconFont; | ||
|
||
import javax.swing.*; | ||
import javax.swing.border.EmptyBorder; | ||
import java.awt.*; | ||
import java.awt.event.ActionListener; | ||
|
||
public class RetryPanel extends JPanel { | ||
public RetryPanel(ActionListener retryCallback, ActionListener cancelCallback) { | ||
var label = new JLabel(); | ||
label.setFont(IconFont.getSharedInstance().getIconFont(48.0f)); | ||
label.setText(IconCode.RI_ACCOUNT_ALERT_FILL.getValue()); | ||
label.setAlignmentX(Component.CENTER_ALIGNMENT); | ||
|
||
var lblError = new JLabel("Unable to connect"); | ||
lblError.setBorder(new EmptyBorder(10, 10, 10, 10)); | ||
lblError.setAlignmentX(Component.CENTER_ALIGNMENT); | ||
|
||
var btnRetry = new JButton("Try again"); | ||
btnRetry.addActionListener(retryCallback); | ||
var btnCancel = new JButton("Cencel"); | ||
btnCancel.setAlignmentX(Component.CENTER_ALIGNMENT); | ||
btnCancel.addActionListener(cancelCallback); | ||
|
||
var hb = Box.createHorizontalBox(); | ||
hb.add(btnRetry); | ||
hb.add(Box.createRigidArea(new Dimension(10, 10))); | ||
hb.add(btnCancel); | ||
hb.setAlignmentX(Component.CENTER_ALIGNMENT); | ||
|
||
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); | ||
this.add(Box.createVerticalGlue()); | ||
this.add(label); | ||
this.add(lblError); | ||
this.add(hb); | ||
this.add(Box.createVerticalGlue()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package muon.panels; | ||
|
||
import javax.swing.*; | ||
import javax.swing.border.EmptyBorder; | ||
import java.awt.*; | ||
|
||
public class SpinnerPanel extends JPanel { | ||
public SpinnerPanel() { | ||
setLayout(new BoxLayout(this, BoxLayout.Y_AXIS)); | ||
|
||
var label = new JLabel("Please wait"); | ||
label.setAlignmentX(Component.CENTER_ALIGNMENT); | ||
label.setBorder(new EmptyBorder(10, 10, 10, 10)); | ||
var prg = new JProgressBar(); | ||
prg.setAlignmentX(Component.CENTER_ALIGNMENT); | ||
prg.setPreferredSize(new Dimension(200, 5)); | ||
prg.setMaximumSize(new Dimension(200, 5)); | ||
prg.setIndeterminate(true); | ||
|
||
this.add(Box.createVerticalGlue()); | ||
this.add(label); | ||
this.add(prg); | ||
this.add(Box.createVerticalGlue()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters