mirror of
https://github.com/igniterealtime/Spark.git
synced 2025-10-29 11:47:01 +00:00
Merge pull request #768 from igniterealtime/spark-1815
SPARK-1815 SPARK-1782 SPARK-2318 Roar
This commit is contained in:
commit
6945943563
@ -182,4 +182,10 @@ public class ColorPick extends JPanel implements ChangeListener {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setEnabled(boolean enabled) {
|
||||
for(JSlider s : _sliderarray){
|
||||
s.setEnabled(enabled);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,7 +10,7 @@
|
||||
</parent>
|
||||
|
||||
<artifactId>roar</artifactId>
|
||||
<version>0.6</version>
|
||||
<version>1.0</version>
|
||||
|
||||
<name>Roar!!!</name>
|
||||
<description>Provides customizable popup/notification functionality.</description>
|
||||
|
||||
@ -15,9 +15,7 @@
|
||||
*/
|
||||
package org.jivesoftware.spark.roar;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import javax.swing.JFrame;
|
||||
import java.awt.*;
|
||||
|
||||
import org.jivesoftware.smack.packet.Message;
|
||||
import org.jivesoftware.spark.SparkManager;
|
||||
@ -29,7 +27,6 @@ import org.jivesoftware.spark.ui.GlobalMessageListener;
|
||||
import org.jivesoftware.spark.ui.rooms.ChatRoomImpl;
|
||||
import org.jivesoftware.spark.ui.rooms.GroupChatRoom;
|
||||
import org.jivesoftware.spark.util.log.Log;
|
||||
import org.jxmpp.jid.EntityBareJid;
|
||||
|
||||
/**
|
||||
* Message Listener<br>
|
||||
@ -41,8 +38,6 @@ public class RoarMessageListener implements GlobalMessageListener {
|
||||
|
||||
private final RoarProperties _properties;
|
||||
|
||||
private final HashMap<EntityBareJid, Long> _rooms = new HashMap<>();
|
||||
|
||||
public RoarMessageListener() {
|
||||
_properties = RoarProperties.getInstance();
|
||||
}
|
||||
@ -52,14 +47,10 @@ public class RoarMessageListener implements GlobalMessageListener {
|
||||
|
||||
try {
|
||||
ChatRoom activeroom = SparkManager.getChatManager().getChatContainer().getActiveChatRoom();
|
||||
|
||||
int framestate = SparkManager.getChatManager().getChatContainer().getChatFrame().getState();
|
||||
|
||||
final boolean chatContainerHasFocus = SparkManager.getChatManager().getChatContainer().isFocusOwner();
|
||||
final int framestate = SparkManager.getChatManager().getChatContainer().getChatFrame().getState();
|
||||
|
||||
// If the message is for a chat that's currently active and showing, do not popup.
|
||||
if (!chatContainerHasFocus && framestate == JFrame.NORMAL && activeroom.equals(room) && room.isShowing()
|
||||
&& (isOldGroupChat(room) || isMessageFromRoom(room, message))) {
|
||||
if (activeroom.equals(room) && framestate == Frame.NORMAL) {
|
||||
Log.debug( "Surpressing popup: chat is currently active and showing.");
|
||||
return;
|
||||
}
|
||||
@ -82,23 +73,13 @@ public class RoarMessageListener implements GlobalMessageListener {
|
||||
|
||||
private void decideForRoomAndMessage(ChatRoom room, Message message) {
|
||||
final RoarDisplayType displayType = RoarProperties.getInstance().getDisplayTypeClass();
|
||||
if (doesMessageMatchKeywords(message)) {
|
||||
displayType.messageReceived(room, message, isKeyWordDifferent() ? getKeywordBundle() : getSingleBundle());
|
||||
} else if (room instanceof ChatRoomImpl && !isSingleRoomDisabled()) {
|
||||
if (room instanceof ChatRoomImpl && !isSingleRoomDisabled()) {
|
||||
displayType.messageReceived(room, message, getSingleBundle());
|
||||
} else if (room instanceof GroupChatRoom && !isMutliRoomDisabled()) {
|
||||
displayType.messageReceived(room, message, isMultiRoomDifferent() ? getMultiBundle() : getSingleBundle());
|
||||
}
|
||||
}
|
||||
|
||||
private boolean doesMessageMatchKeywords(Message message) {
|
||||
for (String keyword : _properties.getKeywords()) {
|
||||
if (message.getBody().contains(keyword)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean isSingleRoomDisabled()
|
||||
{
|
||||
@ -109,12 +90,7 @@ public class RoarMessageListener implements GlobalMessageListener {
|
||||
{
|
||||
return _properties.getBoolean("group.disable", false);
|
||||
}
|
||||
|
||||
private boolean isKeyWordDifferent()
|
||||
{
|
||||
return _properties.getBoolean("keyword.different.enabled", false);
|
||||
}
|
||||
|
||||
|
||||
private boolean isMultiRoomDifferent()
|
||||
{
|
||||
return _properties.getBoolean("group.different.enabled", false);
|
||||
@ -130,42 +106,7 @@ public class RoarMessageListener implements GlobalMessageListener {
|
||||
_properties.getColor(RoarProperties.BACKGROUNDCOLOR_GROUP, _properties.getBackgroundColor()),
|
||||
_properties.getColor(RoarProperties.HEADERCOLOR_GROUP, _properties.getHeaderColor()),
|
||||
_properties.getColor(RoarProperties.TEXTCOLOR_GROUP, _properties.getTextColor()),
|
||||
_properties.getInt("group.duration"));
|
||||
}
|
||||
private PropertyBundle getKeywordBundle() {
|
||||
return new PropertyBundle(
|
||||
_properties.getColor(RoarProperties.BACKGROUNDCOLOR_KEYWORD, _properties.getBackgroundColor()),
|
||||
_properties.getColor(RoarProperties.HEADERCOLOR_KEYWORD, _properties.getHeaderColor()),
|
||||
_properties.getColor(RoarProperties.TEXTCOLOR_KEYWORD, _properties.getTextColor()),
|
||||
_properties.getInt("keyword.duration"));
|
||||
}
|
||||
|
||||
private boolean isOldGroupChat(ChatRoom room) {
|
||||
|
||||
boolean result = false;
|
||||
|
||||
if (room.getChatType() == Message.Type.groupchat) {
|
||||
|
||||
if (_rooms.containsKey(room.getBareJid()) && _rooms.get(room.getBareJid()) == -1L) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!_rooms.containsKey(room.getBareJid())) {
|
||||
_rooms.put(room.getBareJid(), System.currentTimeMillis());
|
||||
return true;
|
||||
} else {
|
||||
long start = _rooms.get(room.getBareJid());
|
||||
long now = System.currentTimeMillis();
|
||||
|
||||
result = (now - start) < 1500;
|
||||
if (result) {
|
||||
_rooms.put(room.getBareJid(), -1L);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
_properties.getDuration("group.duration"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -174,15 +115,4 @@ public class RoarMessageListener implements GlobalMessageListener {
|
||||
displayType.messageSent(room, message);
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if the message comes directly from the room
|
||||
*
|
||||
* @param room
|
||||
* @param message
|
||||
* @return boolean
|
||||
*/
|
||||
private boolean isMessageFromRoom(ChatRoom room, Message message) {
|
||||
return message.getFrom().equals(room.getBareJid());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -57,16 +57,9 @@ public class RoarProperties {
|
||||
public static final String TEXTCOLOR_GROUP = "textcolor.group";
|
||||
public static final String DURATION_GROUP = "duration.group";
|
||||
|
||||
public static final String BACKGROUNDCOLOR_KEYWORD = "backgroundcolor.keyword";
|
||||
public static final String HEADERCOLOR_KEYWORD = "headercolor.keyword";
|
||||
public static final String TEXTCOLOR_KEYWORD = "textcolor.keyword";
|
||||
public static final String DURATION_KEYWORD = "duration.keyword";
|
||||
|
||||
private static final Object LOCK = new Object();
|
||||
private static RoarProperties instance = null;
|
||||
|
||||
private List<String> keywords = null;
|
||||
|
||||
private final RoarDisplayType[] displayTypes = new RoarDisplayType[]{new TopRight(), new BottomRight(), new SparkToasterHandler(), new SystemNotification()};
|
||||
|
||||
|
||||
@ -123,7 +116,7 @@ public class RoarProperties {
|
||||
}
|
||||
|
||||
public Color getBackgroundColor() {
|
||||
return getColor(BACKGROUNDCOLOR, Color.BLACK);
|
||||
return getColor(BACKGROUNDCOLOR, Color.WHITE);
|
||||
}
|
||||
|
||||
public void setBackgroundColor(Color c) {
|
||||
@ -131,7 +124,7 @@ public class RoarProperties {
|
||||
}
|
||||
|
||||
public Color getHeaderColor() {
|
||||
return getColor(HEADERCOLOR, Color.RED);
|
||||
return getColor(HEADERCOLOR, new Color(255,85,0));
|
||||
}
|
||||
|
||||
public void setHeaderColor(Color c) {
|
||||
@ -139,7 +132,7 @@ public class RoarProperties {
|
||||
}
|
||||
|
||||
public Color getTextColor() {
|
||||
return getColor(TEXTCOLOR, Color.WHITE);
|
||||
return getColor(TEXTCOLOR, Color.BLACK);
|
||||
}
|
||||
|
||||
public void setTextColor(Color c) {
|
||||
@ -147,20 +140,20 @@ public class RoarProperties {
|
||||
}
|
||||
|
||||
public int getDuration() {
|
||||
int dur = getInt(DURATION);
|
||||
return dur < 0 ? 3000 : getInt(DURATION);
|
||||
int dur = getDuration(DURATION);
|
||||
return dur < 0 ? 3000 : getDuration(DURATION);
|
||||
}
|
||||
|
||||
public void setDuration(int dur) {
|
||||
setInt(DURATION, dur);
|
||||
setDuration(DURATION, dur);
|
||||
}
|
||||
|
||||
public int getMaximumPopups() {
|
||||
return getInt(AMOUNT);
|
||||
return getAmount(AMOUNT);
|
||||
}
|
||||
|
||||
public void setMaximumPopups(int amount) {
|
||||
setInt(AMOUNT, amount);
|
||||
setAmount(AMOUNT, amount);
|
||||
}
|
||||
|
||||
public void setDisplayType(String classstring) {
|
||||
@ -171,40 +164,6 @@ public class RoarProperties {
|
||||
public String getDisplayType() {
|
||||
return props.getProperty(ROARDISPLAYTYPE, displayTypes[0].getName()); // TopRight is default
|
||||
}
|
||||
|
||||
public void setKeywords(String commaseparated) {
|
||||
props.setProperty("keywords", commaseparated);
|
||||
|
||||
String[] pkeys = props.getProperty("keywords").split(",");
|
||||
if (pkeys.length > 0) {
|
||||
keywords = Arrays.asList(pkeys);
|
||||
} else {
|
||||
keywords = Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a cached version of the keywords, loads them from properties if it hasn't before.
|
||||
*/
|
||||
public List<String> getKeywords() {
|
||||
if (keywords == null) {
|
||||
final String propertyValue = props.getProperty("keywords");
|
||||
if ( propertyValue != null )
|
||||
{
|
||||
String[] pkeys = propertyValue.split( "," );
|
||||
if ( pkeys.length > 0 )
|
||||
{
|
||||
keywords = Arrays.asList( pkeys );
|
||||
}
|
||||
}
|
||||
|
||||
if ( keywords == null ) {
|
||||
keywords = Collections.emptyList();
|
||||
}
|
||||
}
|
||||
|
||||
return Collections.unmodifiableList(keywords);
|
||||
}
|
||||
|
||||
public RoarDisplayType getDisplayTypeClass() {
|
||||
|
||||
@ -228,11 +187,19 @@ public class RoarProperties {
|
||||
props.setProperty(property, Boolean.toString(value));
|
||||
}
|
||||
|
||||
public int getInt(String property) {
|
||||
return Integer.parseInt(props.getProperty(property, "0"));
|
||||
public int getDuration(String property) {
|
||||
return Integer.parseInt(props.getProperty(property, "3000"));
|
||||
}
|
||||
|
||||
public void setInt(String property, int integer) {
|
||||
public void setDuration(String property, int integer) {
|
||||
props.setProperty(property, "" + integer);
|
||||
}
|
||||
|
||||
public int getAmount(String property) {
|
||||
return Integer.parseInt(props.getProperty(property, "4"));
|
||||
}
|
||||
|
||||
public void setAmount(String property, int integer) {
|
||||
props.setProperty(property, "" + integer);
|
||||
}
|
||||
|
||||
|
||||
@ -56,8 +56,10 @@ public class BottomRight implements RoarDisplayType {
|
||||
@Override
|
||||
public void actionPerformed(ActionEvent e) {
|
||||
ChatFrame chatFrame = SparkManager.getChatManager().getChatContainer().getChatFrame();
|
||||
chatFrame.setState(Frame.NORMAL);
|
||||
chatFrame.setVisible(true);
|
||||
if(chatFrame != null){
|
||||
chatFrame.setState(Frame.NORMAL);
|
||||
chatFrame.setVisible(true);
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@ -16,11 +16,11 @@ public class SystemNotification implements RoarDisplayType {
|
||||
public void messageReceived(ChatRoom room, Message message, PropertyBundle bundle) {
|
||||
|
||||
String nickname = RoarPopupHelper.getNickname(room, message);
|
||||
//if (Spark.isMac()) {
|
||||
// MacNotificationCenter.sendNotification(nickname, message.getBody());
|
||||
//} else {
|
||||
if (Spark.isMac()) {
|
||||
MacNotificationCenter.sendNotification(nickname, message.getBody());
|
||||
} else {
|
||||
WindowsNotification.sendNotification(nickname, message.getBody());
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -9,7 +9,7 @@ public class WindowsNotification {
|
||||
|
||||
TrayIcon[] trayIcon = SystemTray.getSystemTray().getTrayIcons();
|
||||
if (trayIcon.length == 1) {
|
||||
trayIcon[0].displayMessage(title, bodyText, TrayIcon.MessageType.INFO);
|
||||
trayIcon[0].displayMessage(title, bodyText, TrayIcon.MessageType.NONE);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -54,8 +54,6 @@ public class RoarPreferencePanel extends JPanel {
|
||||
|
||||
private static final long serialVersionUID = -5334936099931215962L;
|
||||
|
||||
// private Image _backgroundimage;
|
||||
|
||||
private final JTextField _duration;
|
||||
private final JTextField _amount;
|
||||
private final JCheckBox _enabledCheckbox;
|
||||
@ -81,8 +79,6 @@ public class RoarPreferencePanel extends JPanel {
|
||||
|
||||
this.setLayout(new BorderLayout());
|
||||
|
||||
// ClassLoader cl = getClass().getClassLoader();
|
||||
// _backgroundimage = new ImageIcon(cl.getResource("background2.png")).getImage();
|
||||
|
||||
_duration = new JTextField();
|
||||
_amount = new JTextField();
|
||||
@ -104,7 +100,30 @@ public class RoarPreferencePanel extends JPanel {
|
||||
}
|
||||
|
||||
_typelist = new JComboBox<>( _typelistdata );
|
||||
_typelist.addActionListener( e -> updateWarningLabel(getDisplayTypeClass().getWarningMessage()) );
|
||||
_typelist.addActionListener( e -> {
|
||||
updateWarningLabel(getDisplayTypeClass().getWarningMessage());
|
||||
|
||||
switch (_typelist.getSelectedIndex()){
|
||||
case 2:
|
||||
_amount.setEnabled(false);
|
||||
_singleColorlist.setEnabled(false);
|
||||
_singleColorpicker.setEnabled(false);
|
||||
_duration.setEnabled(true);
|
||||
break;
|
||||
case 3:
|
||||
_amount.setEnabled(false);
|
||||
_singleColorlist.setEnabled(false);
|
||||
_singleColorpicker.setEnabled(false);
|
||||
_duration.setEnabled(false);
|
||||
break;
|
||||
default:
|
||||
_amount.setEnabled(true);
|
||||
_singleColorlist.setEnabled(true);
|
||||
_singleColorpicker.setEnabled(true);
|
||||
_duration.setEnabled(true);
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
add(makeGeneralSettingsPanel());
|
||||
_singleColorlist.addMouseListener(new MouseAdapter() {
|
||||
@ -138,9 +157,13 @@ public class RoarPreferencePanel extends JPanel {
|
||||
|
||||
rowcount++;
|
||||
JLabel warningLabel = new JLabel("<html>placeholder :-)</html>");
|
||||
//warningLabel.setForeground(Color.RED);
|
||||
generalPanel.add(warningLabel,
|
||||
new GridBagConstraints(1, rowcount, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, INSETS, 0, 0));
|
||||
rowcount++;
|
||||
generalPanel.add(_singleColorlist,
|
||||
new GridBagConstraints(0, rowcount, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, INSETS, 0, 0));
|
||||
generalPanel.add(_singleColorpicker,
|
||||
new GridBagConstraints(1, rowcount, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, INSETS, 0, 0));
|
||||
|
||||
|
||||
_components.put("label.warning", warningLabel);
|
||||
@ -149,7 +172,6 @@ public class RoarPreferencePanel extends JPanel {
|
||||
panel.add(generalPanel);
|
||||
panel.add(makeSinglePanel());
|
||||
panel.add(makeGroupChatPanel());
|
||||
panel.add(makeKeyWordPanel());
|
||||
|
||||
return new JScrollPane(panel);
|
||||
}
|
||||
@ -162,12 +184,7 @@ public class RoarPreferencePanel extends JPanel {
|
||||
|
||||
// row
|
||||
int rowcount = 0;
|
||||
singlePanel.add(_singleColorlist,
|
||||
new GridBagConstraints(0, rowcount, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, INSETS, 0, 0));
|
||||
singlePanel.add(_singleColorpicker,
|
||||
new GridBagConstraints(1, rowcount, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, INSETS, 0, 0));
|
||||
|
||||
rowcount++;
|
||||
singlePanel.add(new JLabel(RoarResources.getString("roar.duration")),
|
||||
new GridBagConstraints(0, rowcount, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, INSETS, 0, 0));
|
||||
singlePanel.add(_duration,
|
||||
@ -213,39 +230,6 @@ public class RoarPreferencePanel extends JPanel {
|
||||
return groupPanel;
|
||||
}
|
||||
|
||||
private JPanel makeKeyWordPanel() {
|
||||
JPanel panel = new JPanel();
|
||||
panel.setLayout(new GridBagLayout());
|
||||
panel.setBorder(BorderFactory.createTitledBorder(RoarResources.getString("roar.keyword")));
|
||||
|
||||
final JCheckBox differentKeyword = new JCheckBox(RoarResources.getString("roar.keyword.different"));
|
||||
differentKeyword.addActionListener( e -> toggleDifferentSettingsForKeyword(differentKeyword.isSelected()) );
|
||||
|
||||
JTextField durationKeyword = new JTextField();
|
||||
JTextField keywords = new JTextField();
|
||||
|
||||
int rowcount = 0;
|
||||
panel.add(differentKeyword,
|
||||
new GridBagConstraints(0, rowcount, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, INSETS, 0, 0));
|
||||
|
||||
rowcount++;
|
||||
panel.add(new JLabel(RoarResources.getString("roar.duration")),
|
||||
new GridBagConstraints(0, rowcount, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, INSETS, 0, 0));
|
||||
panel.add(durationKeyword,
|
||||
new GridBagConstraints(1, rowcount, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, INSETS, 0, 0));
|
||||
|
||||
rowcount++;
|
||||
panel.add(new JLabel(RoarResources.getString("roar.keyword.keyword")),
|
||||
new GridBagConstraints(0, rowcount, 1, 1, 0.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, INSETS, 0, 0));
|
||||
panel.add(keywords, new GridBagConstraints(1, rowcount, 1, 1, 1.0, 0.0, GridBagConstraints.NORTHWEST, GridBagConstraints.BOTH, INSETS, 0, 0));
|
||||
|
||||
_components.put("keyword.different.enabled", differentKeyword);
|
||||
_components.put("keyword.duration", durationKeyword);
|
||||
_components.put("keywords", keywords);
|
||||
|
||||
return panel;
|
||||
}
|
||||
|
||||
public void initializeValues() {
|
||||
RoarProperties props = RoarProperties.getInstance();
|
||||
|
||||
@ -255,29 +239,20 @@ public class RoarPreferencePanel extends JPanel {
|
||||
|
||||
setColor(ColorTypes.BACKGROUNDCOLOR, props.getBackgroundColor());
|
||||
setColor(ColorTypes.BACKGROUNDCOLOR_GROUP, props.getColor(RoarProperties.BACKGROUNDCOLOR_GROUP, props.getBackgroundColor()));
|
||||
setColor(ColorTypes.BACKGROUNDCOLOR_KEYWORD, props.getColor(RoarProperties.BACKGROUNDCOLOR_KEYWORD, props.getBackgroundColor()));
|
||||
setColor(ColorTypes.HEADERCOLOR, props.getHeaderColor());
|
||||
setColor(ColorTypes.HEADERCOLOR_GROUP, props.getColor(RoarProperties.HEADERCOLOR_GROUP, props.getHeaderColor()));
|
||||
setColor(ColorTypes.HEADERCOLOR_KEYWORD, props.getColor(RoarProperties.HEADERCOLOR_KEYWORD, props.getHeaderColor()));
|
||||
setColor(ColorTypes.TEXTCOLOR, props.getTextColor());
|
||||
setColor(ColorTypes.TEXTCOLOR_GROUP, props.getColor(RoarProperties.TEXTCOLOR_GROUP, props.getTextColor()));
|
||||
setColor(ColorTypes.TEXTCOLOR_KEYWORD, props.getColor(RoarProperties.TEXTCOLOR_KEYWORD, props.getTextColor()));
|
||||
|
||||
retrieveComponent("roar.disable.single", JCheckBox.class).setSelected(props.getBoolean("roar.disable.single", false));
|
||||
_duration.setText("" + props.getDuration());
|
||||
retrieveComponent("keyword.duration", JTextField.class).setText("" + props.getInt("keyword.duration"));
|
||||
retrieveComponent("group.duration", JTextField.class).setText("" + props.getInt("group.duration"));
|
||||
retrieveComponent("keywords", JTextField.class).setText(props.getProperty("keywords"));
|
||||
retrieveComponent("group.duration", JTextField.class).setText("" + props.getDuration("group.duration"));
|
||||
|
||||
retrieveComponent("group.disable", JCheckBox.class).setSelected(props.getBoolean("group.disable", false));
|
||||
|
||||
boolean group_different_enabled = props.getBoolean("group.different.enabled", false);
|
||||
retrieveComponent("group.different.enabled", JCheckBox.class).setSelected(group_different_enabled);
|
||||
toggleDifferentSettingsForGroup(group_different_enabled);
|
||||
|
||||
boolean keyword_different_enabled = props.getBoolean("keyword.different.enabled", false);
|
||||
retrieveComponent("keyword.different.enabled", JCheckBox.class).setSelected(keyword_different_enabled);
|
||||
toggleDifferentSettingsForKeyword(keyword_different_enabled);
|
||||
}
|
||||
|
||||
public void storeValues() {
|
||||
@ -287,24 +262,17 @@ public class RoarPreferencePanel extends JPanel {
|
||||
props.setMaximumPopups(this.getAmount());
|
||||
|
||||
props.setDuration(this.getDuration());
|
||||
props.setInt("group.duration", getIntFromTextField("group.duration"));
|
||||
props.setInt("keyword.duration", getIntFromTextField("keyword.duration"));
|
||||
|
||||
props.setKeywords(retrieveComponent("keywords", JTextField.class).getText());
|
||||
props.setDuration("group.duration", getIntFromTextField("group.duration"));
|
||||
|
||||
props.setBackgroundColor(getColor(ColorTypes.BACKGROUNDCOLOR));
|
||||
props.setColor(RoarProperties.BACKGROUNDCOLOR_GROUP, getColor(ColorTypes.BACKGROUNDCOLOR_GROUP));
|
||||
props.setColor(RoarProperties.BACKGROUNDCOLOR_KEYWORD, getColor(ColorTypes.BACKGROUNDCOLOR_KEYWORD));
|
||||
props.setTextColor(getColor(ColorTypes.TEXTCOLOR));
|
||||
props.setColor(RoarProperties.TEXTCOLOR_GROUP, getColor(ColorTypes.TEXTCOLOR_GROUP));
|
||||
props.setColor(RoarProperties.TEXTCOLOR_KEYWORD, getColor(ColorTypes.TEXTCOLOR_KEYWORD));
|
||||
props.setHeaderColor(getColor(ColorTypes.HEADERCOLOR));
|
||||
props.setColor(RoarProperties.HEADERCOLOR_GROUP, getColor(ColorTypes.HEADERCOLOR_GROUP));
|
||||
props.setColor(RoarProperties.HEADERCOLOR_KEYWORD, getColor(ColorTypes.HEADERCOLOR_KEYWORD));
|
||||
|
||||
props.setBoolean("roar.disable.single", retrieveComponent("roar.disable.single", JCheckBox.class).isSelected());
|
||||
props.setBoolean("group.different.enabled", retrieveComponent("group.different.enabled", JCheckBox.class).isSelected());
|
||||
props.setBoolean("keyword.different.enabled", retrieveComponent("keyword.different.enabled", JCheckBox.class).isSelected());
|
||||
props.setBoolean("group.disable", retrieveComponent("group.disable", JCheckBox.class).isSelected());
|
||||
|
||||
props.save();
|
||||
@ -394,27 +362,6 @@ public class RoarPreferencePanel extends JPanel {
|
||||
return getDisplayTypeClass().getName();
|
||||
}
|
||||
|
||||
private void toggleDifferentSettingsForKeyword(boolean isSelected) {
|
||||
|
||||
DefaultListModel<ColorTypes> model = (DefaultListModel<ColorTypes>) _singleColorlist.getModel();
|
||||
JTextField duration = retrieveComponent("keyword.duration", JTextField.class);
|
||||
|
||||
if (isSelected) {
|
||||
if (!model.contains(ColorTypes.BACKGROUNDCOLOR_KEYWORD)) {
|
||||
model.addElement(ColorTypes.BACKGROUNDCOLOR_KEYWORD);
|
||||
model.addElement(ColorTypes.HEADERCOLOR_KEYWORD);
|
||||
model.addElement(ColorTypes.TEXTCOLOR_KEYWORD);
|
||||
}
|
||||
duration.setEnabled(true);
|
||||
} else {
|
||||
model.removeElement(ColorTypes.BACKGROUNDCOLOR_KEYWORD);
|
||||
model.removeElement(ColorTypes.HEADERCOLOR_KEYWORD);
|
||||
model.removeElement(ColorTypes.TEXTCOLOR_KEYWORD);
|
||||
duration.setEnabled(false);
|
||||
duration.setText(_duration.getText());
|
||||
}
|
||||
}
|
||||
|
||||
private void toggleDifferentSettingsForGroup(boolean isSelected) {
|
||||
|
||||
DefaultListModel<ColorTypes> model = (DefaultListModel<ColorTypes>) _singleColorlist.getModel();
|
||||
@ -442,30 +389,6 @@ public class RoarPreferencePanel extends JPanel {
|
||||
}
|
||||
}
|
||||
|
||||
// ============================================================================================================
|
||||
// ============================================================================================================
|
||||
// ============================================================================================================
|
||||
// public void paintComponent(Graphics g) {
|
||||
// CENTER LOGO
|
||||
// int imgwi = _backgroundimage.getWidth(null);
|
||||
// int imghe = _backgroundimage.getHeight(null);
|
||||
// int x = this.getSize().width;
|
||||
// x = (x/2)-(imgwi/2) < 0 ? 0 : (x/2)-(imgwi/2) ;
|
||||
//
|
||||
// int y = this.getSize().height;
|
||||
// y = (y/2) -(imghe/2)< 0 ? 0 : y/2-(imghe/2) ;
|
||||
//
|
||||
// LOGO in bottom right corner
|
||||
//
|
||||
// int x = this.getSize().width - _backgroundimage.getWidth(null);
|
||||
// int y = this.getSize().height - _backgroundimage.getHeight(null);
|
||||
//
|
||||
// super.paintComponent(g);
|
||||
// g.drawImage(_backgroundimage, x, y, this);
|
||||
// }
|
||||
// ============================================================================================================
|
||||
// ============================================================================================================
|
||||
// ============================================================================================================
|
||||
public enum ColorTypes {
|
||||
BACKGROUNDCOLOR(RoarResources.getString("roar.background")),
|
||||
HEADERCOLOR(RoarResources.getString("roar.header")),
|
||||
@ -473,11 +396,8 @@ public class RoarPreferencePanel extends JPanel {
|
||||
|
||||
BACKGROUNDCOLOR_GROUP(RoarResources.getString("roar.background.group")),
|
||||
HEADERCOLOR_GROUP(RoarResources.getString("roar.header.group")),
|
||||
TEXTCOLOR_GROUP(RoarResources.getString("roar.text.group")),
|
||||
|
||||
BACKGROUNDCOLOR_KEYWORD(RoarResources.getString("roar.background.keyword")),
|
||||
HEADERCOLOR_KEYWORD(RoarResources.getString("roar.header.keyword")),
|
||||
TEXTCOLOR_KEYWORD(RoarResources.getString("roar.text.keyword"));
|
||||
TEXTCOLOR_GROUP(RoarResources.getString("roar.text.group"));
|
||||
|
||||
|
||||
private final String string;
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
<author>Wolf Posdorfer</author>
|
||||
<homePage>http://www.jivesoftware.com</homePage>
|
||||
<email>9posdorf@informatik.uni-hamburg.de</email>
|
||||
<minSparkVersion>2.7.0</minSparkVersion>
|
||||
<minSparkVersion>3.0.0</minSparkVersion>
|
||||
<os>Windows,Linux,Mac</os>
|
||||
<java>1.7.0</java>
|
||||
<java>1.8.0</java>
|
||||
</plugin>
|
||||
|
||||
@ -10,22 +10,16 @@ roar.display.topright = Top Right
|
||||
roar.display.bottomright = Bottom Right
|
||||
roar.background = Background color
|
||||
roar.background.group = Background color multi-user
|
||||
roar.background.keyword = Background color keyword
|
||||
roar.header = Header color
|
||||
roar.header.group = Header color multi-user
|
||||
roar.header.keyword = Header color keyword
|
||||
roar.text = Text color
|
||||
roar.text.group = Text color multi-user
|
||||
roar.text.keyword = Text color keyword
|
||||
|
||||
roar.single = Single-User
|
||||
roar.single.disable = Disable Roar for single-user chats
|
||||
roar.group = Multi-User
|
||||
roar.group.different = Use different settings for multi-user chats
|
||||
roar.group.disable = Disable Roar for multi-user chats
|
||||
roar.keyword = Keyword Matching
|
||||
roar.keyword.different = Use different settings for keyword matching
|
||||
roar.keyword.keyword = Keywords (comma separated)
|
||||
|
||||
roar.display.system = Operating System Notification
|
||||
|
||||
|
||||
@ -10,22 +10,16 @@ roar.display.topright = oben rechts
|
||||
roar.display.bottomright = unten rechts
|
||||
roar.background = Hintergrundfarbe
|
||||
roar.background.group = Hintergrundfarbe Gruppenchat
|
||||
roar.background.keyword = Hintergrundfarbe Stichwort
|
||||
roar.header = Überschrift
|
||||
roar.header.group = Überschrift Gruppenchat
|
||||
roar.header.keyword = Überschrift Stichwort
|
||||
roar.text = Textfarbe
|
||||
roar.text.group = Textfarbe Gruppenchat
|
||||
roar.text.keyword = Textfarbe Stichwort
|
||||
|
||||
roar.single = Einzelchat
|
||||
roar.single.disable = Roar für Einzelchats deaktivieren
|
||||
roar.group = Gruppenchat
|
||||
roar.group.different = Andere Einstellungen für Gruppenchats verwenden
|
||||
roar.group.disable = Roar für Gruppenchats deaktivieren
|
||||
roar.keyword = Stichwortsuche
|
||||
roar.keyword.different = Andere Einstellungen für Stichwortsuche verwenden
|
||||
roar.keyword.keyword = Stichworte (kommagetrennt)
|
||||
|
||||
roar.display.system = Betriebssystem-Mitteilung
|
||||
|
||||
@ -33,4 +27,4 @@ roar.warning.topright = Roar-spezifische Popups. Flexibel anpassbar.
|
||||
roar.warning.bottomright = Roar-spezifische Popups. Flexibel anpassbar.
|
||||
roar.warning.toaster = Spark Toaster Popups. Farben sind <u>nicht</u> anpassbar.
|
||||
roar.warning.system = Betriebssystemabhängige Popups. Farben und Dauer sind <u>nicht</u> anpassbar.
|
||||
roar.warning.system.mac = Benutzt das Mitteilungs-Center (OSX 10.8 und neuer).<br>Farben und Dauer sind <u>nicht</u> anpassbar.<br>Weitere Einstellungen unter: Mac-Systemeinstellungen -> Mitteilungen.
|
||||
roar.warning.system.mac = Benutzt das Mitteilungs-Center (OSX 10.8 und neuer).<br>Farben und Dauer sind <u>nicht</u> anpassbar.<br>Weitere Einstellungen unter: Mac-Systemeinstellungen -> Mitteilungen.
|
||||
|
||||
@ -10,22 +10,16 @@ roar.display.topright = Viršuje dešinėje
|
||||
roar.display.bottomright = Apačioje dešinėje
|
||||
roar.background = Fono spalva
|
||||
roar.background.group = Fono spalva grupiniam pokalbiui
|
||||
roar.background.keyword = Fono spalva raktiniam žodžiui
|
||||
roar.header = Antraštės spalva
|
||||
roar.header.group = Antraštės spalva grupiniam pokalbiui
|
||||
roar.header.keyword = Antraštės spalva raktiniam žodžiui
|
||||
roar.text = Teksto spalva
|
||||
roar.text.group = Teksto spalva grupiniam pokalbiui
|
||||
roar.text.keyword = Teksto spalva raktiniam žodžiui
|
||||
|
||||
roar.single = Paprastas pokalbis
|
||||
roar.single.disable = Išjungti Roar paprastuose pokalbiuose (su vienu adresatu)
|
||||
roar.group = Grupinis pokalbis
|
||||
roar.group.different = Naudoti skirtingus nustatymus grupiniuose pokalbiuose
|
||||
roar.group.disable = išjungti Roar grupiniuose pokalbiuose
|
||||
roar.keyword = Raktinis žodis
|
||||
roar.keyword.different = Naudoti skirtingus nustatymus raktiniam žodžiui
|
||||
roar.keyword.keyword = Raktiniai žodžiai (atskirti kalbleliu)
|
||||
|
||||
roar.display.system = Operacinės sistemos pranešimas
|
||||
|
||||
|
||||
@ -10,22 +10,16 @@ roar.display.topright = Górna prawa
|
||||
roar.display.bottomright = Dolna prawa
|
||||
roar.background = Kolor tła
|
||||
roar.background.group = Kolor tła multi użytkownika
|
||||
roar.background.keyword = Kolor tła słów kluczowych
|
||||
roar.header = Kolor nagłówka
|
||||
roar.header.group = Kolor nagłówka multi użytkownika
|
||||
roar.header.keyword = Kolor nagłówka słów kluczowych
|
||||
roar.text = Kolor tekstu
|
||||
roar.text.group = Kolor tekstu multi użytkownika
|
||||
roar.text.keyword = Kolor tekstu słów kluczowych
|
||||
|
||||
roar.single = Pojedynczy Użytkownik
|
||||
roar.single.disable = Wyłącz Roar dla czatów pojedynczego użytkownika
|
||||
roar.group = Multi Użytkownik
|
||||
roar.group.different = Używaj różnych ustawień dla czatów multi użytkownika
|
||||
roar.group.disable = Wyłącz Roar dla czatów multi użytkownika
|
||||
roar.keyword = Dopasowanie słów kluczowych
|
||||
roar.keyword.different = Używaj różnych ustawień dla dopasowania słów kluczowych
|
||||
roar.keyword.keyword = Słowa kluczowe (oddzielone przecinkami)
|
||||
|
||||
roar.display.system = Powiadomienia systemu operacyjnego
|
||||
|
||||
|
||||
@ -10,23 +10,16 @@ roar.display.topright = Правый верхнем
|
||||
roar.display.bottomright = Нижний правый
|
||||
roar.background = Фоновый цвет
|
||||
roar.background.group = Цвет фона для многопользовательских чатов
|
||||
roar.background.keyword = Ключевой цвет фона
|
||||
roar.header = Цвет заголовка
|
||||
roar.header.group = Цвет заголовка для многопользовательских чатов
|
||||
roar.header.keyword = Ключевой цвет заголовка
|
||||
roar.text = Цвет текста
|
||||
roar.text.group = Цвет текста для многопользовательских чатов
|
||||
roar.text.keyword = Ключевой цвета текста
|
||||
|
||||
roar.single = Один пользователь
|
||||
roar.single.disable = Отключить Roar для однопользовательских чатов
|
||||
roar.group = Многопользовательский чат
|
||||
roar.group.different = Использовать разные настройки для многопользовательских чатов
|
||||
roar.group.disable = Отключить Roar для многопользовательских чатов
|
||||
roar.keyword = Ключевые соответствия
|
||||
roar.keyword.different = Использовать разные настройки для ключевых соответствия
|
||||
roar.keyword.keyword = Ключевые слова (через запятую)
|
||||
|
||||
roar.display.system = Уведомления операционной системы
|
||||
|
||||
roar.warning.topright = Пользовательский стиль уведомления Roar
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user