Move all files from java subdirectory to project root
60
exec.mimis/src/main/java/mimis/Client.java
Normal file
@@ -0,0 +1,60 @@
|
||||
/**
|
||||
* Copyright (C) 2016 Rik Veenboer <rik.veenboer@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package mimis;
|
||||
|
||||
import base.exception.worker.ActivateException;
|
||||
import mimis.application.Application;
|
||||
import mimis.device.Device;
|
||||
import mimis.input.Task;
|
||||
import mimis.router.GlobalRouter;
|
||||
import mimis.util.swing.Dialog;
|
||||
|
||||
public class Client extends Main {
|
||||
public static final String IP = "127.0.0.1";
|
||||
public static final int PORT = 6789;
|
||||
|
||||
public Client(String ip, int port) {
|
||||
super();
|
||||
router = new GlobalRouter(ip, port) {
|
||||
protected boolean target(Task task, Component component) {
|
||||
switch (task.getTarget()) {
|
||||
case ALL:
|
||||
return true;
|
||||
case MAIN:
|
||||
case CURRENT:
|
||||
return component instanceof Main;
|
||||
case DEVICES:
|
||||
return component instanceof Device;
|
||||
case APPLICATIONS:
|
||||
return component instanceof Application;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public void activate() throws ActivateException {
|
||||
super.activate();
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
String ip = Dialog.question("Server IP:", IP);
|
||||
int port = Integer.valueOf(Dialog.question("Server Port:", PORT));
|
||||
new Client(ip, port).start();
|
||||
}
|
||||
}
|
||||
148
exec.mimis/src/main/java/mimis/Component.java
Normal file
@@ -0,0 +1,148 @@
|
||||
/**
|
||||
* Copyright (C) 2016 Rik Veenboer <rik.veenboer@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package mimis;
|
||||
|
||||
import mimis.input.Button;
|
||||
import mimis.input.Feedback;
|
||||
import mimis.input.Input;
|
||||
import mimis.input.Task;
|
||||
import mimis.input.state.Press;
|
||||
import mimis.input.state.Release;
|
||||
import mimis.input.state.State;
|
||||
import mimis.parser.ParserInput;
|
||||
import mimis.router.Router;
|
||||
import mimis.state.TaskMap;
|
||||
import mimis.value.Action;
|
||||
import base.work.Listen;
|
||||
import base.worker.Worker;
|
||||
import base.worker.Worker.Type;
|
||||
|
||||
public abstract class Component extends Listen<Input> {
|
||||
protected static final String TITLE = "Component";
|
||||
|
||||
protected String title;
|
||||
protected Router router;
|
||||
|
||||
public Component() {
|
||||
this(TITLE);
|
||||
}
|
||||
|
||||
public Component(Type type) {
|
||||
super(type);
|
||||
}
|
||||
|
||||
public Component(String title) {
|
||||
super(Worker.Type.BACKGROUND);
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public void setRouter(Router router) {
|
||||
this.router = router;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void listen(Class<? extends Input> clazz) {
|
||||
if (router == null) {
|
||||
logger.error("Router not set");
|
||||
} else {
|
||||
router.listen(this, clazz);
|
||||
}
|
||||
}
|
||||
|
||||
public void ignore(Class<? extends Input> clazz) {
|
||||
if (router == null) {
|
||||
logger.error("Router not set");
|
||||
} else {
|
||||
router.ignore(this, clazz);
|
||||
}
|
||||
}
|
||||
|
||||
public void route(Input input) {
|
||||
if (router == null) {
|
||||
logger.error("Router not set");
|
||||
} else {
|
||||
if (input instanceof State) {
|
||||
State state = (State) input;
|
||||
if (state.getComponent() == null) {
|
||||
state.setComponent(this);
|
||||
}
|
||||
}
|
||||
router.add(input);
|
||||
}
|
||||
}
|
||||
|
||||
public void input(Input input) {
|
||||
if (input instanceof State) {
|
||||
state((State) input);
|
||||
} else if (input instanceof Task) {
|
||||
task((Task) input);
|
||||
} else if (input instanceof Feedback) {
|
||||
feedback((Feedback) input);
|
||||
}
|
||||
}
|
||||
|
||||
protected void state(State state) {
|
||||
Button button = state.getButton();
|
||||
if (state instanceof Press) {
|
||||
press(button);
|
||||
} else if (state instanceof Release) {
|
||||
release(button);
|
||||
}
|
||||
}
|
||||
|
||||
protected void task(Task task) {
|
||||
Action action = task.getAction();
|
||||
switch (task.getSignal()) {
|
||||
case BEGIN:
|
||||
switch (action) {
|
||||
case START:
|
||||
start();
|
||||
break;
|
||||
case STOP:
|
||||
stop();
|
||||
break;
|
||||
case EXIT:
|
||||
exit();
|
||||
break;
|
||||
default:
|
||||
begin(action);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case END:
|
||||
end(action);
|
||||
break;
|
||||
default:
|
||||
action(action);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
protected void press(Button button) {}
|
||||
protected void release(Button button) {}
|
||||
protected void feedback(Feedback feedback) {}
|
||||
protected void action(Action action) {}
|
||||
protected void begin(Action action) {}
|
||||
protected void end(Action action) {}
|
||||
|
||||
protected void parser(Action action, TaskMap taskMap) {
|
||||
route(new ParserInput(action, taskMap));
|
||||
}
|
||||
}
|
||||
117
exec.mimis/src/main/java/mimis/Gui.java
Normal file
@@ -0,0 +1,117 @@
|
||||
/**
|
||||
* Copyright (C) 2016 Rik Veenboer <rik.veenboer@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package mimis;
|
||||
|
||||
import java.awt.GridLayout;
|
||||
import java.awt.TextArea;
|
||||
import java.awt.event.WindowEvent;
|
||||
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.WindowConstants;
|
||||
|
||||
import base.exception.worker.ActivateException;
|
||||
import mimis.input.Feedback;
|
||||
import mimis.input.Input;
|
||||
import mimis.input.Task;
|
||||
import mimis.manager.ButtonManager;
|
||||
import mimis.util.Swing;
|
||||
import mimis.value.Action;
|
||||
import mimis.value.Target;
|
||||
|
||||
public class Gui extends Component {
|
||||
public static final String ICON = "M.png";
|
||||
public static final String TITLE = "MIMIS Manager";
|
||||
|
||||
protected JFrame frame;
|
||||
protected Component component;
|
||||
protected TextArea textArea;
|
||||
|
||||
public Gui(final Component component, ButtonManager... buttonManagerArray) {
|
||||
frame = new JFrame(TITLE) {
|
||||
protected static final long serialVersionUID = 1L;
|
||||
protected void processWindowEvent(WindowEvent event) {
|
||||
if (event.getID() == WindowEvent.WINDOW_CLOSING) {
|
||||
logger.debug("Window closing");
|
||||
route(new Task(Action.EXIT, Target.MIMIS));
|
||||
component.exit();
|
||||
}
|
||||
}
|
||||
};
|
||||
this.component = component;
|
||||
frame.setIconImage(Swing.getImage(ICON));
|
||||
createFrame(buttonManagerArray);
|
||||
}
|
||||
|
||||
public void activate() throws ActivateException {
|
||||
listen(Feedback.class);
|
||||
super.activate();
|
||||
}
|
||||
|
||||
public void exit() {
|
||||
super.exit();
|
||||
frame.dispose();
|
||||
}
|
||||
|
||||
protected void createFrame(ButtonManager... buttonManagerArray) {
|
||||
frame.setLayout(new GridLayout(0, 1));
|
||||
JPanel controlPanel = createControlPanel(buttonManagerArray);
|
||||
frame.add(controlPanel);
|
||||
JPanel feedbackPanel = createTextPanel();
|
||||
frame.add(feedbackPanel);
|
||||
frame.setResizable(false);
|
||||
frame.setVisible(true);
|
||||
frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
|
||||
frame.pack();
|
||||
}
|
||||
|
||||
protected JPanel createControlPanel(ButtonManager... buttonManagerArray) {
|
||||
JPanel controlPanel = new JPanel(new GridLayout(1, 0));
|
||||
for (ButtonManager buttonManager : buttonManagerArray) {
|
||||
if (buttonManager.count() > 0) {
|
||||
controlPanel.add(buttonManager.createPanel());
|
||||
}
|
||||
}
|
||||
return controlPanel;
|
||||
}
|
||||
|
||||
protected JPanel createTextPanel() {
|
||||
JPanel textPanel = new JPanel();
|
||||
textArea = new TextArea();
|
||||
textArea.setEditable(false);
|
||||
textPanel.add(textArea);
|
||||
return textPanel;
|
||||
}
|
||||
|
||||
public void input(Input input) {
|
||||
if (input instanceof Feedback) {
|
||||
writeLine(((Feedback) input).getText());
|
||||
}
|
||||
}
|
||||
|
||||
public void write(String string) {
|
||||
textArea.append(string);
|
||||
}
|
||||
|
||||
public void writeLine(String string) {
|
||||
write(string + "\n");
|
||||
}
|
||||
|
||||
public void clear() {
|
||||
textArea.setText(null);
|
||||
}
|
||||
}
|
||||
119
exec.mimis/src/main/java/mimis/Main.java
Normal file
@@ -0,0 +1,119 @@
|
||||
/**
|
||||
* Copyright (C) 2016 Rik Veenboer <rik.veenboer@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package mimis;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.ServiceLoader;
|
||||
|
||||
import javax.swing.UIManager;
|
||||
|
||||
import base.exception.worker.ActivateException;
|
||||
import base.exception.worker.DeactivateException;
|
||||
import mimis.input.Task;
|
||||
import mimis.manager.ButtonManager;
|
||||
import mimis.manager.CurrentButtonManager;
|
||||
import mimis.value.Action;
|
||||
|
||||
public class Main extends Mimis {
|
||||
protected CurrentButtonManager applicationManager;
|
||||
protected ButtonManager deviceManager;
|
||||
protected Gui gui;
|
||||
|
||||
static {
|
||||
try {
|
||||
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
|
||||
} catch (Exception e) {}
|
||||
}
|
||||
|
||||
public static Component[] getApplications() {
|
||||
return getComponents(mimis.application.Application.class);
|
||||
}
|
||||
|
||||
public static Component[] getDevices() {
|
||||
return getComponents(mimis.device.Device.class);
|
||||
}
|
||||
|
||||
public static Component[] getComponents(Class<?> clazz) {
|
||||
ArrayList<Component> componentList = new ArrayList<Component>();
|
||||
for (Object object : ServiceLoader.load(clazz)) {
|
||||
if (object instanceof Component) {
|
||||
componentList.add((Component) object);
|
||||
}
|
||||
}
|
||||
return componentList.toArray(new Component[]{});
|
||||
}
|
||||
|
||||
public Main() {
|
||||
super(getApplications());
|
||||
|
||||
/* Create gui from application and device managers */
|
||||
applicationManager = new CurrentButtonManager(router, componentCycle, "Applications", currentArray);
|
||||
deviceManager = new ButtonManager("Devices", initialize(false, getDevices()));
|
||||
gui = new Gui(this, applicationManager, deviceManager);
|
||||
manager.add(initialize(false, gui));
|
||||
}
|
||||
|
||||
public void activate() throws ActivateException {
|
||||
super.activate();
|
||||
listen(Task.class);
|
||||
|
||||
/* Start managers */
|
||||
applicationManager.start();
|
||||
deviceManager.start();
|
||||
|
||||
/* Force display of current component when gui started */
|
||||
gui.start();
|
||||
while (!gui.active());
|
||||
end(Action.CURRENT);
|
||||
}
|
||||
|
||||
public void deactivate() throws DeactivateException {
|
||||
super.deactivate();
|
||||
|
||||
logger.debug("Stop managers");
|
||||
applicationManager.stop();
|
||||
deviceManager.stop();
|
||||
}
|
||||
|
||||
public void exit() {
|
||||
super.exit();
|
||||
|
||||
logger.debug("Exit managers");
|
||||
applicationManager.exit();
|
||||
deviceManager.exit();
|
||||
gui.exit();
|
||||
router.exit();
|
||||
parser.exit();
|
||||
}
|
||||
|
||||
public void end(Action action) {
|
||||
super.end(action);
|
||||
switch (action) {
|
||||
case CURRENT:
|
||||
case NEXT:
|
||||
case PREVIOUS:
|
||||
applicationManager.currentChanged();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
new Main().start();
|
||||
}
|
||||
}
|
||||
118
exec.mimis/src/main/java/mimis/Mimis.java
Normal file
@@ -0,0 +1,118 @@
|
||||
/**
|
||||
* Copyright (C) 2016 Rik Veenboer <rik.veenboer@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package mimis;
|
||||
|
||||
import mimis.application.Application;
|
||||
import mimis.device.Device;
|
||||
import mimis.input.Feedback;
|
||||
import mimis.input.Task;
|
||||
import mimis.manager.Manager;
|
||||
import mimis.parser.Parser;
|
||||
import mimis.router.Router;
|
||||
import mimis.value.Action;
|
||||
import mimis.value.Target;
|
||||
import base.exception.worker.ActivateException;
|
||||
import base.exception.worker.DeactivateException;
|
||||
import base.util.ArrayCycle;
|
||||
import base.worker.Worker;
|
||||
|
||||
public abstract class Mimis extends Component {
|
||||
protected Component[] currentArray;
|
||||
protected Manager manager;
|
||||
protected Parser parser;
|
||||
|
||||
protected ArrayCycle<Component> componentCycle;
|
||||
|
||||
public Mimis(Component... currentArray) {
|
||||
super(Worker.Type.FOREGROUND);
|
||||
this.currentArray = initialize(false, currentArray);
|
||||
componentCycle = new ArrayCycle<Component>(currentArray);
|
||||
router = new Router() {
|
||||
protected boolean target(Task task, Component component) {
|
||||
switch (task.getTarget()) {
|
||||
case ALL:
|
||||
return true;
|
||||
case MAIN:
|
||||
case CURRENT:
|
||||
return component instanceof Main;
|
||||
case DEVICES:
|
||||
return component instanceof Device;
|
||||
case APPLICATIONS:
|
||||
return component instanceof Application;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
parser = new Parser();
|
||||
manager = new Manager(initialize(true, router, parser));
|
||||
}
|
||||
|
||||
public void activate() throws ActivateException {
|
||||
manager.start();
|
||||
super.activate();
|
||||
}
|
||||
|
||||
public void deactivate() throws DeactivateException {
|
||||
super.deactivate();
|
||||
manager.stop();
|
||||
}
|
||||
|
||||
public void exit() {
|
||||
super.exit();
|
||||
manager.exit();
|
||||
}
|
||||
|
||||
public Component[] initialize(boolean start, Component... componentArray) {
|
||||
for (Component component : componentArray) {
|
||||
component.setRouter(router);
|
||||
if (start) {
|
||||
component.start();
|
||||
}
|
||||
}
|
||||
return componentArray;
|
||||
}
|
||||
|
||||
public void task(Task task) {
|
||||
if (task.getTarget().equals(Target.CURRENT)) {
|
||||
componentCycle.current().add(task);
|
||||
} else {
|
||||
super.task(task);
|
||||
}
|
||||
}
|
||||
|
||||
public void end(Action action) {
|
||||
switch (action) {
|
||||
case CURRENT:
|
||||
route(new Feedback("Current component: " + componentCycle.current().getTitle()));
|
||||
break;
|
||||
case NEXT:
|
||||
logger.debug("Next component");
|
||||
route(new Feedback("Next component: " + componentCycle.next().getTitle()));
|
||||
break;
|
||||
case PREVIOUS:
|
||||
logger.debug("Previous component");
|
||||
route(new Feedback("Previous component: " + componentCycle.previous().getTitle()));
|
||||
break;
|
||||
case EXIT:
|
||||
exit();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
197
exec.mimis/src/main/java/mimis/device/panel/Panel.java
Normal file
@@ -0,0 +1,197 @@
|
||||
/**
|
||||
* Copyright (C) 2016 Rik Veenboer <rik.veenboer@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package mimis.device.panel;
|
||||
|
||||
import java.awt.BorderLayout;
|
||||
import java.awt.event.WindowEvent;
|
||||
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.WindowConstants;
|
||||
|
||||
import mimis.Gui;
|
||||
import mimis.util.Swing;
|
||||
import mimis.util.swing.HoldButton;
|
||||
import mimis.util.swing.HoldButtonListener;
|
||||
import mimis.util.swing.ToggleButton;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
public class Panel extends JFrame implements HoldButtonListener {
|
||||
protected static final long serialVersionUID = 1L;
|
||||
|
||||
protected Logger logger = LoggerFactory.getLogger(getClass());
|
||||
protected final static String TITLE = "MIMIS Panel Device";
|
||||
|
||||
protected PanelDevice panelDevice;
|
||||
|
||||
protected HoldButton upButton;
|
||||
protected HoldButton previousButton;
|
||||
protected HoldButton rewindButton;
|
||||
protected HoldButton stopButton;
|
||||
protected ToggleButton playPauseToggleButton;
|
||||
protected HoldButton forwardButton;
|
||||
protected HoldButton downButton;
|
||||
protected HoldButton nextButton;
|
||||
protected HoldButton volumeDownButton;
|
||||
protected ToggleButton muteToggleButton;
|
||||
protected HoldButton volumeUpButton;
|
||||
protected HoldButton repeatButton;
|
||||
protected HoldButton shuffleButton;
|
||||
|
||||
Panel(PanelDevice panelDevice) {
|
||||
super(TITLE);
|
||||
this.panelDevice = panelDevice;
|
||||
setIconImage(Swing.getImage(Gui.ICON));
|
||||
createControls();
|
||||
layoutControls();
|
||||
pack();
|
||||
setResizable(false);
|
||||
setVisible(true);
|
||||
setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
|
||||
}
|
||||
|
||||
protected HoldButton getButton(String name, String text) {
|
||||
HoldButton button = new HoldButton(this);
|
||||
button.setIcon(Swing.getImageIcon(name));
|
||||
button.setToolTipText(text);
|
||||
button.setFocusPainted(false);
|
||||
return button;
|
||||
}
|
||||
|
||||
protected ToggleButton getToggleButton(String firstName, String secondName, String text) {
|
||||
ImageIcon firstImageIcon = Swing.getImageIcon(firstName);
|
||||
ImageIcon secondImageIcon = Swing.getImageIcon(secondName);
|
||||
ToggleButton button = new ToggleButton(this, firstImageIcon, secondImageIcon);
|
||||
button.setToolTipText(text);
|
||||
button.setFocusPainted(false);
|
||||
return button;
|
||||
}
|
||||
|
||||
protected void createControls() {
|
||||
upButton = getButton("icons/up.png", "Go to previous application");
|
||||
nextButton = getButton("icons/next.png", "Go to next track");
|
||||
previousButton = getButton("icons/previous.png", "Go to previous track");
|
||||
rewindButton = getButton("icons/rewind.png", "Skip backward");
|
||||
playPauseToggleButton = getToggleButton("icons/play.png", "icons/pause.png", "Play/pause");
|
||||
forwardButton = getButton("icons/forward.png", "Skip forward");
|
||||
downButton = getButton("icons/down.png", "Go to next application");
|
||||
volumeDownButton = getButton("icons/volumeDown.png", "Decrease volume");
|
||||
muteToggleButton = getToggleButton("icons/mute.png", "icons/unmute.png", "Toggle Mute");
|
||||
volumeUpButton = getButton("icons/volumeUp.png", "Increase volume");
|
||||
repeatButton = getButton("icons/repeat.png", "Repeat");
|
||||
shuffleButton = getButton("icons/shuffle.png", "Shuffle");
|
||||
}
|
||||
|
||||
protected void layoutControls() {
|
||||
setLayout(new BorderLayout());
|
||||
layoutControlPanel();
|
||||
}
|
||||
|
||||
protected void layoutControlPanel() {
|
||||
JPanel controlPanel = new JPanel();
|
||||
controlPanel.setLayout(new BorderLayout());
|
||||
|
||||
JPanel upperControlPanel = new JPanel();
|
||||
controlPanel.add(upperControlPanel, BorderLayout.NORTH);
|
||||
upperControlPanel.add(upButton);
|
||||
upperControlPanel.add(previousButton);
|
||||
upperControlPanel.add(rewindButton);
|
||||
upperControlPanel.add(playPauseToggleButton);
|
||||
upperControlPanel.add(forwardButton);
|
||||
upperControlPanel.add(nextButton);
|
||||
|
||||
JPanel lowerControlPanel = new JPanel();
|
||||
controlPanel.add(lowerControlPanel, BorderLayout.SOUTH);
|
||||
lowerControlPanel.add(downButton);
|
||||
lowerControlPanel.add(repeatButton);
|
||||
lowerControlPanel.add(volumeDownButton);
|
||||
lowerControlPanel.add(muteToggleButton);
|
||||
lowerControlPanel.add(volumeUpButton);
|
||||
lowerControlPanel.add(shuffleButton);
|
||||
|
||||
add(controlPanel, BorderLayout.CENTER);
|
||||
}
|
||||
|
||||
/* Listeners */
|
||||
public void buttonPressed(HoldButton button) {
|
||||
if (button.equals(previousButton)) {
|
||||
panelDevice.buttonPressed(PanelButton.PREVIOUS);
|
||||
} else if (button.equals(rewindButton)) {
|
||||
panelDevice.buttonPressed(PanelButton.REWIND);
|
||||
} else if (button.equals(playPauseToggleButton)) {
|
||||
panelDevice.buttonPressed(PanelButton.PLAY);
|
||||
} else if (button.equals(forwardButton)) {
|
||||
panelDevice.buttonPressed(PanelButton.FORWARD);
|
||||
} else if (button.equals(nextButton)) {
|
||||
panelDevice.buttonPressed(PanelButton.NEXT);
|
||||
} else if (button.equals(volumeDownButton)) {
|
||||
panelDevice.buttonPressed(PanelButton.VOLUME_DOWN);
|
||||
} else if (button.equals(muteToggleButton)) {
|
||||
panelDevice.buttonPressed(PanelButton.MUTE);
|
||||
} else if (button.equals(volumeUpButton)) {
|
||||
panelDevice.buttonPressed(PanelButton.VOLUME_UP);
|
||||
} else if (button.equals(repeatButton)) {
|
||||
panelDevice.buttonPressed(PanelButton.REPEAT);
|
||||
} else if (button.equals(shuffleButton)) {
|
||||
panelDevice.buttonPressed(PanelButton.SHUFFLE);
|
||||
} else if (button.equals(upButton)) {
|
||||
panelDevice.buttonPressed(PanelButton.UP);
|
||||
} else if (button.equals(downButton)) {
|
||||
panelDevice.buttonPressed(PanelButton.DOWN);
|
||||
}
|
||||
}
|
||||
|
||||
public void buttonReleased(HoldButton button) {
|
||||
if (button.equals(previousButton)) {
|
||||
panelDevice.buttonReleased(PanelButton.PREVIOUS);
|
||||
} else if (button.equals(rewindButton)) {
|
||||
panelDevice.buttonReleased(PanelButton.REWIND);
|
||||
} else if (button.equals(playPauseToggleButton)) {
|
||||
panelDevice.buttonReleased(PanelButton.PLAY);
|
||||
playPauseToggleButton.toggle();
|
||||
} else if (button.equals(forwardButton)) {
|
||||
panelDevice.buttonReleased(PanelButton.FORWARD);
|
||||
} else if (button.equals(nextButton)) {
|
||||
panelDevice.buttonReleased(PanelButton.NEXT);
|
||||
} else if (button.equals(volumeDownButton)) {
|
||||
panelDevice.buttonReleased(PanelButton.VOLUME_DOWN);
|
||||
} else if (button.equals(muteToggleButton)) {
|
||||
panelDevice.buttonReleased(PanelButton.MUTE);
|
||||
muteToggleButton.toggle();
|
||||
} else if (button.equals(volumeUpButton)) {
|
||||
panelDevice.buttonReleased(PanelButton.VOLUME_UP);
|
||||
} else if (button.equals(repeatButton)) {
|
||||
panelDevice.buttonReleased(PanelButton.REPEAT);
|
||||
} else if (button.equals(shuffleButton)) {
|
||||
panelDevice.buttonReleased(PanelButton.SHUFFLE);
|
||||
} else if (button.equals(upButton)) {
|
||||
panelDevice.buttonReleased(PanelButton.UP);
|
||||
} else if (button.equals(downButton)) {
|
||||
panelDevice.buttonReleased(PanelButton.DOWN);
|
||||
}
|
||||
}
|
||||
|
||||
protected void processWindowEvent(WindowEvent event) {
|
||||
if (event.getID() == WindowEvent.WINDOW_CLOSING) {
|
||||
logger.debug("Window closing");
|
||||
panelDevice.stop();
|
||||
}
|
||||
}
|
||||
}
|
||||
36
exec.mimis/src/main/java/mimis/device/panel/PanelButton.java
Normal file
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* Copyright (C) 2016 Rik Veenboer <rik.veenboer@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package mimis.device.panel;
|
||||
|
||||
import mimis.input.Button;
|
||||
|
||||
public enum PanelButton implements Button {
|
||||
PREVIOUS,
|
||||
REWIND,
|
||||
STOP,
|
||||
PAUSE,
|
||||
PLAY,
|
||||
FORWARD,
|
||||
NEXT,
|
||||
VOLUME_DOWN,
|
||||
MUTE,
|
||||
VOLUME_UP,
|
||||
REPEAT,
|
||||
SHUFFLE,
|
||||
UP,
|
||||
DOWN;
|
||||
}
|
||||
60
exec.mimis/src/main/java/mimis/device/panel/PanelDevice.java
Normal file
@@ -0,0 +1,60 @@
|
||||
/**
|
||||
* Copyright (C) 2016 Rik Veenboer <rik.veenboer@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package mimis.device.panel;
|
||||
|
||||
import base.exception.worker.ActivateException;
|
||||
import base.exception.worker.DeactivateException;
|
||||
import mimis.Component;
|
||||
import mimis.device.Device;
|
||||
import mimis.input.state.Press;
|
||||
import mimis.input.state.Release;
|
||||
import mimis.value.Action;
|
||||
|
||||
public class PanelDevice extends Component implements Device {
|
||||
protected static final String TITLE = "Panel";
|
||||
protected Panel panel;
|
||||
protected PanelTaskMapCycle taskMapCycle;
|
||||
|
||||
public PanelDevice() {
|
||||
super(TITLE);
|
||||
taskMapCycle = new PanelTaskMapCycle();
|
||||
}
|
||||
|
||||
public void activate() throws ActivateException {
|
||||
panel = new Panel(this);
|
||||
parser(Action.ADD, taskMapCycle.player);
|
||||
super.activate();
|
||||
}
|
||||
|
||||
public boolean active() {
|
||||
return panel != null;
|
||||
}
|
||||
|
||||
public void deactivate() throws DeactivateException {
|
||||
super.deactivate();
|
||||
panel.dispose();
|
||||
panel = null;
|
||||
}
|
||||
|
||||
public void buttonPressed(PanelButton panelButton) {
|
||||
route(new Press(panelButton));
|
||||
}
|
||||
|
||||
public void buttonReleased(PanelButton panelButton) {
|
||||
route(new Release(panelButton));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* Copyright (C) 2016 Rik Veenboer <rik.veenboer@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package mimis.device.panel;
|
||||
|
||||
import mimis.input.Task;
|
||||
import mimis.input.state.Press;
|
||||
import mimis.state.TaskMap;
|
||||
import mimis.state.TaskMapCycle;
|
||||
import mimis.value.Action;
|
||||
import mimis.value.Target;
|
||||
|
||||
public class PanelTaskMapCycle extends TaskMapCycle {
|
||||
protected static final long serialVersionUID = 1L;
|
||||
|
||||
public TaskMap player;
|
||||
|
||||
public PanelTaskMapCycle() {
|
||||
/* Player */
|
||||
player = new TaskMap();
|
||||
player.add(new Press(PanelButton.UP), new Task(Action.PREVIOUS, Target.MAIN));
|
||||
player.add(new Press(PanelButton.PREVIOUS), new Task(Action.PREVIOUS, Target.CURRENT));
|
||||
player.add(new Press(PanelButton.REWIND), new Task(Action.REWIND, Target.CURRENT));
|
||||
player.add(new Press(PanelButton.STOP), new Task(Action.STOP, Target.CURRENT));
|
||||
player.add(new Press(PanelButton.PAUSE), new Task(Action.PAUSE, Target.CURRENT));
|
||||
player.add(new Press(PanelButton.PLAY), new Task(Action.PLAY, Target.CURRENT));
|
||||
player.add(new Press(PanelButton.FORWARD), new Task(Action.FORWARD, Target.CURRENT));
|
||||
player.add(new Press(PanelButton.DOWN), new Task(Action.NEXT, Target.MAIN));
|
||||
player.add(new Press(PanelButton.NEXT), new Task(Action.NEXT, Target.CURRENT));
|
||||
player.add(new Press(PanelButton.VOLUME_DOWN), new Task(Action.VOLUME_DOWN, Target.CURRENT));
|
||||
player.add(new Press(PanelButton.MUTE), new Task(Action.MUTE, Target.CURRENT));
|
||||
player.add(new Press(PanelButton.VOLUME_UP), new Task(Action.VOLUME_UP, Target.CURRENT));
|
||||
player.add(new Press(PanelButton.REPEAT), new Task(Action.REPEAT, Target.CURRENT));
|
||||
player.add(new Press(PanelButton.SHUFFLE), new Task(Action.SHUFFLE, Target.CURRENT));
|
||||
add(player);
|
||||
}
|
||||
21
exec.mimis/src/main/java/mimis/exception/EventException.java
Normal file
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* Copyright (C) 2016 Rik Veenboer <rik.veenboer@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package mimis.exception;
|
||||
|
||||
public class EventException extends Exception {
|
||||
protected static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Copyright (C) 2016 Rik Veenboer <rik.veenboer@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package mimis.exception.event.router;
|
||||
|
||||
import mimis.exception.EventException;
|
||||
|
||||
public class GlobalRouterException extends EventException {
|
||||
protected static final long serialVersionUID = 1L;
|
||||
}
|
||||
92
exec.mimis/src/main/java/mimis/manager/ButtonManager.java
Normal file
@@ -0,0 +1,92 @@
|
||||
/**
|
||||
* Copyright (C) 2016 Rik Veenboer <rik.veenboer@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package mimis.manager;
|
||||
|
||||
import java.awt.GridBagConstraints;
|
||||
import java.awt.GridBagLayout;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JToggleButton;
|
||||
import javax.swing.border.TitledBorder;
|
||||
|
||||
import base.work.Work;
|
||||
|
||||
public class ButtonManager extends Manager {
|
||||
protected static final String TITLE = "Workers";
|
||||
|
||||
protected String title;
|
||||
protected Map<Work, WorkerButton> buttonMap;
|
||||
|
||||
public ButtonManager(Work... workArray) {
|
||||
this(TITLE, workArray);
|
||||
}
|
||||
|
||||
public ButtonManager(String title, Work... workArray) {
|
||||
super(workArray);
|
||||
this.title = title;
|
||||
createButtons();
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public WorkerButton[] getButtons() {
|
||||
return buttonMap.values().toArray(new WorkerButton[]{});
|
||||
}
|
||||
|
||||
protected void createButtons() {
|
||||
buttonMap = new HashMap<Work, WorkerButton>();
|
||||
for (Work worker : workList) {
|
||||
WorkerButton button = new WorkerButton(worker);
|
||||
buttonMap.put(worker, button);
|
||||
}
|
||||
}
|
||||
|
||||
public JPanel createPanel() {
|
||||
/* Initialize components */
|
||||
GridBagLayout gridBagLayout = new GridBagLayout();
|
||||
GridBagConstraints gridBagConstraints = new GridBagConstraints();
|
||||
JPanel panel = new JPanel(gridBagLayout);
|
||||
|
||||
/* Set border */
|
||||
TitledBorder border = new TitledBorder(getTitle());
|
||||
border.setTitleJustification(TitledBorder.CENTER);
|
||||
panel.setBorder(border);
|
||||
|
||||
/* Initialize constraints */
|
||||
gridBagConstraints.fill = GridBagConstraints.BOTH;
|
||||
gridBagConstraints.gridwidth = GridBagConstraints.REMAINDER;
|
||||
gridBagConstraints.weightx = 1;
|
||||
gridBagConstraints.weighty = 1;
|
||||
|
||||
/* Add buttons */
|
||||
for (JToggleButton button : getButtons()) {
|
||||
gridBagLayout.setConstraints(button, gridBagConstraints);
|
||||
panel.add(button);
|
||||
}
|
||||
return panel;
|
||||
}
|
||||
|
||||
public void work() {
|
||||
for (Work worker : workList) {
|
||||
buttonMap.get(worker).setPressed(worker.active());
|
||||
}
|
||||
}
|
||||
}
|
||||
115
exec.mimis/src/main/java/mimis/manager/CurrentButtonManager.java
Normal file
@@ -0,0 +1,115 @@
|
||||
/**
|
||||
* Copyright (C) 2016 Rik Veenboer <rik.veenboer@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package mimis.manager;
|
||||
|
||||
import java.awt.GridBagConstraints;
|
||||
import java.awt.GridBagLayout;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import javax.swing.ButtonGroup;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JRadioButton;
|
||||
import javax.swing.border.TitledBorder;
|
||||
|
||||
import mimis.Component;
|
||||
import mimis.input.Task;
|
||||
import mimis.router.Router;
|
||||
import mimis.value.Action;
|
||||
import mimis.value.Signal;
|
||||
import mimis.value.Target;
|
||||
import base.util.ArrayCycle;
|
||||
import base.work.Work;
|
||||
|
||||
public class CurrentButtonManager extends ButtonManager implements ActionListener {
|
||||
protected Router router;
|
||||
protected ArrayCycle<Component> componentCycle;
|
||||
protected Map<JRadioButton, Work> radioButtonMap;
|
||||
|
||||
public CurrentButtonManager(Router router, ArrayCycle<Component> componentCycle, String title, Work... workArray) {
|
||||
super(title, workArray);
|
||||
this.componentCycle = componentCycle;
|
||||
this.router = router;
|
||||
radioButtonMap = new HashMap<JRadioButton, Work>();
|
||||
}
|
||||
|
||||
public JPanel createPanel() {
|
||||
/* Initialize components */
|
||||
ButtonGroup buttonGroup = new ButtonGroup();
|
||||
GridBagLayout gridBagLayout = new GridBagLayout();
|
||||
GridBagConstraints gridBagConstraints = new GridBagConstraints();
|
||||
JPanel panel = new JPanel(gridBagLayout);
|
||||
|
||||
/* Set border */
|
||||
TitledBorder border = new TitledBorder(getTitle());
|
||||
border.setTitleJustification(TitledBorder.CENTER);
|
||||
panel.setBorder(border);
|
||||
|
||||
/* Initialize constraints */
|
||||
gridBagConstraints.fill = GridBagConstraints.BOTH;
|
||||
gridBagConstraints.weighty = 1;
|
||||
|
||||
for (WorkerButton button : getButtons()) {
|
||||
/* Add button */
|
||||
gridBagConstraints.gridwidth = GridBagConstraints.RELATIVE;
|
||||
gridBagConstraints.weightx = 1;
|
||||
gridBagLayout.setConstraints(button, gridBagConstraints);
|
||||
panel.add(button);
|
||||
|
||||
/* Add radio button */
|
||||
JRadioButton radioButton = new JRadioButton();
|
||||
buttonGroup.add(radioButton);
|
||||
radioButton.addActionListener(this);
|
||||
radioButtonMap.put(radioButton, button.work);
|
||||
gridBagConstraints.gridwidth = GridBagConstraints.REMAINDER;
|
||||
gridBagConstraints.weightx = 0;
|
||||
gridBagLayout.setConstraints(radioButton, gridBagConstraints);
|
||||
panel.add(radioButton);
|
||||
}
|
||||
return panel;
|
||||
}
|
||||
|
||||
public void actionPerformed(ActionEvent event) {
|
||||
JRadioButton radioButton = (JRadioButton) event.getSource();
|
||||
if (radioButtonMap.containsKey(radioButton)) {
|
||||
Work worker = radioButtonMap.get(radioButton);
|
||||
if (componentCycle.contains(worker)) {
|
||||
while (!componentCycle.current().equals(worker)) {
|
||||
componentCycle.next();
|
||||
}
|
||||
router.add(new Task(Action.CURRENT, Target.MAIN, Signal.END));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void currentChanged() {
|
||||
Work worker = componentCycle.current();
|
||||
if (radioButtonMap.containsValue(worker)) {
|
||||
for (Entry<JRadioButton, Work> entry : radioButtonMap.entrySet()) {
|
||||
if (entry.getValue().equals(worker)) {
|
||||
JRadioButton radioButton = (JRadioButton) entry.getKey();
|
||||
radioButton.setSelected(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
67
exec.mimis/src/main/java/mimis/manager/Manager.java
Normal file
@@ -0,0 +1,67 @@
|
||||
/**
|
||||
* Copyright (C) 2016 Rik Veenboer <rik.veenboer@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package mimis.manager;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
|
||||
import base.exception.worker.DeactivateException;
|
||||
import base.work.Work;
|
||||
import base.worker.IntervalWork;
|
||||
|
||||
public class Manager extends IntervalWork {
|
||||
protected static final int INTERVAL = 1000;
|
||||
|
||||
protected ArrayList<Work> workList;
|
||||
|
||||
public Manager(Work... workArray) {
|
||||
workList = new ArrayList<Work>();
|
||||
add(workArray);
|
||||
}
|
||||
|
||||
public void add(Work... workArray) {
|
||||
workList.addAll(Arrays.asList(workArray));
|
||||
}
|
||||
|
||||
public void remove(Work... workArray) {
|
||||
workList.removeAll(Arrays.asList(workArray));
|
||||
}
|
||||
|
||||
public void deactivate() throws DeactivateException {
|
||||
super.deactivate();
|
||||
for (Work worker : workList) {
|
||||
worker.stop();
|
||||
}
|
||||
}
|
||||
|
||||
public void exit() {
|
||||
super.exit();
|
||||
for (Work worker : workList) {
|
||||
worker.exit();
|
||||
}
|
||||
}
|
||||
|
||||
public int count() {
|
||||
return workList.size();
|
||||
}
|
||||
|
||||
public void work() {
|
||||
for (Work worker : workList) {
|
||||
worker.active();
|
||||
}
|
||||
}
|
||||
}
|
||||
21
exec.mimis/src/main/java/mimis/manager/Titled.java
Normal file
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* Copyright (C) 2016 Rik Veenboer <rik.veenboer@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package mimis.manager;
|
||||
|
||||
public interface Titled {
|
||||
public String getTitle();
|
||||
}
|
||||
66
exec.mimis/src/main/java/mimis/manager/WorkerButton.java
Normal file
@@ -0,0 +1,66 @@
|
||||
/**
|
||||
* Copyright (C) 2016 Rik Veenboer <rik.veenboer@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package mimis.manager;
|
||||
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseListener;
|
||||
|
||||
import javax.swing.JToggleButton;
|
||||
|
||||
import mimis.Component;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import base.work.Work;
|
||||
|
||||
public class WorkerButton extends JToggleButton implements MouseListener {
|
||||
protected static final long serialVersionUID = 1L;
|
||||
protected Logger logger = LoggerFactory.getLogger(getClass());
|
||||
|
||||
protected Work work;
|
||||
|
||||
public WorkerButton(Work worker) {
|
||||
this.work = worker;
|
||||
setFocusable(false);
|
||||
addMouseListener(this);
|
||||
if (worker instanceof Component) {
|
||||
setText(((Component) worker).getTitle());
|
||||
}
|
||||
}
|
||||
|
||||
public void mouseClicked(MouseEvent event) {
|
||||
if (work.active()) {
|
||||
logger.trace("Stop");
|
||||
work.stop();
|
||||
} else {
|
||||
logger.trace("Start");
|
||||
work.start();
|
||||
}
|
||||
}
|
||||
|
||||
public void mouseEntered(MouseEvent e) {}
|
||||
public void mouseExited(MouseEvent e) {}
|
||||
public void mousePressed(MouseEvent e) {}
|
||||
public void mouseReleased(MouseEvent e) {}
|
||||
|
||||
public void setPressed(boolean pressed) {
|
||||
if ((!isSelected() && pressed) || (isSelected() && !pressed)) {
|
||||
doClick();
|
||||
}
|
||||
}
|
||||
}
|
||||
105
exec.mimis/src/main/java/mimis/router/GlobalRouter.java
Normal file
@@ -0,0 +1,105 @@
|
||||
/**
|
||||
* Copyright (C) 2016 Rik Veenboer <rik.veenboer@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package mimis.router;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.ObjectInputStream;
|
||||
import java.io.ObjectOutputStream;
|
||||
import java.net.Socket;
|
||||
|
||||
import mimis.input.Feedback;
|
||||
import mimis.input.Task;
|
||||
import base.exception.worker.ActivateException;
|
||||
import base.exception.worker.DeactivateException;
|
||||
import base.work.Work;
|
||||
|
||||
public abstract class GlobalRouter extends Router {
|
||||
protected String ip;
|
||||
protected int port;
|
||||
protected Client client;
|
||||
|
||||
public GlobalRouter(String ip, int port) {
|
||||
this.ip = ip;
|
||||
this.port = port;
|
||||
}
|
||||
|
||||
public void activate() throws ActivateException {
|
||||
try {
|
||||
client = new Client(ip, port);
|
||||
} catch (IOException e) {
|
||||
logger.error("", e);
|
||||
throw new ActivateException();
|
||||
}
|
||||
super.activate();
|
||||
}
|
||||
|
||||
public void deactivate() throws DeactivateException {
|
||||
super.deactivate();
|
||||
client.stop();
|
||||
}
|
||||
|
||||
public void task(Task task) {
|
||||
try {
|
||||
client.send(task);
|
||||
} catch (IOException e) {
|
||||
logger.error("", e);
|
||||
}
|
||||
}
|
||||
|
||||
class Client extends Work {
|
||||
protected Socket socket;
|
||||
protected ObjectInputStream objectInputStream;
|
||||
protected ObjectOutputStream objectOutputStream;
|
||||
|
||||
public Client(String ip, int port) throws IOException {
|
||||
socket = new Socket(ip, port);
|
||||
objectInputStream = new ObjectInputStream(socket.getInputStream());
|
||||
objectOutputStream = new ObjectOutputStream(socket.getOutputStream());
|
||||
}
|
||||
|
||||
public void work() {
|
||||
try {
|
||||
Object object;
|
||||
do {
|
||||
object = objectInputStream.readObject();
|
||||
if (object instanceof Feedback) {
|
||||
add((Feedback) object);
|
||||
}
|
||||
} while (object != null);
|
||||
} catch (IOException e) {
|
||||
logger.error("", e);
|
||||
} catch (ClassNotFoundException e) {
|
||||
logger.error("", e);
|
||||
}
|
||||
}
|
||||
|
||||
public void deactivate() throws DeactivateException {
|
||||
super.deactivate();
|
||||
try {
|
||||
objectInputStream.close();
|
||||
objectOutputStream.close();
|
||||
socket.close();
|
||||
} catch (IOException e) {
|
||||
logger.error("", e);
|
||||
}
|
||||
}
|
||||
|
||||
public void send(Object object) throws IOException {
|
||||
objectOutputStream.writeObject(object);
|
||||
}
|
||||
}
|
||||
}
|
||||
45
exec.mimis/src/main/java/mimis/util/Swing.java
Normal file
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* Copyright (C) 2016 Rik Veenboer <rik.veenboer@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package mimis.util;
|
||||
|
||||
import java.awt.Image;
|
||||
import java.awt.Toolkit;
|
||||
import java.net.URL;
|
||||
|
||||
import javax.swing.ImageIcon;
|
||||
|
||||
public class Swing {
|
||||
protected static ClassLoader classLoader;
|
||||
protected static Toolkit toolkit;
|
||||
|
||||
static {
|
||||
classLoader = Swing.class.getClassLoader();
|
||||
toolkit = Toolkit.getDefaultToolkit();
|
||||
}
|
||||
|
||||
public static URL getResource(String name) {
|
||||
return classLoader.getResource(name);
|
||||
}
|
||||
|
||||
public static Image getImage(String name) {
|
||||
return toolkit.getImage(getResource(name));
|
||||
}
|
||||
|
||||
public static ImageIcon getImageIcon(String name) {
|
||||
return new ImageIcon(getResource(name));
|
||||
}
|
||||
}
|
||||
38
exec.mimis/src/main/java/mimis/util/swing/CycleButton.java
Normal file
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* Copyright (C) 2016 Rik Veenboer <rik.veenboer@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package mimis.util.swing;
|
||||
|
||||
import javax.swing.ImageIcon;
|
||||
|
||||
import base.util.ArrayCycle;
|
||||
|
||||
public class CycleButton extends HoldButton {
|
||||
protected static final long serialVersionUID = 1L;
|
||||
|
||||
protected ArrayCycle<ImageIcon> imageIconCycle;
|
||||
|
||||
public CycleButton(HoldButtonListener holdButtonListener, ArrayCycle<ImageIcon> imageIconCycle) {
|
||||
super(holdButtonListener);
|
||||
this.imageIconCycle = imageIconCycle;
|
||||
cycle();
|
||||
}
|
||||
|
||||
public void cycle() {
|
||||
setIcon(imageIconCycle.current());
|
||||
imageIconCycle.next();
|
||||
}
|
||||
}
|
||||
34
exec.mimis/src/main/java/mimis/util/swing/Dialog.java
Normal file
@@ -0,0 +1,34 @@
|
||||
/**
|
||||
* Copyright (C) 2016 Rik Veenboer <rik.veenboer@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package mimis.util.swing;
|
||||
|
||||
import javax.swing.JOptionPane;
|
||||
|
||||
public class Dialog {
|
||||
public static final String TITLE = "MIMIS Dialog";
|
||||
|
||||
public static String question(String message, Object initial) {
|
||||
return question(TITLE, message, initial);
|
||||
}
|
||||
|
||||
public static String question(String title, String message, Object initial) {
|
||||
return (String) JOptionPane.showInputDialog(
|
||||
null, message, title,
|
||||
JOptionPane.QUESTION_MESSAGE,
|
||||
null, null, initial);
|
||||
}
|
||||
}
|
||||
49
exec.mimis/src/main/java/mimis/util/swing/HoldButton.java
Normal file
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* Copyright (C) 2016 Rik Veenboer <rik.veenboer@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package mimis.util.swing;
|
||||
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseListener;
|
||||
|
||||
import javax.swing.JButton;
|
||||
|
||||
public class HoldButton extends JButton implements MouseListener {
|
||||
protected static final long serialVersionUID = 1L;
|
||||
|
||||
protected HoldButtonListener holdButtonListener;
|
||||
|
||||
public HoldButton(HoldButtonListener holdButtonListener) {
|
||||
this.holdButtonListener = holdButtonListener;
|
||||
addMouseListener(this);
|
||||
}
|
||||
|
||||
public void mousePressed(MouseEvent event) {
|
||||
if (event.getButton() == MouseEvent.BUTTON1) {
|
||||
holdButtonListener.buttonPressed(this);
|
||||
}
|
||||
}
|
||||
|
||||
public void mouseReleased(MouseEvent event) {
|
||||
if (event.getButton() == MouseEvent.BUTTON1) {
|
||||
holdButtonListener.buttonReleased(this);
|
||||
}
|
||||
}
|
||||
|
||||
public void mouseClicked(MouseEvent event) {}
|
||||
public void mouseEntered(MouseEvent event) {}
|
||||
public void mouseExited(MouseEvent event) {}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Copyright (C) 2016 Rik Veenboer <rik.veenboer@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package mimis.util.swing;
|
||||
|
||||
public interface HoldButtonListener {
|
||||
public void buttonPressed(HoldButton button);
|
||||
public void buttonReleased(HoldButton button);
|
||||
}
|
||||
33
exec.mimis/src/main/java/mimis/util/swing/ToggleButton.java
Normal file
@@ -0,0 +1,33 @@
|
||||
/**
|
||||
* Copyright (C) 2016 Rik Veenboer <rik.veenboer@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package mimis.util.swing;
|
||||
|
||||
import javax.swing.ImageIcon;
|
||||
|
||||
import base.util.ArrayCycle;
|
||||
|
||||
public class ToggleButton extends CycleButton {
|
||||
protected static final long serialVersionUID = 1L;
|
||||
|
||||
public ToggleButton(HoldButtonListener holdButtonListener, ImageIcon firstImageIcon, ImageIcon secondImageIcon) {
|
||||
super(holdButtonListener, new ArrayCycle<ImageIcon>(firstImageIcon, secondImageIcon));
|
||||
}
|
||||
|
||||
public void toggle() {
|
||||
cycle();
|
||||
}
|
||||
}
|
||||
21
exec.mimis/src/main/java/mimis/value/Target.java
Normal file
@@ -0,0 +1,21 @@
|
||||
/**
|
||||
* Copyright (C) 2016 Rik Veenboer <rik.veenboer@gmail.com>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package mimis.value;
|
||||
|
||||
public enum Target {
|
||||
ALL, MAIN, DEVICES, APPLICATIONS, SELF, CURRENT, MIMIS, APPLICATION;
|
||||
}
|
||||
BIN
exec.mimis/src/main/resources/M.ico
Normal file
|
After Width: | Height: | Size: 97 KiB |
BIN
exec.mimis/src/main/resources/M.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
@@ -0,0 +1 @@
|
||||
mimis.application.itunes.iTunesApplication
|
||||
@@ -0,0 +1,6 @@
|
||||
mimis.device.javainput.extreme3d.Extreme3DDevice
|
||||
mimis.device.javainput.rumblepad.RumblepadDevice
|
||||
mimis.device.javainput.xbox360.Xbox360Device
|
||||
mimis.device.jintellitype.JIntellitypeDevice
|
||||
mimis.device.panel.PanelDevice
|
||||
mimis.device.wiimote.WiimoteDevice
|
||||
BIN
exec.mimis/src/main/resources/Mimis.bmp
Normal file
|
After Width: | Height: | Size: 879 KiB |
BIN
exec.mimis/src/main/resources/Mimis.png
Normal file
|
After Width: | Height: | Size: 137 KiB |
1
exec.mimis/src/main/resources/commons-logging.properties
Normal file
@@ -0,0 +1 @@
|
||||
#org.apache.commons.logging.Log=org.apache.commons.logging.impl.SimpleLog
|
||||
BIN
exec.mimis/src/main/resources/icons/camera.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
exec.mimis/src/main/resources/icons/comment.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
exec.mimis/src/main/resources/icons/connect.png
Normal file
|
After Width: | Height: | Size: 1.5 KiB |
BIN
exec.mimis/src/main/resources/icons/control_eject_blue.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
exec.mimis/src/main/resources/icons/control_end_blue.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
exec.mimis/src/main/resources/icons/control_fastforward_blue.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
exec.mimis/src/main/resources/icons/control_pause_blue.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
exec.mimis/src/main/resources/icons/control_play_blue.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
exec.mimis/src/main/resources/icons/control_rewind_blue.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
exec.mimis/src/main/resources/icons/control_start_blue.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
exec.mimis/src/main/resources/icons/control_stop_blue.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
exec.mimis/src/main/resources/icons/down.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
exec.mimis/src/main/resources/icons/forward.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
exec.mimis/src/main/resources/icons/image.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
exec.mimis/src/main/resources/icons/mute.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
exec.mimis/src/main/resources/icons/next.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
exec.mimis/src/main/resources/icons/pause.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
exec.mimis/src/main/resources/icons/play.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
exec.mimis/src/main/resources/icons/previous.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
exec.mimis/src/main/resources/icons/repeat.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
exec.mimis/src/main/resources/icons/rewind.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
exec.mimis/src/main/resources/icons/shuffle.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
exec.mimis/src/main/resources/icons/sound_mute.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
exec.mimis/src/main/resources/icons/stop.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
exec.mimis/src/main/resources/icons/unmute.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
exec.mimis/src/main/resources/icons/up.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
exec.mimis/src/main/resources/icons/volumeDown.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
exec.mimis/src/main/resources/icons/volumeUp.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
8
exec.mimis/src/main/resources/log4j.properties
Normal file
@@ -0,0 +1,8 @@
|
||||
log4j.rootLogger=INFO, CA
|
||||
log4j.appender.CA=org.apache.log4j.ConsoleAppender
|
||||
log4j.appender.CA.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.CA.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
|
||||
log4j.appender.CUSTOM=test.CustomAppender
|
||||
log4j.appender.CUSTOM.Bla=1234
|
||||
log4j.appender.CUSTOM.layout=org.apache.log4j.PatternLayout
|
||||
log4j.appender.CUSTOM.layout.ConversionPattern=[%d{MMM dd HH:mm:ss}] %-5p (%F:%L) - %m%n
|
||||