Ajout de l'api pour les logiciels
This commit is contained in:
parent
a10deda7a9
commit
e78c79b074
9
BernardApi/src/com/bernard/api/Configuration.java
Normal file
9
BernardApi/src/com/bernard/api/Configuration.java
Normal file
@ -0,0 +1,9 @@
|
||||
package com.bernard.api;
|
||||
|
||||
public abstract class Configuration {
|
||||
|
||||
public Configuration() {}
|
||||
|
||||
public abstract Configuration getDefault();
|
||||
|
||||
}
|
||||
11
BernardApi/src/com/bernard/api/Configurationnable.java
Normal file
11
BernardApi/src/com/bernard/api/Configurationnable.java
Normal file
@ -0,0 +1,11 @@
|
||||
package com.bernard.api;
|
||||
|
||||
import javax.swing.JPanel;
|
||||
|
||||
public interface Configurationnable {
|
||||
|
||||
public JPanel getBlankPanel();
|
||||
|
||||
public Configurationnable getFromPanel();
|
||||
|
||||
}
|
||||
7
BernardApi/src/com/bernard/api/Launcheable.java
Normal file
7
BernardApi/src/com/bernard/api/Launcheable.java
Normal file
@ -0,0 +1,7 @@
|
||||
package com.bernard.api;
|
||||
|
||||
public interface Launcheable {
|
||||
|
||||
void launch(Configuration config);
|
||||
|
||||
}
|
||||
@ -1,36 +1,68 @@
|
||||
package com.bernard.ator;
|
||||
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JTabbedPane;
|
||||
import javax.swing.*;
|
||||
|
||||
import com.bernard.ator.obj.LauncheableItem;
|
||||
import com.bernard.ator.view.LauncheableItemCellRenderer;
|
||||
|
||||
public class BernardatorWindow extends JFrame{
|
||||
|
||||
private static final long serialVersionUID = 6428140110872165791L;
|
||||
public static final String defaultBernardatorHomeUNIX = "";
|
||||
public static final String defaultBernardatorHomeUNIX = "~/.bernard/";
|
||||
|
||||
JTabbedPane panel;
|
||||
|
||||
JPanel[] onglets;
|
||||
|
||||
JList<LauncheableItem> launcheableList;
|
||||
|
||||
LauncheableItem[] launcheableItems;
|
||||
|
||||
public BernardatorWindow() {
|
||||
|
||||
loadData();
|
||||
|
||||
panel = new JTabbedPane();
|
||||
onglets = new JPanel[4];
|
||||
|
||||
panel.addTab("Programmes", onglets[0]);
|
||||
this.setSize(500, 500);
|
||||
this.setLocationRelativeTo(null);
|
||||
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
|
||||
//init();
|
||||
|
||||
panel.add(new LauncheableItemCellRenderer().getListCellRendererComponent(null, launcheableItems[0], 0, true, true));
|
||||
|
||||
this.setContentPane(panel);
|
||||
|
||||
this.pack();
|
||||
this.setVisible(true);
|
||||
}
|
||||
|
||||
public void init() {
|
||||
|
||||
onglets[0] = new JPanel();
|
||||
|
||||
}
|
||||
|
||||
public void loadData() {
|
||||
launcheableList = new JList<LauncheableItem>(launcheableItems);
|
||||
launcheableList.setSelectionModel(new LauncheableItemCellRenderer.DisabledItemSelectionModel());
|
||||
launcheableList.setLayoutOrientation(JList.VERTICAL);
|
||||
launcheableList.setVisibleRowCount(-1);
|
||||
launcheableList.setCellRenderer(new LauncheableItemCellRenderer());
|
||||
|
||||
onglets[0].add(launcheableList);
|
||||
|
||||
panel.addTab("Programmes", new JScrollPane(onglets[0]));
|
||||
|
||||
}
|
||||
|
||||
public void loadData() {
|
||||
launcheableItems = new LauncheableItem[2];
|
||||
launcheableItems[0] = new LauncheableItem("Cercloidator", "2x+3", null);
|
||||
launcheableItems[1] = new LauncheableItem("Modulotator", "beta-beta", "Le programme a mal été chargé");
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
new BernardatorWindow();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user