Refactor some classes, delete obsolete exceptions
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
/**
|
||||
* Copyright (C) 2015 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;
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
/**
|
||||
* Copyright (C) 2015 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 InitialiseException extends HandlerException {
|
||||
protected static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
/**
|
||||
* Copyright (C) 2015 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 TaskException extends Exception {
|
||||
protected static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
/**
|
||||
* Copyright (C) 2015 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.application;
|
||||
|
||||
import mimis.exception.ApplicationException;
|
||||
|
||||
public class ApplicationExitException extends ApplicationException {
|
||||
protected static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
/**
|
||||
* Copyright (C) 2015 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.application;
|
||||
|
||||
import mimis.exception.InitialiseException;
|
||||
|
||||
public class ApplicationInitialiseException extends InitialiseException {
|
||||
protected static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
/**
|
||||
* Copyright (C) 2015 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.button;
|
||||
|
||||
import mimis.exception.ButtonException;
|
||||
|
||||
public class UnknownDirectionException extends ButtonException {
|
||||
protected static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -14,10 +14,10 @@
|
||||
* 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.task;
|
||||
package mimis.exception.device;
|
||||
|
||||
import mimis.exception.TaskException;
|
||||
import mimis.exception.DeviceException;
|
||||
|
||||
public class ActionException extends TaskException {
|
||||
public class DeviceNotFoundException extends DeviceException {
|
||||
protected static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
/**
|
||||
* Copyright (C) 2015 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;
|
||||
|
||||
import mimis.exception.EventException;
|
||||
|
||||
public class SpreaderException extends EventException {
|
||||
protected static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -1,21 +0,0 @@
|
||||
/**
|
||||
* Copyright (C) 2015 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.task;
|
||||
|
||||
public class TaskNotSupportedException extends Exception {
|
||||
protected static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
/**
|
||||
* Copyright (C) 2015 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.task.action;
|
||||
|
||||
import mimis.exception.task.ActionException;
|
||||
|
||||
public class ActionDeserializeException extends ActionException {
|
||||
protected static final long serialVersionUID = 1L;
|
||||
}
|
||||
@@ -1,70 +0,0 @@
|
||||
/**
|
||||
* Copyright (C) 2015 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 mimis.util.multiplexer.SignalListener;
|
||||
import mimis.value.Signal;
|
||||
import base.work.Work;
|
||||
|
||||
public class Multiplexer<T> extends Work {
|
||||
public static final int TIMEOUT = 150;
|
||||
|
||||
protected int threshold;
|
||||
protected T type;
|
||||
protected SignalListener<T> signalListener;
|
||||
protected boolean end;
|
||||
|
||||
public Multiplexer(SignalListener<T> signalListener) {
|
||||
this(signalListener, TIMEOUT);
|
||||
}
|
||||
|
||||
public Multiplexer(SignalListener<T> signalListener, int treshold) {
|
||||
this.signalListener = signalListener;
|
||||
}
|
||||
|
||||
public synchronized void add(T object) {
|
||||
if (type == null) {
|
||||
signalListener.add(Signal.BEGIN, object);
|
||||
type = object;
|
||||
end = true;
|
||||
start();
|
||||
} else if (type.equals(object)) {
|
||||
end = false;
|
||||
notifyAll();
|
||||
} else {
|
||||
end = true;
|
||||
synchronized (this) {
|
||||
notifyAll();
|
||||
}
|
||||
add(object);
|
||||
}
|
||||
}
|
||||
|
||||
public void work() {
|
||||
try {
|
||||
synchronized (this) {
|
||||
wait(TIMEOUT);
|
||||
}
|
||||
} catch (InterruptedException e) {}
|
||||
if (end) {
|
||||
signalListener.add(Signal.END, type);
|
||||
type = null;
|
||||
stop();
|
||||
}
|
||||
end = !end;
|
||||
}
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
/**
|
||||
* Copyright (C) 2015 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));
|
||||
}
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
/**
|
||||
* Copyright (C) 2015 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();
|
||||
}
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
/**
|
||||
* Copyright (C) 2015 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);
|
||||
}
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
/**
|
||||
* Copyright (C) 2015 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) {}
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
/**
|
||||
* Copyright (C) 2015 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);
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
/**
|
||||
* Copyright (C) 2015 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();
|
||||
}
|
||||
}
|
||||
@@ -1,100 +0,0 @@
|
||||
/**
|
||||
* Copyright (C) 2015 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 Command {
|
||||
BROWSER_BACKWARD (1),
|
||||
BROWSER_FORWARD (2),
|
||||
BROWSER_REFRESH (3),
|
||||
BROWSER_STOP (4),
|
||||
BROWSER_SEARCH (5),
|
||||
BROWSER_FAVORITES (6),
|
||||
BROWSER_HOME (7),
|
||||
VOLUME_MUTE (8),
|
||||
VOLUME_DOWN (9),
|
||||
VOLUME_UP (10),
|
||||
MEDIA_NEXTTRACK (11),
|
||||
MEDIA_PREVIOUSTRACK (12),
|
||||
MEDIA_STOP (13),
|
||||
MEDIA_PLAY_PAUSE (14),
|
||||
LAUNCH_MAIL (15),
|
||||
LAUNCH_MEDIA_SELECT (16),
|
||||
LAUNCH_APP1 (17),
|
||||
LAUNCH_APP2 (18),
|
||||
BASS_DOWN (19),
|
||||
BASS_BOOST (20),
|
||||
BASS_UP (21),
|
||||
TREBLE_DOWN (22),
|
||||
TREBLE_UP (23),
|
||||
MICROPHONE_VOLUME_MUTE (24),
|
||||
MICROPHONE_VOLUME_DOWN (25),
|
||||
MICROPHONE_VOLUME_UP (26),
|
||||
HELP (27),
|
||||
FIND (28),
|
||||
NEW (29),
|
||||
OPEN (30),
|
||||
CLOSE (31),
|
||||
SAVE (32),
|
||||
PRINT (33),
|
||||
UNDO (34),
|
||||
REDO (35),
|
||||
COPY (36),
|
||||
CUT (37),
|
||||
PASTE (38),
|
||||
REPLY_TO_MAIL (39),
|
||||
FORWARD_MAIL (40),
|
||||
SEND_MAIL (41),
|
||||
SPELL_CHECK (42),
|
||||
DICTATE_OR_COMMAND_CONTROL_TOGGLE (43),
|
||||
MIC_ON_OFF_TOGGLE (44),
|
||||
CORRECTION_LIST (45),
|
||||
MEDIA_PLAY (46),
|
||||
MEDIA_PAUSE (47),
|
||||
MEDIA_RECORD (48),
|
||||
MEDIA_FAST_FORWARD (49),
|
||||
MEDIA_REWIND (50),
|
||||
MEDIA_CHANNEL_UP (51),
|
||||
MEDIA_CHANNEL_DOWN (52),
|
||||
DELETE (53),
|
||||
DWM_FLIP3D (54);
|
||||
|
||||
protected int code;
|
||||
|
||||
private Command(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public enum System {
|
||||
MOVE (0xf010),
|
||||
MAXIMIZE (0xf030),
|
||||
MINIMIZE (0xf020);
|
||||
|
||||
protected int code;
|
||||
|
||||
private System(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,196 +0,0 @@
|
||||
/**
|
||||
* Copyright (C) 2015 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 Key {
|
||||
/*
|
||||
* VK_0 - VK_9 are the same as ASCII '0' - '9' (0x30 - 0x39)
|
||||
* 0x40 : unassigned
|
||||
* VK_A - VK_Z are the same as ASCII 'A' - 'Z' (0x41 - 0x5A)
|
||||
*/
|
||||
LBUTTON (0x01),
|
||||
RBUTTON (0x02),
|
||||
CANCEL (0x03),
|
||||
MBUTTON (0x04),
|
||||
XBUTTON1 (0x05),
|
||||
XBUTTON2 (0x06),
|
||||
BACK (0x08),
|
||||
TAB (0x09),
|
||||
CLEAR (0x0C),
|
||||
RETURN (0x0D),
|
||||
SHIFT (0x10),
|
||||
CONTROL (0x11),
|
||||
MENU (0x12),
|
||||
PAUSE (0x13),
|
||||
CAPITAL (0x14),
|
||||
KANA (0x15),
|
||||
HANGEUL (0x15),
|
||||
HANGUL (0x15),
|
||||
JUNJA (0x17),
|
||||
FINAL (0x18),
|
||||
HANJA (0x19),
|
||||
KANJI (0x19),
|
||||
ESCAPE (0x1B),
|
||||
CONVERT (0x1C),
|
||||
NONCONVERT (0x1D),
|
||||
ACCEPT (0x1E),
|
||||
MODECHANGE (0x1F),
|
||||
SPACE (0x20),
|
||||
PRIOR (0x21),
|
||||
NEXT (0x22),
|
||||
END (0x23),
|
||||
HOME (0x24),
|
||||
LEFT (0x25),
|
||||
UP (0x26),
|
||||
RIGHT (0x27),
|
||||
DOWN (0x28),
|
||||
SELECT (0x29),
|
||||
PRINT (0x2A),
|
||||
EXECUTE (0x2B),
|
||||
SNAPSHOT (0x2C),
|
||||
INSERT (0x2D),
|
||||
DELETE (0x2E),
|
||||
HELP (0x2F),
|
||||
LWIN (0x5B),
|
||||
RWIN (0x5C),
|
||||
APPS (0x5D),
|
||||
SLEEP (0x5F),
|
||||
NUMPAD0 (0x60),
|
||||
NUMPAD1 (0x61),
|
||||
NUMPAD2 (0x62),
|
||||
NUMPAD3 (0x63),
|
||||
NUMPAD4 (0x64),
|
||||
NUMPAD5 (0x65),
|
||||
NUMPAD6 (0x66),
|
||||
NUMPAD7 (0x67),
|
||||
NUMPAD8 (0x68),
|
||||
NUMPAD9 (0x69),
|
||||
MULTIPLY (0x6A),
|
||||
ADD (0x6B),
|
||||
SEPARATOR (0x6C),
|
||||
SUBTRACT (0x6D),
|
||||
DECIMAL (0x6E),
|
||||
DIVIDE (0x6F),
|
||||
F1 (0x70),
|
||||
F2 (0x71),
|
||||
F3 (0x72),
|
||||
F4 (0x73),
|
||||
F5 (0x74),
|
||||
F6 (0x75),
|
||||
F7 (0x76),
|
||||
F8 (0x77),
|
||||
F9 (0x78),
|
||||
F10 (0x79),
|
||||
F11 (0x7A),
|
||||
F12 (0x7B),
|
||||
F13 (0x7C),
|
||||
F14 (0x7D),
|
||||
F15 (0x7E),
|
||||
F16 (0x7F),
|
||||
F17 (0x80),
|
||||
F18 (0x81),
|
||||
F19 (0x82),
|
||||
F20 (0x83),
|
||||
F21 (0x84),
|
||||
F22 (0x85),
|
||||
F23 (0x86),
|
||||
F24 (0x87),
|
||||
NUMLOCK (0x90),
|
||||
SCROLL (0x91),
|
||||
OEM_NEC_EQUAL (0x92),
|
||||
OEM_FJ_JISHO (0x92),
|
||||
OEM_FJ_MASSHOU (0x93),
|
||||
OEM_FJ_TOUROKU (0x94),
|
||||
OEM_FJ_LOYA (0x95),
|
||||
OEM_FJ_ROYA (0x96),
|
||||
LSHIFT (0xA0),
|
||||
RSHIFT (0xA1),
|
||||
LCONTROL (0xA2),
|
||||
RCONTROL (0xA3),
|
||||
LMENU (0xA4),
|
||||
RMENU (0xA5),
|
||||
BROWSER_BACK (0xA6),
|
||||
BROWSER_FORWARD (0xA7),
|
||||
BROWSER_REFRESH (0xA8),
|
||||
BROWSER_STOP (0xA9),
|
||||
BROWSER_SEARCH (0xAA),
|
||||
BROWSER_FAVORITES (0xAB),
|
||||
BROWSER_HOME (0xAC),
|
||||
VOLUME_MUTE (0xAD),
|
||||
VOLUME_DOWN (0xAE),
|
||||
VOLUME_UP (0xAF),
|
||||
MEDIA_NEXT_TRACK (0xB0),
|
||||
MEDIA_PREV_TRACK (0xB1),
|
||||
MEDIA_STOP (0xB2),
|
||||
MEDIA_PLAY_PAUSE (0xB3),
|
||||
LAUNCH_MAIL (0xB4),
|
||||
LAUNCH_MEDIA_SELECT (0xB5),
|
||||
LAUNCH_APP1 (0xB6),
|
||||
LAUNCH_APP2 (0xB7),
|
||||
OEM_1 (0xBA),
|
||||
OEM_PLUS (0xBB),
|
||||
OEM_COMMA (0xBC),
|
||||
OEM_MINUS (0xBD),
|
||||
OEM_PERIOD (0xBE),
|
||||
OEM_2 (0xBF),
|
||||
OEM_3 (0xC0),
|
||||
OEM_4 (0xDB),
|
||||
OEM_5 (0xDC),
|
||||
OEM_6 (0xDD),
|
||||
OEM_7 (0xDE),
|
||||
OEM_8 (0xDF),
|
||||
OEM_AX (0xE1),
|
||||
OEM_102 (0xE2),
|
||||
ICO_HELP (0xE3),
|
||||
ICO_00 (0xE4),
|
||||
PROCESSKEY (0xE5),
|
||||
ICO_CLEAR (0xE6),
|
||||
PACKET (0xE7),
|
||||
OEM_RESET (0xE9),
|
||||
OEM_JUMP (0xEA),
|
||||
OEM_PA1 (0xEB),
|
||||
OEM_PA2 (0xEC),
|
||||
OEM_PA3 (0xED),
|
||||
OEM_WSCTRL (0xEE),
|
||||
OEM_CUSEL (0xEF),
|
||||
OEM_ATTN (0xF0),
|
||||
OEM_FINISH (0xF1),
|
||||
OEM_COPY (0xF2),
|
||||
OEM_AUTO (0xF3),
|
||||
OEM_ENLW (0xF4),
|
||||
OEM_BACKTAB (0xF5),
|
||||
ATTN (0xF6),
|
||||
CRSEL (0xF7),
|
||||
EXSEL (0xF8),
|
||||
EREOF (0xF9),
|
||||
PLAY (0xFA),
|
||||
ZOOM (0xFB),
|
||||
NONAME (0xFC),
|
||||
PA1 (0xFD),
|
||||
OEM_CLEAR (0xFE);
|
||||
|
||||
protected int code;
|
||||
|
||||
private Key(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,34 +0,0 @@
|
||||
/**
|
||||
* Copyright (C) 2015 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 Type {
|
||||
UP (0x0101), // WM_KEYUP
|
||||
DOWN (0x0100), // WM_KEYDOWN
|
||||
SYSUP (0x0105), // WM_SYSKEYUP
|
||||
SYSDOWN (0x0104); // WM_SYSKEYDOWN
|
||||
|
||||
protected int code;
|
||||
|
||||
private Type(int code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user