about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--client/trunk/src/com/fourisland/instadisc/ActionFilterForm.form180
-rw-r--r--client/trunk/src/com/fourisland/instadisc/ActionFilterForm.java234
-rw-r--r--client/trunk/src/com/fourisland/instadisc/AddSubscriptionForm.form6
-rw-r--r--client/trunk/src/com/fourisland/instadisc/AddSubscriptionForm.java10
-rw-r--r--client/trunk/src/com/fourisland/instadisc/AdvancedSettingsForm.form40
-rw-r--r--client/trunk/src/com/fourisland/instadisc/AdvancedSettingsForm.java30
-rw-r--r--client/trunk/src/com/fourisland/instadisc/Database/Filter.java63
-rw-r--r--client/trunk/src/com/fourisland/instadisc/Database/Wrapper.java73
-rw-r--r--client/trunk/src/com/fourisland/instadisc/FirstRun/Step1.form20
-rw-r--r--client/trunk/src/com/fourisland/instadisc/FirstRun/Step1.java14
-rw-r--r--client/trunk/src/com/fourisland/instadisc/FirstRun/Step2.form52
-rw-r--r--client/trunk/src/com/fourisland/instadisc/FirstRun/Step2.java43
-rw-r--r--client/trunk/src/com/fourisland/instadisc/FirstRun/Step3.form8
-rw-r--r--client/trunk/src/com/fourisland/instadisc/FirstRun/Step3.java6
-rw-r--r--client/trunk/src/com/fourisland/instadisc/IDFilterListCellRenderer.java45
-rw-r--r--client/trunk/src/com/fourisland/instadisc/IDItemListCellRenderer.java11
-rw-r--r--client/trunk/src/com/fourisland/instadisc/InstaDiscView.form3
-rw-r--r--client/trunk/src/com/fourisland/instadisc/InstaDiscView.java10
-rw-r--r--client/trunk/src/com/fourisland/instadisc/Item/Categories/Category.java19
-rw-r--r--client/trunk/src/com/fourisland/instadisc/Item/Item.java2
-rw-r--r--client/trunk/src/com/fourisland/instadisc/Item/SubscriptionFile.java24
-rw-r--r--client/trunk/src/com/fourisland/instadisc/ManageFiltersForm.form170
-rw-r--r--client/trunk/src/com/fourisland/instadisc/ManageFiltersForm.java266
-rw-r--r--client/trunk/src/com/fourisland/instadisc/ManageSubscriptionsForm.form5
-rw-r--r--client/trunk/src/com/fourisland/instadisc/ManageSubscriptionsForm.java14
-rw-r--r--client/trunk/src/com/fourisland/instadisc/resources/ActionFilterForm.properties12
-rw-r--r--client/trunk/src/com/fourisland/instadisc/resources/ManageFiltersForm.properties7
27 files changed, 1237 insertions, 130 deletions
diff --git a/client/trunk/src/com/fourisland/instadisc/ActionFilterForm.form b/client/trunk/src/com/fourisland/instadisc/ActionFilterForm.form new file mode 100644 index 0000000..33eddf1 --- /dev/null +++ b/client/trunk/src/com/fourisland/instadisc/ActionFilterForm.form
@@ -0,0 +1,180 @@
1<?xml version="1.0" encoding="UTF-8" ?>
2
3<Form version="1.5" maxVersion="1.5" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
4 <Properties>
5 <Property name="defaultCloseOperation" type="int" value="2"/>
6 <Property name="name" type="java.lang.String" value="Form" noResource="true"/>
7 </Properties>
8 <SyntheticProperties>
9 <SyntheticProperty name="formSizePolicy" type="int" value="1"/>
10 </SyntheticProperties>
11 <AuxValues>
12 <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="2"/>
13 <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="true"/>
14 <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
15 <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
16 <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
17 <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
18 <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
19 <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
20 </AuxValues>
21
22 <Layout>
23 <DimensionLayout dim="0">
24 <Group type="103" groupAlignment="0" attributes="0">
25 <Group type="102" attributes="0">
26 <Group type="103" groupAlignment="0" attributes="0">
27 <Group type="102" attributes="0">
28 <EmptySpace max="-2" attributes="0"/>
29 <Group type="103" groupAlignment="0" attributes="0">
30 <Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/>
31 <Group type="102" alignment="0" attributes="0">
32 <EmptySpace min="12" pref="12" max="12" attributes="0"/>
33 <Group type="103" groupAlignment="0" attributes="0">
34 <Component id="jLabel2" alignment="0" min="-2" pref="391" max="-2" attributes="0"/>
35 <Group type="102" alignment="0" attributes="1">
36 <Component id="jLabel3" min="-2" max="-2" attributes="0"/>
37 <EmptySpace max="-2" attributes="0"/>
38 <Component id="jComboBox1" pref="346" max="32767" attributes="0"/>
39 </Group>
40 <Group type="102" alignment="0" attributes="0">
41 <Component id="jLabel4" min="-2" max="-2" attributes="0"/>
42 <EmptySpace max="-2" attributes="0"/>
43 <Component id="jCheckBox1" min="-2" max="-2" attributes="0"/>
44 </Group>
45 <Group type="102" alignment="0" attributes="0">
46 <Component id="jLabel6" min="-2" max="-2" attributes="0"/>
47 <EmptySpace max="-2" attributes="0"/>
48 <Component id="jTextField1" pref="308" max="32767" attributes="0"/>
49 </Group>
50 </Group>
51 </Group>
52 </Group>
53 </Group>
54 <Group type="102" alignment="0" attributes="0">
55 <EmptySpace min="-2" pref="36" max="-2" attributes="0"/>
56 <Component id="jLabel5" pref="379" max="32767" attributes="0"/>
57 </Group>
58 <Group type="102" alignment="1" attributes="0">
59 <EmptySpace pref="324" max="32767" attributes="0"/>
60 <Component id="jButton2" min="-2" max="-2" attributes="0"/>
61 <EmptySpace max="-2" attributes="0"/>
62 <Component id="jButton1" min="-2" max="-2" attributes="0"/>
63 </Group>
64 </Group>
65 <EmptySpace max="-2" attributes="0"/>
66 </Group>
67 </Group>
68 </DimensionLayout>
69 <DimensionLayout dim="1">
70 <Group type="103" groupAlignment="0" attributes="0">
71 <Group type="102" alignment="0" attributes="0">
72 <EmptySpace min="-2" max="-2" attributes="0"/>
73 <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
74 <EmptySpace min="-2" max="-2" attributes="0"/>
75 <Component id="jLabel2" pref="34" max="32767" attributes="0"/>
76 <EmptySpace min="-2" max="-2" attributes="0"/>
77 <Group type="103" groupAlignment="3" attributes="0">
78 <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
79 <Component id="jComboBox1" alignment="3" min="-2" max="-2" attributes="0"/>
80 </Group>
81 <EmptySpace min="-2" max="-2" attributes="0"/>
82 <Group type="103" groupAlignment="1" attributes="0">
83 <Component id="jLabel4" min="-2" max="-2" attributes="0"/>
84 <Component id="jCheckBox1" min="-2" max="-2" attributes="0"/>
85 </Group>
86 <EmptySpace max="-2" attributes="0"/>
87 <Component id="jLabel5" min="-2" pref="51" max="-2" attributes="0"/>
88 <EmptySpace max="-2" attributes="0"/>
89 <Group type="103" groupAlignment="3" attributes="0">
90 <Component id="jLabel6" alignment="3" min="-2" max="-2" attributes="0"/>
91 <Component id="jTextField1" alignment="3" min="-2" max="-2" attributes="0"/>
92 </Group>
93 <EmptySpace max="-2" attributes="0"/>
94 <Group type="103" groupAlignment="3" attributes="0">
95 <Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/>
96 <Component id="jButton2" alignment="3" min="-2" max="-2" attributes="0"/>
97 </Group>
98 <EmptySpace min="-2" max="-2" attributes="0"/>
99 </Group>
100 </Group>
101 </DimensionLayout>
102 </Layout>
103 <SubComponents>
104 <Component class="javax.swing.JLabel" name="jLabel1">
105 <Properties>
106 <Property name="font" type="java.awt.Font" resourceKey="jLabel1.font"/>
107 <Property name="text" type="java.lang.String" resourceKey="jLabel1.text"/>
108 <Property name="name" type="java.lang.String" value="jLabel1" noResource="true"/>
109 </Properties>
110 </Component>
111 <Component class="javax.swing.JLabel" name="jLabel2">
112 <Properties>
113 <Property name="text" type="java.lang.String" resourceKey="jLabel2.text"/>
114 <Property name="name" type="java.lang.String" value="jLabel2" noResource="true"/>
115 </Properties>
116 </Component>
117 <Component class="javax.swing.JLabel" name="jLabel3">
118 <Properties>
119 <Property name="text" type="java.lang.String" resourceKey="jLabel3.text"/>
120 <Property name="name" type="java.lang.String" value="jLabel3" noResource="true"/>
121 </Properties>
122 </Component>
123 <Component class="javax.swing.JComboBox" name="jComboBox1">
124 <Properties>
125 <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor">
126 <StringArray count="0"/>
127 </Property>
128 <Property name="name" type="java.lang.String" value="jComboBox1" noResource="true"/>
129 </Properties>
130 </Component>
131 <Component class="javax.swing.JCheckBox" name="jCheckBox1">
132 <Properties>
133 <Property name="text" type="java.lang.String" resourceKey="jCheckBox1.text"/>
134 <Property name="name" type="java.lang.String" value="jCheckBox1" noResource="true"/>
135 </Properties>
136 </Component>
137 <Component class="javax.swing.JLabel" name="jLabel4">
138 <Properties>
139 <Property name="text" type="java.lang.String" resourceKey="jLabel4.text"/>
140 <Property name="name" type="java.lang.String" value="jLabel4" noResource="true"/>
141 </Properties>
142 </Component>
143 <Component class="javax.swing.JLabel" name="jLabel5">
144 <Properties>
145 <Property name="text" type="java.lang.String" resourceKey="jLabel5.text"/>
146 <Property name="name" type="java.lang.String" value="jLabel5" noResource="true"/>
147 </Properties>
148 </Component>
149 <Component class="javax.swing.JLabel" name="jLabel6">
150 <Properties>
151 <Property name="text" type="java.lang.String" resourceKey="jLabel6.text"/>
152 <Property name="name" type="java.lang.String" value="jLabel6" noResource="true"/>
153 </Properties>
154 </Component>
155 <Component class="javax.swing.JTextField" name="jTextField1">
156 <Properties>
157 <Property name="text" type="java.lang.String" resourceKey="jTextField1.text"/>
158 <Property name="name" type="java.lang.String" value="jTextField1" noResource="true"/>
159 </Properties>
160 </Component>
161 <Component class="javax.swing.JButton" name="jButton1">
162 <Properties>
163 <Property name="text" type="java.lang.String" resourceKey="jButton1.text"/>
164 <Property name="name" type="java.lang.String" value="jButton1" noResource="true"/>
165 </Properties>
166 <Events>
167 <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
168 </Events>
169 </Component>
170 <Component class="javax.swing.JButton" name="jButton2">
171 <Properties>
172 <Property name="text" type="java.lang.String" resourceKey="jButton2.text"/>
173 <Property name="name" type="java.lang.String" value="jButton2" noResource="true"/>
174 </Properties>
175 <Events>
176 <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton2ActionPerformed"/>
177 </Events>
178 </Component>
179 </SubComponents>
180</Form>
diff --git a/client/trunk/src/com/fourisland/instadisc/ActionFilterForm.java b/client/trunk/src/com/fourisland/instadisc/ActionFilterForm.java new file mode 100644 index 0000000..d1e8c04 --- /dev/null +++ b/client/trunk/src/com/fourisland/instadisc/ActionFilterForm.java
@@ -0,0 +1,234 @@
1/*
2 * ActionFilterForm.java
3 *
4 * Created on July 31, 2008, 5:28 PM
5 */
6package com.fourisland.instadisc;
7
8import com.fourisland.instadisc.Database.Filter;
9import com.fourisland.instadisc.Database.Wrapper;
10import com.fourisland.instadisc.Item.Categories.Category;
11import javax.swing.DefaultComboBoxModel;
12
13/**
14 *
15 * @author hatkirby
16 */
17public class ActionFilterForm extends javax.swing.JDialog {
18
19 /** Creates new form ActionFilterForm */
20 public ActionFilterForm(java.awt.Frame parent, boolean modal) {
21 super(parent, modal);
22 initComponents();
23
24 jComboBox1.setModel(cbm);
25 }
26
27 /** This method is called from within the constructor to
28 * initialize the form.
29 * WARNING: Do NOT modify this code. The content of this method is
30 * always regenerated by the Form Editor.
31 */
32 // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
33 private void initComponents() {
34
35 jLabel1 = new javax.swing.JLabel();
36 jLabel2 = new javax.swing.JLabel();
37 jLabel3 = new javax.swing.JLabel();
38 jComboBox1 = new javax.swing.JComboBox();
39 jCheckBox1 = new javax.swing.JCheckBox();
40 jLabel4 = new javax.swing.JLabel();
41 jLabel5 = new javax.swing.JLabel();
42 jLabel6 = new javax.swing.JLabel();
43 jTextField1 = new javax.swing.JTextField();
44 jButton1 = new javax.swing.JButton();
45 jButton2 = new javax.swing.JButton();
46
47 setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
48 setName("Form"); // NOI18N
49
50 org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(com.fourisland.instadisc.InstaDiscApp.class).getContext().getResourceMap(ActionFilterForm.class);
51 jLabel1.setFont(resourceMap.getFont("jLabel1.font")); // NOI18N
52 jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
53 jLabel1.setName("jLabel1"); // NOI18N
54
55 jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
56 jLabel2.setName("jLabel2"); // NOI18N
57
58 jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
59 jLabel3.setName("jLabel3"); // NOI18N
60
61 jComboBox1.setName("jComboBox1"); // NOI18N
62
63 jCheckBox1.setText(resourceMap.getString("jCheckBox1.text")); // NOI18N
64 jCheckBox1.setName("jCheckBox1"); // NOI18N
65
66 jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
67 jLabel4.setName("jLabel4"); // NOI18N
68
69 jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
70 jLabel5.setName("jLabel5"); // NOI18N
71
72 jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N
73 jLabel6.setName("jLabel6"); // NOI18N
74
75 jTextField1.setText(resourceMap.getString("jTextField1.text")); // NOI18N
76 jTextField1.setName("jTextField1"); // NOI18N
77
78 jButton1.setText(resourceMap.getString("jButton1.text")); // NOI18N
79 jButton1.setName("jButton1"); // NOI18N
80 jButton1.addActionListener(new java.awt.event.ActionListener() {
81 public void actionPerformed(java.awt.event.ActionEvent evt) {
82 jButton1ActionPerformed(evt);
83 }
84 });
85
86 jButton2.setText(resourceMap.getString("jButton2.text")); // NOI18N
87 jButton2.setName("jButton2"); // NOI18N
88 jButton2.addActionListener(new java.awt.event.ActionListener() {
89 public void actionPerformed(java.awt.event.ActionEvent evt) {
90 jButton2ActionPerformed(evt);
91 }
92 });
93
94 javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
95 getContentPane().setLayout(layout);
96 layout.setHorizontalGroup(
97 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
98 .addGroup(layout.createSequentialGroup()
99 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
100 .addGroup(layout.createSequentialGroup()
101 .addContainerGap()
102 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
103 .addComponent(jLabel1)
104 .addGroup(layout.createSequentialGroup()
105 .addGap(12, 12, 12)
106 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
107 .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 391, javax.swing.GroupLayout.PREFERRED_SIZE)
108 .addGroup(layout.createSequentialGroup()
109 .addComponent(jLabel3)
110 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
111 .addComponent(jComboBox1, 0, 346, Short.MAX_VALUE))
112 .addGroup(layout.createSequentialGroup()
113 .addComponent(jLabel4)
114 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
115 .addComponent(jCheckBox1))
116 .addGroup(layout.createSequentialGroup()
117 .addComponent(jLabel6)
118 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
119 .addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 308, Short.MAX_VALUE))))))
120 .addGroup(layout.createSequentialGroup()
121 .addGap(36, 36, 36)
122 .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, 379, Short.MAX_VALUE))
123 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
124 .addContainerGap(324, Short.MAX_VALUE)
125 .addComponent(jButton2)
126 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
127 .addComponent(jButton1)))
128 .addContainerGap())
129 );
130 layout.setVerticalGroup(
131 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
132 .addGroup(layout.createSequentialGroup()
133 .addContainerGap()
134 .addComponent(jLabel1)
135 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
136 .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 34, Short.MAX_VALUE)
137 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
138 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
139 .addComponent(jLabel3)
140 .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
141 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
142 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
143 .addComponent(jLabel4)
144 .addComponent(jCheckBox1))
145 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
146 .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)
147 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
148 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
149 .addComponent(jLabel6)
150 .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
151 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
152 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
153 .addComponent(jButton1)
154 .addComponent(jButton2))
155 .addContainerGap())
156 );
157
158 pack();
159 }// </editor-fold>//GEN-END:initComponents
160
161 private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
162 f.setField((String) jComboBox1.getSelectedItem());
163 f.setEqual(jCheckBox1.isSelected());
164 f.setTest(jTextField1.getText());
165
166 Wrapper.addFilter(f);
167
168 setVisible(false);
169 }//GEN-LAST:event_jButton2ActionPerformed
170
171 private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
172 setVisible(false);
173 }//GEN-LAST:event_jButton1ActionPerformed
174 /**
175 * @param args the command line arguments
176 */
177 public static void main(String args[]) {
178 java.awt.EventQueue.invokeLater(new Runnable() {
179
180 public void run() {
181 ActionFilterForm dialog = new ActionFilterForm(new javax.swing.JFrame(), true);
182 dialog.addWindowListener(new java.awt.event.WindowAdapter() {
183
184 public void windowClosing(java.awt.event.WindowEvent e) {
185 System.exit(0);
186 }
187 });
188 dialog.setVisible(true);
189 }
190 });
191 }
192 // Variables declaration - do not modify//GEN-BEGIN:variables
193 private javax.swing.JButton jButton1;
194 private javax.swing.JButton jButton2;
195 private javax.swing.JCheckBox jCheckBox1;
196 private javax.swing.JComboBox jComboBox1;
197 private javax.swing.JLabel jLabel1;
198 private javax.swing.JLabel jLabel2;
199 private javax.swing.JLabel jLabel3;
200 private javax.swing.JLabel jLabel4;
201 private javax.swing.JLabel jLabel5;
202 private javax.swing.JLabel jLabel6;
203 private javax.swing.JTextField jTextField1;
204 // End of variables declaration//GEN-END:variables
205 DefaultComboBoxModel cbm = new DefaultComboBoxModel();
206 Filter f;
207
208 public void setFilter(Filter filter) {
209 String[] semantics = Category.getRequiredSemantics(Wrapper.getSubscription(filter.getSubscription()).getCategory());
210 int i = 0;
211
212 cbm.addElement("Author");
213 for (i = 0; i < semantics.length; i++) {
214 cbm.addElement(semantics[i]);
215 }
216
217 if (filter.getID() == -65536) {
218 jLabel1.setText("Add Filter");
219 } else {
220 jComboBox1.setSelectedIndex(0);
221 for (i = 0; i < semantics.length; i++) {
222 if (semantics[i].equals(filter.getField())) {
223 jComboBox1.setSelectedIndex(i+1);
224 break;
225 }
226 }
227
228 jCheckBox1.setSelected(filter.getEqual());
229 jTextField1.setText(filter.getTest());
230 }
231
232 f = filter;
233 }
234}
diff --git a/client/trunk/src/com/fourisland/instadisc/AddSubscriptionForm.form b/client/trunk/src/com/fourisland/instadisc/AddSubscriptionForm.form index c381e8d..4a74d18 100644 --- a/client/trunk/src/com/fourisland/instadisc/AddSubscriptionForm.form +++ b/client/trunk/src/com/fourisland/instadisc/AddSubscriptionForm.form
@@ -36,7 +36,7 @@
36 </Group> 36 </Group>
37 <Group type="102" alignment="0" attributes="0"> 37 <Group type="102" alignment="0" attributes="0">
38 <EmptySpace min="12" pref="12" max="12" attributes="0"/> 38 <EmptySpace min="12" pref="12" max="12" attributes="0"/>
39 <Group type="103" groupAlignment="1" max="-2" attributes="0"> 39 <Group type="103" groupAlignment="0" attributes="0">
40 <Component id="jLabel2" alignment="0" min="0" pref="0" max="32767" attributes="1"/> 40 <Component id="jLabel2" alignment="0" min="0" pref="0" max="32767" attributes="1"/>
41 <Group type="102" alignment="0" attributes="0"> 41 <Group type="102" alignment="0" attributes="0">
42 <Component id="jLabel3" min="-2" max="-2" attributes="0"/> 42 <Component id="jLabel3" min="-2" max="-2" attributes="0"/>
@@ -57,8 +57,8 @@
57 <EmptySpace max="-2" attributes="0"/> 57 <EmptySpace max="-2" attributes="0"/>
58 <Component id="jLabel1" min="-2" max="-2" attributes="0"/> 58 <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
59 <EmptySpace max="-2" attributes="0"/> 59 <EmptySpace max="-2" attributes="0"/>
60 <Component id="jLabel2" min="-2" max="-2" attributes="0"/> 60 <Component id="jLabel2" min="-2" pref="91" max="-2" attributes="0"/>
61 <EmptySpace type="separate" max="-2" attributes="0"/> 61 <EmptySpace type="unrelated" max="-2" attributes="0"/>
62 <Group type="103" groupAlignment="3" attributes="0"> 62 <Group type="103" groupAlignment="3" attributes="0">
63 <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/> 63 <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
64 <Component id="jTextField1" alignment="3" min="-2" max="-2" attributes="0"/> 64 <Component id="jTextField1" alignment="3" min="-2" max="-2" attributes="0"/>
diff --git a/client/trunk/src/com/fourisland/instadisc/AddSubscriptionForm.java b/client/trunk/src/com/fourisland/instadisc/AddSubscriptionForm.java index 7b0fc08..c51bdbc 100644 --- a/client/trunk/src/com/fourisland/instadisc/AddSubscriptionForm.java +++ b/client/trunk/src/com/fourisland/instadisc/AddSubscriptionForm.java
@@ -91,9 +91,9 @@ public class AddSubscriptionForm extends javax.swing.JDialog {
91 .addComponent(jButton1)) 91 .addComponent(jButton1))
92 .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() 92 .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
93 .addGap(12, 12, 12) 93 .addGap(12, 12, 12)
94 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) 94 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
95 .addComponent(jLabel2, javax.swing.GroupLayout.Alignment.LEADING, 0, 0, Short.MAX_VALUE) 95 .addComponent(jLabel2, 0, 0, Short.MAX_VALUE)
96 .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup() 96 .addGroup(layout.createSequentialGroup()
97 .addComponent(jLabel3) 97 .addComponent(jLabel3)
98 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 98 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
99 .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 214, javax.swing.GroupLayout.PREFERRED_SIZE)))))) 99 .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 214, javax.swing.GroupLayout.PREFERRED_SIZE))))))
@@ -105,8 +105,8 @@ public class AddSubscriptionForm extends javax.swing.JDialog {
105 .addContainerGap() 105 .addContainerGap()
106 .addComponent(jLabel1) 106 .addComponent(jLabel1)
107 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 107 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
108 .addComponent(jLabel2) 108 .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE)
109 .addGap(18, 18, 18) 109 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
110 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 110 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
111 .addComponent(jLabel3) 111 .addComponent(jLabel3)
112 .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) 112 .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
diff --git a/client/trunk/src/com/fourisland/instadisc/AdvancedSettingsForm.form b/client/trunk/src/com/fourisland/instadisc/AdvancedSettingsForm.form index f8e9990..6fb22bd 100644 --- a/client/trunk/src/com/fourisland/instadisc/AdvancedSettingsForm.form +++ b/client/trunk/src/com/fourisland/instadisc/AdvancedSettingsForm.form
@@ -22,8 +22,12 @@
22 <Layout> 22 <Layout>
23 <DimensionLayout dim="0"> 23 <DimensionLayout dim="0">
24 <Group type="103" groupAlignment="0" attributes="0"> 24 <Group type="103" groupAlignment="0" attributes="0">
25 <Group type="102" attributes="0"> 25 <Group type="102" alignment="1" attributes="0">
26 <Group type="103" groupAlignment="0" attributes="0"> 26 <Group type="103" groupAlignment="1" attributes="0">
27 <Group type="102" alignment="0" attributes="0">
28 <EmptySpace min="-2" pref="36" max="-2" attributes="0"/>
29 <Component id="jLabel6" pref="351" max="32767" attributes="0"/>
30 </Group>
27 <Group type="102" alignment="0" attributes="0"> 31 <Group type="102" alignment="0" attributes="0">
28 <EmptySpace max="-2" attributes="0"/> 32 <EmptySpace max="-2" attributes="0"/>
29 <Group type="103" groupAlignment="0" attributes="0"> 33 <Group type="103" groupAlignment="0" attributes="0">
@@ -41,23 +45,19 @@
41 <EmptySpace max="-2" attributes="0"/> 45 <EmptySpace max="-2" attributes="0"/>
42 <Component id="jSpinner2" pref="239" max="32767" attributes="0"/> 46 <Component id="jSpinner2" pref="239" max="32767" attributes="0"/>
43 </Group> 47 </Group>
44 <Group type="102" attributes="0">
45 <EmptySpace min="12" pref="12" max="12" attributes="0"/>
46 <Component id="jLabel4" min="-2" pref="351" max="-2" attributes="0"/>
47 </Group>
48 <Component id="jLabel2" alignment="0" min="-2" pref="347" max="-2" attributes="0"/> 48 <Component id="jLabel2" alignment="0" min="-2" pref="347" max="-2" attributes="0"/>
49 </Group> 49 </Group>
50 </Group> 50 </Group>
51 </Group> 51 </Group>
52 </Group> 52 </Group>
53 <Group type="102" alignment="0" attributes="0">
54 <EmptySpace min="-2" pref="36" max="-2" attributes="0"/>
55 <Component id="jLabel6" pref="351" max="32767" attributes="0"/>
56 </Group>
57 <Group type="102" alignment="1" attributes="0"> 53 <Group type="102" alignment="1" attributes="0">
58 <EmptySpace pref="341" max="32767" attributes="0"/> 54 <EmptySpace pref="341" max="32767" attributes="0"/>
59 <Component id="jButton1" min="-2" max="-2" attributes="0"/> 55 <Component id="jButton1" min="-2" max="-2" attributes="0"/>
60 </Group> 56 </Group>
57 <Group type="102" alignment="0" attributes="0">
58 <EmptySpace min="-2" pref="36" max="-2" attributes="0"/>
59 <Component id="jLabel4" min="-2" pref="351" max="-2" attributes="0"/>
60 </Group>
61 </Group> 61 </Group>
62 <EmptySpace max="-2" attributes="0"/> 62 <EmptySpace max="-2" attributes="0"/>
63 </Group> 63 </Group>
@@ -66,27 +66,27 @@
66 <DimensionLayout dim="1"> 66 <DimensionLayout dim="1">
67 <Group type="103" groupAlignment="0" attributes="0"> 67 <Group type="103" groupAlignment="0" attributes="0">
68 <Group type="102" alignment="0" attributes="0"> 68 <Group type="102" alignment="0" attributes="0">
69 <EmptySpace max="-2" attributes="0"/> 69 <EmptySpace min="-2" max="-2" attributes="0"/>
70 <Component id="jLabel1" min="-2" max="-2" attributes="0"/> 70 <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
71 <EmptySpace max="-2" attributes="0"/> 71 <EmptySpace min="-2" max="-2" attributes="0"/>
72 <Component id="jLabel2" min="-2" max="-2" attributes="0"/> 72 <Component id="jLabel2" min="-2" pref="40" max="-2" attributes="0"/>
73 <EmptySpace type="unrelated" max="-2" attributes="0"/> 73 <EmptySpace min="-2" max="-2" attributes="0"/>
74 <Group type="103" groupAlignment="3" attributes="0"> 74 <Group type="103" groupAlignment="3" attributes="0">
75 <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/> 75 <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
76 <Component id="jSpinner1" alignment="3" min="-2" max="-2" attributes="0"/> 76 <Component id="jSpinner1" alignment="3" min="-2" max="-2" attributes="0"/>
77 </Group> 77 </Group>
78 <EmptySpace max="-2" attributes="0"/> 78 <EmptySpace min="-2" max="-2" attributes="0"/>
79 <Component id="jLabel4" min="-2" max="-2" attributes="0"/> 79 <Component id="jLabel4" pref="68" max="32767" attributes="0"/>
80 <EmptySpace max="-2" attributes="0"/> 80 <EmptySpace min="-2" max="-2" attributes="0"/>
81 <Group type="103" groupAlignment="3" attributes="0"> 81 <Group type="103" groupAlignment="3" attributes="0">
82 <Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/> 82 <Component id="jLabel5" alignment="3" min="-2" max="-2" attributes="0"/>
83 <Component id="jSpinner2" alignment="3" min="-2" max="-2" attributes="0"/> 83 <Component id="jSpinner2" alignment="3" min="-2" max="-2" attributes="0"/>
84 </Group> 84 </Group>
85 <EmptySpace max="-2" attributes="0"/> 85 <EmptySpace max="-2" attributes="0"/>
86 <Component id="jLabel6" min="-2" max="-2" attributes="0"/> 86 <Component id="jLabel6" min="-2" pref="51" max="-2" attributes="0"/>
87 <EmptySpace max="32767" attributes="0"/>
88 <Component id="jButton1" min="-2" max="-2" attributes="0"/>
89 <EmptySpace max="-2" attributes="0"/> 87 <EmptySpace max="-2" attributes="0"/>
88 <Component id="jButton1" min="-2" max="-2" attributes="0"/>
89 <EmptySpace min="-2" max="-2" attributes="0"/>
90 </Group> 90 </Group>
91 </Group> 91 </Group>
92 </DimensionLayout> 92 </DimensionLayout>
diff --git a/client/trunk/src/com/fourisland/instadisc/AdvancedSettingsForm.java b/client/trunk/src/com/fourisland/instadisc/AdvancedSettingsForm.java index 2a07123..753bbe3 100644 --- a/client/trunk/src/com/fourisland/instadisc/AdvancedSettingsForm.java +++ b/client/trunk/src/com/fourisland/instadisc/AdvancedSettingsForm.java
@@ -92,9 +92,12 @@ public class AdvancedSettingsForm extends javax.swing.JDialog {
92 getContentPane().setLayout(layout); 92 getContentPane().setLayout(layout);
93 layout.setHorizontalGroup( 93 layout.setHorizontalGroup(
94 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 94 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
95 .addGroup(layout.createSequentialGroup() 95 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
96 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 96 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
97 .addGroup(layout.createSequentialGroup() 97 .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
98 .addGap(36, 36, 36)
99 .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, 351, Short.MAX_VALUE))
100 .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
98 .addContainerGap() 101 .addContainerGap()
99 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 102 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
100 .addComponent(jLabel1) 103 .addComponent(jLabel1)
@@ -109,16 +112,13 @@ public class AdvancedSettingsForm extends javax.swing.JDialog {
109 .addComponent(jLabel5) 112 .addComponent(jLabel5)
110 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 113 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
111 .addComponent(jSpinner2, javax.swing.GroupLayout.DEFAULT_SIZE, 239, Short.MAX_VALUE)) 114 .addComponent(jSpinner2, javax.swing.GroupLayout.DEFAULT_SIZE, 239, Short.MAX_VALUE))
112 .addGroup(layout.createSequentialGroup()
113 .addGap(12, 12, 12)
114 .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 351, javax.swing.GroupLayout.PREFERRED_SIZE))
115 .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 347, javax.swing.GroupLayout.PREFERRED_SIZE))))) 115 .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 347, javax.swing.GroupLayout.PREFERRED_SIZE)))))
116 .addGroup(layout.createSequentialGroup() 116 .addGroup(layout.createSequentialGroup()
117 .addGap(36, 36, 36)
118 .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, 351, Short.MAX_VALUE))
119 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
120 .addContainerGap(341, Short.MAX_VALUE) 117 .addContainerGap(341, Short.MAX_VALUE)
121 .addComponent(jButton1))) 118 .addComponent(jButton1))
119 .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
120 .addGap(36, 36, 36)
121 .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 351, javax.swing.GroupLayout.PREFERRED_SIZE)))
122 .addContainerGap()) 122 .addContainerGap())
123 ); 123 );
124 layout.setVerticalGroup( 124 layout.setVerticalGroup(
@@ -127,20 +127,20 @@ public class AdvancedSettingsForm extends javax.swing.JDialog {
127 .addContainerGap() 127 .addContainerGap()
128 .addComponent(jLabel1) 128 .addComponent(jLabel1)
129 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 129 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
130 .addComponent(jLabel2) 130 .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
131 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) 131 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
132 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 132 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
133 .addComponent(jLabel3) 133 .addComponent(jLabel3)
134 .addComponent(jSpinner1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) 134 .addComponent(jSpinner1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
135 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 135 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
136 .addComponent(jLabel4) 136 .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, 68, Short.MAX_VALUE)
137 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 137 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
138 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 138 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
139 .addComponent(jLabel5) 139 .addComponent(jLabel5)
140 .addComponent(jSpinner2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) 140 .addComponent(jSpinner2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
141 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 141 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
142 .addComponent(jLabel6) 142 .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 51, javax.swing.GroupLayout.PREFERRED_SIZE)
143 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 143 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
144 .addComponent(jButton1) 144 .addComponent(jButton1)
145 .addContainerGap()) 145 .addContainerGap())
146 ); 146 );
diff --git a/client/trunk/src/com/fourisland/instadisc/Database/Filter.java b/client/trunk/src/com/fourisland/instadisc/Database/Filter.java new file mode 100644 index 0000000..39bcd74 --- /dev/null +++ b/client/trunk/src/com/fourisland/instadisc/Database/Filter.java
@@ -0,0 +1,63 @@
1/*
2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
4 */
5package com.fourisland.instadisc.Database;
6
7import com.sleepycat.persist.model.Entity;
8import com.sleepycat.persist.model.PrimaryKey;
9
10/**
11 *
12 * @author hatkirby
13 */
14@Entity
15public class Filter {
16
17 @PrimaryKey
18 private Integer id;
19 private String subscription;
20 private String field;
21 private Boolean equal;
22 private String test;
23
24 public Integer getID() {
25 return id;
26 }
27
28 public String getSubscription() {
29 return subscription;
30 }
31
32 public String getField() {
33 return field;
34 }
35
36 public Boolean getEqual() {
37 return equal;
38 }
39
40 public String getTest() {
41 return test;
42 }
43
44 public void setID(Integer id) {
45 this.id = id;
46 }
47
48 public void setSubscription(String subscription) {
49 this.subscription = subscription;
50 }
51
52 public void setField(String field) {
53 this.field = field;
54 }
55
56 public void setEqual(Boolean equal) {
57 this.equal = equal;
58 }
59
60 public void setTest(String test) {
61 this.test = test;
62 }
63}
diff --git a/client/trunk/src/com/fourisland/instadisc/Database/Wrapper.java b/client/trunk/src/com/fourisland/instadisc/Database/Wrapper.java index 3aed859..92c84cc 100644 --- a/client/trunk/src/com/fourisland/instadisc/Database/Wrapper.java +++ b/client/trunk/src/com/fourisland/instadisc/Database/Wrapper.java
@@ -28,6 +28,7 @@ public class Wrapper {
28 public static PrimaryIndex<String, IDConfig> idConfig; 28 public static PrimaryIndex<String, IDConfig> idConfig;
29 public static PrimaryIndex<Integer, Item> item; 29 public static PrimaryIndex<Integer, Item> item;
30 public static PrimaryIndex<String, Subscription> subscription; 30 public static PrimaryIndex<String, Subscription> subscription;
31 public static PrimaryIndex<Integer, Filter> filter;
31 32
32 public static void init(String loc) { 33 public static void init(String loc) {
33 34
@@ -50,6 +51,7 @@ public class Wrapper {
50 idConfig = es.getPrimaryIndex(String.class, IDConfig.class); 51 idConfig = es.getPrimaryIndex(String.class, IDConfig.class);
51 item = es.getPrimaryIndex(Integer.class, Item.class); 52 item = es.getPrimaryIndex(Integer.class, Item.class);
52 subscription = es.getPrimaryIndex(String.class, Subscription.class); 53 subscription = es.getPrimaryIndex(String.class, Subscription.class);
54 filter = es.getPrimaryIndex(Integer.class, Filter.class);
53 } catch (DatabaseException ex) { 55 } catch (DatabaseException ex) {
54 Logger.getLogger(Wrapper.class.getName()).log(Level.SEVERE, null, ex); 56 Logger.getLogger(Wrapper.class.getName()).log(Level.SEVERE, null, ex);
55 } 57 }
@@ -223,7 +225,7 @@ public class Wrapper {
223 } 225 }
224 } 226 }
225 } 227 }
226 228
227 public static Subscription[] getAllSubscription() { 229 public static Subscription[] getAllSubscription() {
228 synchronized (subscription) { 230 synchronized (subscription) {
229 try { 231 try {
@@ -248,11 +250,9 @@ public class Wrapper {
248 } 250 }
249 } 251 }
250 } 252 }
251 253
252 public static void deleteSubscription(String url) 254 public static void deleteSubscription(String url) {
253 { 255 synchronized (subscription) {
254 synchronized (subscription)
255 {
256 try { 256 try {
257 subscription.delete(url); 257 subscription.delete(url);
258 } catch (DatabaseException ex) { 258 } catch (DatabaseException ex) {
@@ -260,4 +260,65 @@ public class Wrapper {
260 } 260 }
261 } 261 }
262 } 262 }
263
264 public static void addFilter(Filter f) {
265 if (f.getID() == -65536) {
266 f.setID(Integer.decode(Wrapper.getConfig("nextFilterID")));
267 Wrapper.setConfig("nextFilterID", Integer.toString(Integer.decode(Wrapper.getConfig("nextFilterID")) + 1));
268 }
269
270 synchronized (filter) {
271 try {
272 filter.put(f);
273 } catch (DatabaseException ex) {
274 Logger.getLogger(Wrapper.class.getName()).log(Level.SEVERE, null, ex);
275 }
276 }
277 }
278
279 public static Filter getFilter(Integer id) {
280 synchronized (filter) {
281 try {
282 return filter.get(id);
283 } catch (DatabaseException ex) {
284 Logger.getLogger(Wrapper.class.getName()).log(Level.SEVERE, null, ex);
285 return null;
286 }
287 }
288 }
289
290 public static void deleteFilter(Integer id) {
291 synchronized (filter) {
292 try {
293 filter.delete(id);
294 } catch (DatabaseException ex) {
295 Logger.getLogger(Wrapper.class.getName()).log(Level.SEVERE, null, ex);
296 }
297 }
298 }
299
300 public static Filter[] getAllFilter() {
301 synchronized (filter) {
302 try {
303 Iterator<Filter> i = filter.entities().iterator();
304 Filter[] temp = new Filter[0];
305 int len = 0;
306
307 while (i.hasNext()) {
308 Filter[] temp2 = new Filter[len + 1];
309 int j = 0;
310 for (j = 0; j < len; j++) {
311 temp2[j] = temp[j];
312 }
313 temp2[len] = i.next();
314 temp = temp2;
315 }
316
317 return temp;
318 } catch (DatabaseException ex) {
319 Logger.getLogger(Wrapper.class.getName()).log(Level.SEVERE, null, ex);
320 return new Filter[0];
321 }
322 }
323 }
263} 324}
diff --git a/client/trunk/src/com/fourisland/instadisc/FirstRun/Step1.form b/client/trunk/src/com/fourisland/instadisc/FirstRun/Step1.form index b392e54..b33a49c 100644 --- a/client/trunk/src/com/fourisland/instadisc/FirstRun/Step1.form +++ b/client/trunk/src/com/fourisland/instadisc/FirstRun/Step1.form
@@ -22,17 +22,19 @@
22 <Layout> 22 <Layout>
23 <DimensionLayout dim="0"> 23 <DimensionLayout dim="0">
24 <Group type="103" groupAlignment="0" attributes="0"> 24 <Group type="103" groupAlignment="0" attributes="0">
25 <Group type="102" attributes="0"> 25 <Group type="102" alignment="1" attributes="0">
26 <EmptySpace pref="448" max="32767" attributes="0"/>
27 <Component id="jButton1" min="-2" max="-2" attributes="0"/>
28 <EmptySpace max="-2" attributes="0"/>
29 </Group>
30 <Group type="102" alignment="0" attributes="0">
26 <EmptySpace min="-2" max="-2" attributes="0"/> 31 <EmptySpace min="-2" max="-2" attributes="0"/>
27 <Group type="103" groupAlignment="0" attributes="0"> 32 <Group type="103" groupAlignment="0" attributes="0">
28 <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
29 <Group type="102" alignment="0" attributes="0"> 33 <Group type="102" alignment="0" attributes="0">
30 <EmptySpace min="-2" pref="12" max="-2" attributes="0"/> 34 <EmptySpace min="12" pref="12" max="12" attributes="0"/>
31 <Group type="103" groupAlignment="1" attributes="0"> 35 <Component id="jLabel3" min="-2" pref="466" max="-2" attributes="0"/>
32 <Component id="jButton1" alignment="1" min="-2" max="-2" attributes="0"/>
33 <Component id="jLabel3" alignment="1" min="-2" pref="466" max="-2" attributes="0"/>
34 </Group>
35 </Group> 36 </Group>
37 <Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/>
36 </Group> 38 </Group>
37 <EmptySpace max="32767" attributes="0"/> 39 <EmptySpace max="32767" attributes="0"/>
38 </Group> 40 </Group>
@@ -44,10 +46,10 @@
44 <EmptySpace min="-2" max="-2" attributes="0"/> 46 <EmptySpace min="-2" max="-2" attributes="0"/>
45 <Component id="jLabel1" min="-2" max="-2" attributes="0"/> 47 <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
46 <EmptySpace max="-2" attributes="0"/> 48 <EmptySpace max="-2" attributes="0"/>
47 <Component id="jLabel3" min="-2" max="-2" attributes="0"/> 49 <Component id="jLabel3" pref="119" max="32767" attributes="0"/>
48 <EmptySpace max="-2" attributes="0"/> 50 <EmptySpace max="-2" attributes="0"/>
49 <Component id="jButton1" min="-2" max="-2" attributes="0"/> 51 <Component id="jButton1" min="-2" max="-2" attributes="0"/>
50 <EmptySpace max="32767" attributes="0"/> 52 <EmptySpace min="-2" max="-2" attributes="0"/>
51 </Group> 53 </Group>
52 </Group> 54 </Group>
53 </DimensionLayout> 55 </DimensionLayout>
diff --git a/client/trunk/src/com/fourisland/instadisc/FirstRun/Step1.java b/client/trunk/src/com/fourisland/instadisc/FirstRun/Step1.java index 4a29d15..e96b275 100644 --- a/client/trunk/src/com/fourisland/instadisc/FirstRun/Step1.java +++ b/client/trunk/src/com/fourisland/instadisc/FirstRun/Step1.java
@@ -53,15 +53,17 @@ public class Step1 extends javax.swing.JDialog {
53 getContentPane().setLayout(layout); 53 getContentPane().setLayout(layout);
54 layout.setHorizontalGroup( 54 layout.setHorizontalGroup(
55 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 55 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
56 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
57 .addContainerGap(448, Short.MAX_VALUE)
58 .addComponent(jButton1)
59 .addContainerGap())
56 .addGroup(layout.createSequentialGroup() 60 .addGroup(layout.createSequentialGroup()
57 .addContainerGap() 61 .addContainerGap()
58 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 62 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
59 .addComponent(jLabel1)
60 .addGroup(layout.createSequentialGroup() 63 .addGroup(layout.createSequentialGroup()
61 .addGap(12, 12, 12) 64 .addGap(12, 12, 12)
62 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING) 65 .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 466, javax.swing.GroupLayout.PREFERRED_SIZE))
63 .addComponent(jButton1) 66 .addComponent(jLabel1))
64 .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 466, javax.swing.GroupLayout.PREFERRED_SIZE))))
65 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 67 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
66 ); 68 );
67 layout.setVerticalGroup( 69 layout.setVerticalGroup(
@@ -70,10 +72,10 @@ public class Step1 extends javax.swing.JDialog {
70 .addContainerGap() 72 .addContainerGap()
71 .addComponent(jLabel1) 73 .addComponent(jLabel1)
72 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 74 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
73 .addComponent(jLabel3) 75 .addComponent(jLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, 119, Short.MAX_VALUE)
74 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 76 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
75 .addComponent(jButton1) 77 .addComponent(jButton1)
76 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 78 .addContainerGap())
77 ); 79 );
78 80
79 pack(); 81 pack();
diff --git a/client/trunk/src/com/fourisland/instadisc/FirstRun/Step2.form b/client/trunk/src/com/fourisland/instadisc/FirstRun/Step2.form index ba0b98c..666f518 100644 --- a/client/trunk/src/com/fourisland/instadisc/FirstRun/Step2.form +++ b/client/trunk/src/com/fourisland/instadisc/FirstRun/Step2.form
@@ -23,30 +23,34 @@
23 <DimensionLayout dim="0"> 23 <DimensionLayout dim="0">
24 <Group type="103" groupAlignment="0" attributes="0"> 24 <Group type="103" groupAlignment="0" attributes="0">
25 <Group type="102" attributes="0"> 25 <Group type="102" attributes="0">
26 <EmptySpace max="-2" attributes="0"/>
27 <Group type="103" groupAlignment="0" attributes="0"> 26 <Group type="103" groupAlignment="0" attributes="0">
28 <Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/> 27 <Group type="102" attributes="0">
29 <Group type="102" alignment="0" attributes="0">
30 <EmptySpace min="12" pref="12" max="12" attributes="0"/>
31 <Group type="103" groupAlignment="0" attributes="0">
32 <Component id="jLabel2" min="-2" max="-2" attributes="0"/>
33 <Component id="jLabel3" min="-2" max="-2" attributes="0"/>
34 <Component id="jLabel4" min="-2" max="-2" attributes="0"/>
35 </Group>
36 <EmptySpace max="-2" attributes="0"/> 28 <EmptySpace max="-2" attributes="0"/>
37 <Group type="103" groupAlignment="0" attributes="0"> 29 <Group type="103" groupAlignment="0" attributes="0">
38 <Component id="jTextField1" alignment="0" pref="222" max="32767" attributes="0"/> 30 <Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/>
39 <Component id="jTextField3" alignment="0" pref="222" max="32767" attributes="0"/> 31 <Group type="102" alignment="0" attributes="0">
40 <Component id="jPasswordField1" alignment="0" pref="222" max="32767" attributes="0"/> 32 <EmptySpace min="12" pref="12" max="12" attributes="0"/>
33 <Group type="103" groupAlignment="0" attributes="0">
34 <Component id="jLabel2" min="-2" max="-2" attributes="0"/>
35 <Component id="jLabel3" min="-2" max="-2" attributes="0"/>
36 <Component id="jLabel4" min="-2" max="-2" attributes="0"/>
37 </Group>
38 <EmptySpace max="-2" attributes="0"/>
39 <Group type="103" groupAlignment="0" attributes="0">
40 <Component id="jTextField1" alignment="0" pref="222" max="32767" attributes="0"/>
41 <Component id="jTextField3" alignment="0" pref="222" max="32767" attributes="0"/>
42 <Component id="jPasswordField1" alignment="0" pref="222" max="32767" attributes="0"/>
43 </Group>
44 </Group>
45 <Group type="102" alignment="1" attributes="0">
46 <Component id="jLabel5" pref="317" max="32767" attributes="0"/>
47 <EmptySpace max="-2" attributes="0"/>
48 <Component id="jButton1" min="-2" max="-2" attributes="0"/>
49 </Group>
41 </Group> 50 </Group>
42 </Group> 51 </Group>
43 <Group type="102" alignment="1" attributes="0">
44 <Component id="jLabel5" pref="317" max="32767" attributes="0"/>
45 <EmptySpace max="-2" attributes="0"/>
46 <Component id="jButton1" min="-2" max="-2" attributes="0"/>
47 </Group>
48 <Group type="102" alignment="0" attributes="0"> 52 <Group type="102" alignment="0" attributes="0">
49 <EmptySpace min="-2" pref="12" max="-2" attributes="0"/> 53 <EmptySpace min="-2" pref="24" max="-2" attributes="0"/>
50 <Component id="jLabel6" min="-2" pref="359" max="-2" attributes="0"/> 54 <Component id="jLabel6" min="-2" pref="359" max="-2" attributes="0"/>
51 </Group> 55 </Group>
52 </Group> 56 </Group>
@@ -57,29 +61,29 @@
57 <DimensionLayout dim="1"> 61 <DimensionLayout dim="1">
58 <Group type="103" groupAlignment="0" attributes="0"> 62 <Group type="103" groupAlignment="0" attributes="0">
59 <Group type="102" alignment="0" attributes="0"> 63 <Group type="102" alignment="0" attributes="0">
60 <EmptySpace max="32767" attributes="0"/> 64 <EmptySpace min="-2" max="-2" attributes="0"/>
61 <Component id="jLabel1" min="-2" max="-2" attributes="0"/> 65 <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
62 <EmptySpace max="-2" attributes="0"/> 66 <EmptySpace max="-2" attributes="0"/>
63 <Component id="jLabel6" min="-2" max="-2" attributes="0"/> 67 <Component id="jLabel6" pref="51" max="32767" attributes="0"/>
64 <EmptySpace type="unrelated" max="-2" attributes="0"/> 68 <EmptySpace type="unrelated" max="-2" attributes="0"/>
65 <Group type="103" groupAlignment="3" attributes="0"> 69 <Group type="103" groupAlignment="3" attributes="0">
66 <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/> 70 <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/>
67 <Component id="jTextField1" alignment="3" min="-2" max="-2" attributes="0"/> 71 <Component id="jTextField1" alignment="3" min="-2" max="-2" attributes="0"/>
68 </Group> 72 </Group>
69 <EmptySpace max="-2" attributes="0"/> 73 <EmptySpace min="-2" max="-2" attributes="0"/>
70 <Group type="103" groupAlignment="3" attributes="0"> 74 <Group type="103" groupAlignment="3" attributes="0">
71 <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/> 75 <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/>
72 <Component id="jPasswordField1" alignment="3" min="-2" max="-2" attributes="0"/> 76 <Component id="jPasswordField1" alignment="3" min="-2" max="-2" attributes="0"/>
73 </Group> 77 </Group>
74 <EmptySpace max="-2" attributes="0"/> 78 <EmptySpace min="-2" max="-2" attributes="0"/>
75 <Group type="103" groupAlignment="3" attributes="0"> 79 <Group type="103" groupAlignment="3" attributes="0">
76 <Component id="jTextField3" alignment="3" min="-2" max="-2" attributes="0"/> 80 <Component id="jTextField3" alignment="3" min="-2" max="-2" attributes="0"/>
77 <Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/> 81 <Component id="jLabel4" alignment="3" min="-2" max="-2" attributes="0"/>
78 </Group> 82 </Group>
79 <EmptySpace max="-2" attributes="0"/> 83 <EmptySpace min="-2" max="-2" attributes="0"/>
80 <Group type="103" groupAlignment="0" attributes="0"> 84 <Group type="103" groupAlignment="0" attributes="0">
85 <Component id="jLabel5" min="-2" pref="40" max="-2" attributes="0"/>
81 <Component id="jButton1" min="-2" max="-2" attributes="0"/> 86 <Component id="jButton1" min="-2" max="-2" attributes="0"/>
82 <Component id="jLabel5" alignment="0" min="-2" pref="40" max="-2" attributes="0"/>
83 </Group> 87 </Group>
84 </Group> 88 </Group>
85 </Group> 89 </Group>
diff --git a/client/trunk/src/com/fourisland/instadisc/FirstRun/Step2.java b/client/trunk/src/com/fourisland/instadisc/FirstRun/Step2.java index 99aee3f..6831417 100644 --- a/client/trunk/src/com/fourisland/instadisc/FirstRun/Step2.java +++ b/client/trunk/src/com/fourisland/instadisc/FirstRun/Step2.java
@@ -87,36 +87,38 @@ public class Step2 extends javax.swing.JDialog {
87 layout.setHorizontalGroup( 87 layout.setHorizontalGroup(
88 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 88 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
89 .addGroup(layout.createSequentialGroup() 89 .addGroup(layout.createSequentialGroup()
90 .addContainerGap()
91 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 90 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
92 .addComponent(jLabel1)
93 .addGroup(layout.createSequentialGroup() 91 .addGroup(layout.createSequentialGroup()
94 .addGap(12, 12, 12) 92 .addContainerGap()
95 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
96 .addComponent(jLabel2)
97 .addComponent(jLabel3)
98 .addComponent(jLabel4))
99 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
100 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 93 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
101 .addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 222, Short.MAX_VALUE) 94 .addComponent(jLabel1)
102 .addComponent(jTextField3, javax.swing.GroupLayout.DEFAULT_SIZE, 222, Short.MAX_VALUE) 95 .addGroup(layout.createSequentialGroup()
103 .addComponent(jPasswordField1, javax.swing.GroupLayout.DEFAULT_SIZE, 222, Short.MAX_VALUE))) 96 .addGap(12, 12, 12)
104 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() 97 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
105 .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, 317, Short.MAX_VALUE) 98 .addComponent(jLabel2)
106 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 99 .addComponent(jLabel3)
107 .addComponent(jButton1)) 100 .addComponent(jLabel4))
101 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
102 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
103 .addComponent(jTextField1, javax.swing.GroupLayout.DEFAULT_SIZE, 222, Short.MAX_VALUE)
104 .addComponent(jTextField3, javax.swing.GroupLayout.DEFAULT_SIZE, 222, Short.MAX_VALUE)
105 .addComponent(jPasswordField1, javax.swing.GroupLayout.DEFAULT_SIZE, 222, Short.MAX_VALUE)))
106 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
107 .addComponent(jLabel5, javax.swing.GroupLayout.DEFAULT_SIZE, 317, Short.MAX_VALUE)
108 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
109 .addComponent(jButton1))))
108 .addGroup(layout.createSequentialGroup() 110 .addGroup(layout.createSequentialGroup()
109 .addGap(12, 12, 12) 111 .addGap(24, 24, 24)
110 .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 359, javax.swing.GroupLayout.PREFERRED_SIZE))) 112 .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 359, javax.swing.GroupLayout.PREFERRED_SIZE)))
111 .addContainerGap()) 113 .addContainerGap())
112 ); 114 );
113 layout.setVerticalGroup( 115 layout.setVerticalGroup(
114 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 116 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
115 .addGroup(layout.createSequentialGroup() 117 .addGroup(layout.createSequentialGroup()
116 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 118 .addContainerGap()
117 .addComponent(jLabel1) 119 .addComponent(jLabel1)
118 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 120 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
119 .addComponent(jLabel6) 121 .addComponent(jLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, 51, Short.MAX_VALUE)
120 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED) 122 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
121 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 123 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
122 .addComponent(jLabel2) 124 .addComponent(jLabel2)
@@ -131,8 +133,8 @@ public class Step2 extends javax.swing.JDialog {
131 .addComponent(jLabel4)) 133 .addComponent(jLabel4))
132 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 134 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
133 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 135 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
134 .addComponent(jButton1) 136 .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
135 .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))) 137 .addComponent(jButton1)))
136 ); 138 );
137 139
138 pack(); 140 pack();
@@ -169,6 +171,7 @@ public class Step2 extends javax.swing.JDialog {
169 Wrapper.setConfig("centralServerURL", jTextField3.getText()); 171 Wrapper.setConfig("centralServerURL", jTextField3.getText());
170 Wrapper.setConfig("itemBufferSize", "10"); 172 Wrapper.setConfig("itemBufferSize", "10");
171 Wrapper.setConfig("verIDBufferSize", "100"); 173 Wrapper.setConfig("verIDBufferSize", "100");
174 Wrapper.setConfig("nextFilterID", "0");
172 Wrapper.setConfig("initCheck", "done"); 175 Wrapper.setConfig("initCheck", "done");
173 176
174 StepEndResults.ok = true; 177 StepEndResults.ok = true;
diff --git a/client/trunk/src/com/fourisland/instadisc/FirstRun/Step3.form b/client/trunk/src/com/fourisland/instadisc/FirstRun/Step3.form index bd32a05..990c340 100644 --- a/client/trunk/src/com/fourisland/instadisc/FirstRun/Step3.form +++ b/client/trunk/src/com/fourisland/instadisc/FirstRun/Step3.form
@@ -25,7 +25,7 @@
25 <Group type="102" attributes="0"> 25 <Group type="102" attributes="0">
26 <Group type="103" groupAlignment="0" attributes="0"> 26 <Group type="103" groupAlignment="0" attributes="0">
27 <Group type="102" alignment="0" attributes="0"> 27 <Group type="102" alignment="0" attributes="0">
28 <EmptySpace min="-2" pref="165" max="-2" attributes="0"/> 28 <EmptySpace min="-2" pref="164" max="-2" attributes="0"/>
29 <Component id="jButton1" min="-2" max="-2" attributes="0"/> 29 <Component id="jButton1" min="-2" max="-2" attributes="0"/>
30 </Group> 30 </Group>
31 <Group type="102" alignment="0" attributes="0"> 31 <Group type="102" alignment="0" attributes="0">
@@ -46,13 +46,13 @@
46 <DimensionLayout dim="1"> 46 <DimensionLayout dim="1">
47 <Group type="103" groupAlignment="0" attributes="0"> 47 <Group type="103" groupAlignment="0" attributes="0">
48 <Group type="102" alignment="0" attributes="0"> 48 <Group type="102" alignment="0" attributes="0">
49 <EmptySpace max="-2" attributes="0"/> 49 <EmptySpace min="-2" max="-2" attributes="0"/>
50 <Component id="jLabel1" min="-2" max="-2" attributes="0"/> 50 <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
51 <EmptySpace max="-2" attributes="0"/> 51 <EmptySpace max="-2" attributes="0"/>
52 <Component id="jLabel2" min="-2" max="-2" attributes="0"/> 52 <Component id="jLabel2" pref="68" max="32767" attributes="0"/>
53 <EmptySpace max="-2" attributes="0"/> 53 <EmptySpace max="-2" attributes="0"/>
54 <Component id="jButton1" min="-2" max="-2" attributes="0"/> 54 <Component id="jButton1" min="-2" max="-2" attributes="0"/>
55 <EmptySpace max="32767" attributes="0"/> 55 <EmptySpace min="-2" max="-2" attributes="0"/>
56 </Group> 56 </Group>
57 </Group> 57 </Group>
58 </DimensionLayout> 58 </DimensionLayout>
diff --git a/client/trunk/src/com/fourisland/instadisc/FirstRun/Step3.java b/client/trunk/src/com/fourisland/instadisc/FirstRun/Step3.java index e37e4f3..269466d 100644 --- a/client/trunk/src/com/fourisland/instadisc/FirstRun/Step3.java +++ b/client/trunk/src/com/fourisland/instadisc/FirstRun/Step3.java
@@ -56,7 +56,7 @@ public class Step3 extends javax.swing.JDialog {
56 .addGroup(layout.createSequentialGroup() 56 .addGroup(layout.createSequentialGroup()
57 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 57 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
58 .addGroup(layout.createSequentialGroup() 58 .addGroup(layout.createSequentialGroup()
59 .addGap(165, 165, 165) 59 .addGap(164, 164, 164)
60 .addComponent(jButton1)) 60 .addComponent(jButton1))
61 .addGroup(layout.createSequentialGroup() 61 .addGroup(layout.createSequentialGroup()
62 .addContainerGap() 62 .addContainerGap()
@@ -73,10 +73,10 @@ public class Step3 extends javax.swing.JDialog {
73 .addContainerGap() 73 .addContainerGap()
74 .addComponent(jLabel1) 74 .addComponent(jLabel1)
75 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 75 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
76 .addComponent(jLabel2) 76 .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 68, Short.MAX_VALUE)
77 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 77 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
78 .addComponent(jButton1) 78 .addComponent(jButton1)
79 .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 79 .addContainerGap())
80 ); 80 );
81 81
82 pack(); 82 pack();
diff --git a/client/trunk/src/com/fourisland/instadisc/IDFilterListCellRenderer.java b/client/trunk/src/com/fourisland/instadisc/IDFilterListCellRenderer.java new file mode 100644 index 0000000..db006f9 --- /dev/null +++ b/client/trunk/src/com/fourisland/instadisc/IDFilterListCellRenderer.java
@@ -0,0 +1,45 @@
1/*
2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
4 */
5
6package com.fourisland.instadisc;
7
8import com.fourisland.instadisc.Database.Filter;
9import java.awt.Component;
10import javax.swing.JLabel;
11import javax.swing.JList;
12import javax.swing.ListCellRenderer;
13
14/**
15 *
16 * @author hatkirby
17 */
18class IDFilterListCellRenderer extends JLabel implements ListCellRenderer {
19
20 public Component getListCellRendererComponent(JList arg0, Object arg1, int arg2, boolean arg3, boolean arg4) {
21 Filter filter = (Filter) arg1;
22
23 if (filter.getID() == -65536)
24 {
25 this.setText("Add new filter");
26 } else {
27 this.setText(filter.getField() + " " + (filter.getEqual() ? "=" : "!=") + " " + filter.getTest());
28 }
29
30 if (arg3) {
31 this.setForeground(arg0.getSelectionForeground());
32 this.setBackground(arg0.getSelectionBackground());
33 } else {
34 this.setForeground(arg0.getForeground());
35 this.setBackground(arg0.getBackground());
36 }
37
38 this.setOpaque(true);
39 this.setFont(arg0.getFont());
40 this.setEnabled(arg0.isEnabled());
41
42 return this;
43 }
44
45}
diff --git a/client/trunk/src/com/fourisland/instadisc/IDItemListCellRenderer.java b/client/trunk/src/com/fourisland/instadisc/IDItemListCellRenderer.java index b5204e6..21924e8 100644 --- a/client/trunk/src/com/fourisland/instadisc/IDItemListCellRenderer.java +++ b/client/trunk/src/com/fourisland/instadisc/IDItemListCellRenderer.java
@@ -22,11 +22,16 @@ public class IDItemListCellRenderer extends JLabel implements ListCellRenderer {
22 Item item = (Item) arg1; 22 Item item = (Item) arg1;
23 23
24 this.setIcon(Category.iconFromCategory(Wrapper.getSubscription(item.getSubscription()).getCategory())); 24 this.setIcon(Category.iconFromCategory(Wrapper.getSubscription(item.getSubscription()).getCategory()));
25 this.setText("<HTML><I>" + Wrapper.getSubscription(item.getSubscription()).getTitle() + "</I>, <B>" + item.getTitle() + "</B> by " + item.getAuthor()); 25
26 if (item.getAuthor().equals("")) {
27 this.setText("<HTML><I>" + Wrapper.getSubscription(item.getSubscription()).getTitle() + "</I>, <B>" + item.getTitle() + "</B>");
28 } else {
29 this.setText("<HTML><I>" + Wrapper.getSubscription(item.getSubscription()).getTitle() + "</I>, <B>" + item.getTitle() + "</B> by " + item.getAuthor());
30 }
26 31
27 /*if (item.getUnread()) { 32 /*if (item.getUnread()) {
28 this.setBackground(Color.YELLOW); 33 this.setBackground(Color.YELLOW);
29 } else */{ 34 } else */ {
30 if (arg3) { 35 if (arg3) {
31 this.setForeground(arg0.getSelectionForeground()); 36 this.setForeground(arg0.getSelectionForeground());
32 this.setBackground(arg0.getSelectionBackground()); 37 this.setBackground(arg0.getSelectionBackground());
diff --git a/client/trunk/src/com/fourisland/instadisc/InstaDiscView.form b/client/trunk/src/com/fourisland/instadisc/InstaDiscView.form index b000ed9..f4be5c3 100644 --- a/client/trunk/src/com/fourisland/instadisc/InstaDiscView.form +++ b/client/trunk/src/com/fourisland/instadisc/InstaDiscView.form
@@ -113,6 +113,9 @@
113 <Property name="text" type="java.lang.String" resourceKey="jMenuItem3.text"/> 113 <Property name="text" type="java.lang.String" resourceKey="jMenuItem3.text"/>
114 <Property name="name" type="java.lang.String" value="jMenuItem3" noResource="true"/> 114 <Property name="name" type="java.lang.String" value="jMenuItem3" noResource="true"/>
115 </Properties> 115 </Properties>
116 <Events>
117 <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jMenuItem3ActionPerformed"/>
118 </Events>
116 </MenuItem> 119 </MenuItem>
117 <MenuItem class="javax.swing.JMenuItem" name="jMenuItem4"> 120 <MenuItem class="javax.swing.JMenuItem" name="jMenuItem4">
118 <Properties> 121 <Properties>
diff --git a/client/trunk/src/com/fourisland/instadisc/InstaDiscView.java b/client/trunk/src/com/fourisland/instadisc/InstaDiscView.java index 3c58bfc..e2f6dda 100644 --- a/client/trunk/src/com/fourisland/instadisc/InstaDiscView.java +++ b/client/trunk/src/com/fourisland/instadisc/InstaDiscView.java
@@ -219,6 +219,11 @@ public class InstaDiscView extends FrameView {
219 219
220 jMenuItem3.setText(resourceMap.getString("jMenuItem3.text")); // NOI18N 220 jMenuItem3.setText(resourceMap.getString("jMenuItem3.text")); // NOI18N
221 jMenuItem3.setName("jMenuItem3"); // NOI18N 221 jMenuItem3.setName("jMenuItem3"); // NOI18N
222 jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
223 public void actionPerformed(java.awt.event.ActionEvent evt) {
224 jMenuItem3ActionPerformed(evt);
225 }
226 });
222 jMenu1.add(jMenuItem3); 227 jMenu1.add(jMenuItem3);
223 228
224 jMenuItem4.setText(resourceMap.getString("jMenuItem4.text")); // NOI18N 229 jMenuItem4.setText(resourceMap.getString("jMenuItem4.text")); // NOI18N
@@ -315,6 +320,11 @@ public class InstaDiscView extends FrameView {
315 asf.setVisible(true); 320 asf.setVisible(true);
316 }//GEN-LAST:event_jMenuItem5ActionPerformed 321 }//GEN-LAST:event_jMenuItem5ActionPerformed
317 322
323 private void jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMenuItem3ActionPerformed
324 ManageFiltersForm mff = new ManageFiltersForm(new JFrame(), true);
325 mff.setVisible(true);
326 }//GEN-LAST:event_jMenuItem3ActionPerformed
327
318 // Variables declaration - do not modify//GEN-BEGIN:variables 328 // Variables declaration - do not modify//GEN-BEGIN:variables
319 private javax.swing.JList jList1; 329 private javax.swing.JList jList1;
320 private javax.swing.JMenu jMenu1; 330 private javax.swing.JMenu jMenu1;
diff --git a/client/trunk/src/com/fourisland/instadisc/Item/Categories/Category.java b/client/trunk/src/com/fourisland/instadisc/Item/Categories/Category.java index aa2bee6..bc8bfac 100644 --- a/client/trunk/src/com/fourisland/instadisc/Item/Categories/Category.java +++ b/client/trunk/src/com/fourisland/instadisc/Item/Categories/Category.java
@@ -38,10 +38,25 @@ public class Category {
38 public static boolean checkForRequiredSemantics(HashMap<String, String> headerMap) { 38 public static boolean checkForRequiredSemantics(HashMap<String, String> headerMap) {
39 boolean good = true; 39 boolean good = true;
40 String category = Wrapper.getSubscription(headerMap.get("Subscription")).getCategory(); 40 String category = Wrapper.getSubscription(headerMap.get("Subscription")).getCategory();
41 if (category.equals("forum-post")) { 41 String[] semantics = getRequiredSemantics(category);
42 good = (good ? WellFormedItem.checkForRequiredHeader(headerMap, "forum") : false); 42 int i=0;
43
44 for (i=0;i<semantics.length;i++)
45 {
46 good = (good ? WellFormedItem.checkForRequiredHeader(headerMap, semantics[i]) : false);
43 } 47 }
48
44 return good; 49 return good;
45 } 50 }
46 51
52 public static String[] getRequiredSemantics(String category)
53 {
54 if (category.equals("forum-post"))
55 {
56 return new String[] {"forum"};
57 } else {
58 return new String[] {};
59 }
60 }
61
47} 62}
diff --git a/client/trunk/src/com/fourisland/instadisc/Item/Item.java b/client/trunk/src/com/fourisland/instadisc/Item/Item.java index fa3b50c..776a884 100644 --- a/client/trunk/src/com/fourisland/instadisc/Item/Item.java +++ b/client/trunk/src/com/fourisland/instadisc/Item/Item.java
@@ -33,7 +33,7 @@ public class Item {
33 if (wfi.check()) { 33 if (wfi.check()) {
34 XmlRpc xmlrpc = new XmlRpc("deleteItem"); 34 XmlRpc xmlrpc = new XmlRpc("deleteItem");
35 xmlrpc.addParam(Integer.decode(headerMap.get("ID"))); 35 xmlrpc.addParam(Integer.decode(headerMap.get("ID")));
36 //xmlrpc.execute(); 36 xmlrpc.execute();
37 37
38 if (Wrapper.countItem() >= Integer.decode(Wrapper.getConfig("itemBufferSize"))) 38 if (Wrapper.countItem() >= Integer.decode(Wrapper.getConfig("itemBufferSize")))
39 { 39 {
diff --git a/client/trunk/src/com/fourisland/instadisc/Item/SubscriptionFile.java b/client/trunk/src/com/fourisland/instadisc/Item/SubscriptionFile.java index adca86e..2d8ad07 100644 --- a/client/trunk/src/com/fourisland/instadisc/Item/SubscriptionFile.java +++ b/client/trunk/src/com/fourisland/instadisc/Item/SubscriptionFile.java
@@ -4,8 +4,10 @@
4 */ 4 */
5package com.fourisland.instadisc.Item; 5package com.fourisland.instadisc.Item;
6 6
7import com.fourisland.instadisc.Database.Filter;
7import com.fourisland.instadisc.Database.Subscription; 8import com.fourisland.instadisc.Database.Subscription;
8import com.fourisland.instadisc.Database.Wrapper; 9import com.fourisland.instadisc.Database.Wrapper;
10import com.fourisland.instadisc.XmlRpc;
9import java.io.IOException; 11import java.io.IOException;
10import java.io.InputStream; 12import java.io.InputStream;
11import java.net.HttpURLConnection; 13import java.net.HttpURLConnection;
@@ -33,6 +35,28 @@ public class SubscriptionFile {
33 Logger.getLogger(SubscriptionFile.class.getName()).log(Level.SEVERE, null, ex); 35 Logger.getLogger(SubscriptionFile.class.getName()).log(Level.SEVERE, null, ex);
34 } 36 }
35 } 37 }
38
39 public static void deleteSubscription(Subscription s, boolean deleteFromData)
40 {
41 if (deleteFromData)
42 {
43 Wrapper.deleteSubscription(s.getURL());
44 }
45
46 XmlRpc xmlrpc = new XmlRpc("deleteSubscription");
47 xmlrpc.addParam(s.getURL());
48 xmlrpc.execute();
49
50 int i=0;
51 Filter f[] = Wrapper.getAllFilter();
52 for (i=0;i<f.length;i++)
53 {
54 if (f[i].getSubscription().equals(s.getURL()))
55 {
56 Wrapper.deleteFilter(f[i].getID());
57 }
58 }
59 }
36} 60}
37 61
38class SubscriptionFileThread implements Runnable { 62class SubscriptionFileThread implements Runnable {
diff --git a/client/trunk/src/com/fourisland/instadisc/ManageFiltersForm.form b/client/trunk/src/com/fourisland/instadisc/ManageFiltersForm.form new file mode 100644 index 0000000..3f1e603 --- /dev/null +++ b/client/trunk/src/com/fourisland/instadisc/ManageFiltersForm.form
@@ -0,0 +1,170 @@
1<?xml version="1.0" encoding="UTF-8" ?>
2
3<Form version="1.5" maxVersion="1.5" type="org.netbeans.modules.form.forminfo.JDialogFormInfo">
4 <Properties>
5 <Property name="defaultCloseOperation" type="int" value="2"/>
6 <Property name="name" type="java.lang.String" value="Form" noResource="true"/>
7 </Properties>
8 <SyntheticProperties>
9 <SyntheticProperty name="formSizePolicy" type="int" value="1"/>
10 </SyntheticProperties>
11 <AuxValues>
12 <AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="2"/>
13 <AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="true"/>
14 <AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/>
15 <AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/>
16 <AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/>
17 <AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/>
18 <AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/>
19 <AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/>
20 </AuxValues>
21
22 <Layout>
23 <DimensionLayout dim="0">
24 <Group type="103" groupAlignment="0" attributes="0">
25 <Group type="102" attributes="0">
26 <Group type="103" groupAlignment="0" attributes="0">
27 <Group type="102" attributes="0">
28 <EmptySpace max="-2" attributes="0"/>
29 <Group type="103" groupAlignment="1" attributes="0">
30 <Component id="jLabel1" alignment="0" min="-2" max="-2" attributes="0"/>
31 <Group type="102" alignment="0" attributes="0">
32 <EmptySpace min="12" pref="12" max="12" attributes="0"/>
33 <Component id="jLabel2" pref="425" max="32767" attributes="0"/>
34 </Group>
35 </Group>
36 </Group>
37 <Group type="102" alignment="1" attributes="0">
38 <EmptySpace min="-2" pref="24" max="-2" attributes="0"/>
39 <Component id="jScrollPane1" min="-2" pref="208" max="-2" attributes="0"/>
40 <EmptySpace min="-2" max="-2" attributes="0"/>
41 <Component id="jScrollPane2" pref="211" max="32767" attributes="0"/>
42 </Group>
43 <Group type="102" alignment="1" attributes="0">
44 <EmptySpace pref="301" max="32767" attributes="0"/>
45 <Component id="jButton1" min="-2" max="-2" attributes="0"/>
46 <EmptySpace max="-2" attributes="0"/>
47 <Component id="jButton2" min="-2" max="-2" attributes="0"/>
48 <EmptySpace max="-2" attributes="0"/>
49 <Component id="jButton3" min="-2" max="-2" attributes="0"/>
50 </Group>
51 </Group>
52 <EmptySpace max="-2" attributes="0"/>
53 </Group>
54 </Group>
55 </DimensionLayout>
56 <DimensionLayout dim="1">
57 <Group type="103" groupAlignment="0" attributes="0">
58 <Group type="102" alignment="0" attributes="0">
59 <EmptySpace max="-2" attributes="0"/>
60 <Component id="jLabel1" min="-2" max="-2" attributes="0"/>
61 <EmptySpace max="-2" attributes="0"/>
62 <Component id="jLabel2" pref="40" max="32767" attributes="0"/>
63 <EmptySpace max="-2" attributes="0"/>
64 <Group type="103" groupAlignment="0" attributes="0">
65 <Component id="jScrollPane1" pref="189" max="32767" attributes="1"/>
66 <Component id="jScrollPane2" alignment="0" pref="189" max="32767" attributes="1"/>
67 </Group>
68 <EmptySpace max="-2" attributes="0"/>
69 <Group type="103" groupAlignment="3" attributes="0">
70 <Component id="jButton3" alignment="3" min="-2" max="-2" attributes="0"/>
71 <Component id="jButton2" alignment="3" min="-2" max="-2" attributes="0"/>
72 <Component id="jButton1" alignment="3" min="-2" max="-2" attributes="0"/>
73 </Group>
74 <EmptySpace min="-2" max="-2" attributes="0"/>
75 </Group>
76 </Group>
77 </DimensionLayout>
78 </Layout>
79 <SubComponents>
80 <Component class="javax.swing.JLabel" name="jLabel1">
81 <Properties>
82 <Property name="font" type="java.awt.Font" resourceKey="jLabel1.font"/>
83 <Property name="text" type="java.lang.String" resourceKey="jLabel1.text"/>
84 <Property name="name" type="java.lang.String" value="jLabel1" noResource="true"/>
85 </Properties>
86 </Component>
87 <Component class="javax.swing.JLabel" name="jLabel2">
88 <Properties>
89 <Property name="text" type="java.lang.String" resourceKey="jLabel2.text"/>
90 <Property name="name" type="java.lang.String" value="jLabel2" noResource="true"/>
91 <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
92 <Dimension value="[625, 17]"/>
93 </Property>
94 </Properties>
95 </Component>
96 <Container class="javax.swing.JScrollPane" name="jScrollPane1">
97 <Properties>
98 <Property name="name" type="java.lang.String" value="jScrollPane1" noResource="true"/>
99 </Properties>
100 <AuxValues>
101 <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
102 </AuxValues>
103
104 <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
105 <SubComponents>
106 <Component class="javax.swing.JList" name="jList1">
107 <Properties>
108 <Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.editors2.ListModelEditor">
109 <StringArray count="0"/>
110 </Property>
111 <Property name="name" type="java.lang.String" value="jList1" noResource="true"/>
112 </Properties>
113 <Events>
114 <EventHandler event="valueChanged" listener="javax.swing.event.ListSelectionListener" parameters="javax.swing.event.ListSelectionEvent" handler="jList1ValueChanged"/>
115 </Events>
116 </Component>
117 </SubComponents>
118 </Container>
119 <Container class="javax.swing.JScrollPane" name="jScrollPane2">
120 <Properties>
121 <Property name="name" type="java.lang.String" value="jScrollPane2" noResource="true"/>
122 </Properties>
123 <AuxValues>
124 <AuxValue name="autoScrollPane" type="java.lang.Boolean" value="true"/>
125 </AuxValues>
126
127 <Layout class="org.netbeans.modules.form.compat2.layouts.support.JScrollPaneSupportLayout"/>
128 <SubComponents>
129 <Component class="javax.swing.JList" name="jList2">
130 <Properties>
131 <Property name="model" type="javax.swing.ListModel" editor="org.netbeans.modules.form.editors2.ListModelEditor">
132 <StringArray count="0"/>
133 </Property>
134 <Property name="name" type="java.lang.String" value="jList2" noResource="true"/>
135 </Properties>
136 <Events>
137 <EventHandler event="valueChanged" listener="javax.swing.event.ListSelectionListener" parameters="javax.swing.event.ListSelectionEvent" handler="jList2ValueChanged"/>
138 </Events>
139 </Component>
140 </SubComponents>
141 </Container>
142 <Component class="javax.swing.JButton" name="jButton1">
143 <Properties>
144 <Property name="text" type="java.lang.String" resourceKey="jButton1.text"/>
145 <Property name="name" type="java.lang.String" value="jButton1" noResource="true"/>
146 </Properties>
147 <Events>
148 <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton1ActionPerformed"/>
149 </Events>
150 </Component>
151 <Component class="javax.swing.JButton" name="jButton2">
152 <Properties>
153 <Property name="text" type="java.lang.String" resourceKey="jButton2.text"/>
154 <Property name="name" type="java.lang.String" value="jButton2" noResource="true"/>
155 </Properties>
156 <Events>
157 <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton2ActionPerformed"/>
158 </Events>
159 </Component>
160 <Component class="javax.swing.JButton" name="jButton3">
161 <Properties>
162 <Property name="text" type="java.lang.String" resourceKey="jButton3.text"/>
163 <Property name="name" type="java.lang.String" value="jButton3" noResource="true"/>
164 </Properties>
165 <Events>
166 <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="jButton3ActionPerformed"/>
167 </Events>
168 </Component>
169 </SubComponents>
170</Form>
diff --git a/client/trunk/src/com/fourisland/instadisc/ManageFiltersForm.java b/client/trunk/src/com/fourisland/instadisc/ManageFiltersForm.java new file mode 100644 index 0000000..cd4426e --- /dev/null +++ b/client/trunk/src/com/fourisland/instadisc/ManageFiltersForm.java
@@ -0,0 +1,266 @@
1/*
2 * ManageFiltersForm.java
3 *
4 * Created on July 31, 2008, 4:08 PM
5 */
6package com.fourisland.instadisc;
7
8import com.fourisland.instadisc.Database.Filter;
9import com.fourisland.instadisc.Database.Subscription;
10import com.fourisland.instadisc.Database.Wrapper;
11import javax.swing.DefaultListModel;
12import javax.swing.JFrame;
13
14/**
15 *
16 * @author hatkirby
17 */
18public class ManageFiltersForm extends javax.swing.JDialog {
19
20 /** Creates new form ManageFiltersForm */
21 public ManageFiltersForm(java.awt.Frame parent, boolean modal) {
22 super(parent, modal);
23 initComponents();
24
25 jList1.setModel(lm);
26 jList2.setModel(lm2);
27
28 jList1.setCellRenderer(new IDSubscriptionListCellRenderer());
29 jList2.setCellRenderer(new IDFilterListCellRenderer());
30
31 refreshSubscriptionPane();
32
33 if (!lm.isEmpty()) {
34 jList1.setSelectedIndex(0);
35
36 refreshFilterPane();
37 jList2.setSelectedIndex(0);
38 }
39 }
40
41 /** This method is called from within the constructor to
42 * initialize the form.
43 * WARNING: Do NOT modify this code. The content of this method is
44 * always regenerated by the Form Editor.
45 */
46 // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
47 private void initComponents() {
48
49 jLabel1 = new javax.swing.JLabel();
50 jLabel2 = new javax.swing.JLabel();
51 jScrollPane1 = new javax.swing.JScrollPane();
52 jList1 = new javax.swing.JList();
53 jScrollPane2 = new javax.swing.JScrollPane();
54 jList2 = new javax.swing.JList();
55 jButton1 = new javax.swing.JButton();
56 jButton2 = new javax.swing.JButton();
57 jButton3 = new javax.swing.JButton();
58
59 setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
60 setName("Form"); // NOI18N
61
62 org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(com.fourisland.instadisc.InstaDiscApp.class).getContext().getResourceMap(ManageFiltersForm.class);
63 jLabel1.setFont(resourceMap.getFont("jLabel1.font")); // NOI18N
64 jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
65 jLabel1.setName("jLabel1"); // NOI18N
66
67 jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
68 jLabel2.setName("jLabel2"); // NOI18N
69 jLabel2.setPreferredSize(new java.awt.Dimension(625, 17));
70
71 jScrollPane1.setName("jScrollPane1"); // NOI18N
72
73 jList1.setName("jList1"); // NOI18N
74 jList1.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
75 public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
76 jList1ValueChanged(evt);
77 }
78 });
79 jScrollPane1.setViewportView(jList1);
80
81 jScrollPane2.setName("jScrollPane2"); // NOI18N
82
83 jList2.setName("jList2"); // NOI18N
84 jList2.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
85 public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
86 jList2ValueChanged(evt);
87 }
88 });
89 jScrollPane2.setViewportView(jList2);
90
91 jButton1.setText(resourceMap.getString("jButton1.text")); // NOI18N
92 jButton1.setName("jButton1"); // NOI18N
93 jButton1.addActionListener(new java.awt.event.ActionListener() {
94 public void actionPerformed(java.awt.event.ActionEvent evt) {
95 jButton1ActionPerformed(evt);
96 }
97 });
98
99 jButton2.setText(resourceMap.getString("jButton2.text")); // NOI18N
100 jButton2.setName("jButton2"); // NOI18N
101 jButton2.addActionListener(new java.awt.event.ActionListener() {
102 public void actionPerformed(java.awt.event.ActionEvent evt) {
103 jButton2ActionPerformed(evt);
104 }
105 });
106
107 jButton3.setText(resourceMap.getString("jButton3.text")); // NOI18N
108 jButton3.setName("jButton3"); // NOI18N
109 jButton3.addActionListener(new java.awt.event.ActionListener() {
110 public void actionPerformed(java.awt.event.ActionEvent evt) {
111 jButton3ActionPerformed(evt);
112 }
113 });
114
115 javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
116 getContentPane().setLayout(layout);
117 layout.setHorizontalGroup(
118 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
119 .addGroup(layout.createSequentialGroup()
120 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
121 .addGroup(layout.createSequentialGroup()
122 .addContainerGap()
123 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
124 .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING)
125 .addGroup(javax.swing.GroupLayout.Alignment.LEADING, layout.createSequentialGroup()
126 .addGap(12, 12, 12)
127 .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 425, Short.MAX_VALUE))))
128 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
129 .addGap(24, 24, 24)
130 .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 208, javax.swing.GroupLayout.PREFERRED_SIZE)
131 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
132 .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 211, Short.MAX_VALUE))
133 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
134 .addContainerGap(301, Short.MAX_VALUE)
135 .addComponent(jButton1)
136 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
137 .addComponent(jButton2)
138 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
139 .addComponent(jButton3)))
140 .addContainerGap())
141 );
142 layout.setVerticalGroup(
143 layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
144 .addGroup(layout.createSequentialGroup()
145 .addContainerGap()
146 .addComponent(jLabel1)
147 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
148 .addComponent(jLabel2, javax.swing.GroupLayout.DEFAULT_SIZE, 40, Short.MAX_VALUE)
149 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
150 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
151 .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 189, Short.MAX_VALUE)
152 .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 189, Short.MAX_VALUE))
153 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
154 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
155 .addComponent(jButton3)
156 .addComponent(jButton2)
157 .addComponent(jButton1))
158 .addContainerGap())
159 );
160
161 pack();
162 }// </editor-fold>//GEN-END:initComponents
163 private void jList1ValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_jList1ValueChanged
164 refreshFilterPane();
165 }//GEN-LAST:event_jList1ValueChanged
166
167 private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton3ActionPerformed
168 setVisible(false);
169 }//GEN-LAST:event_jButton3ActionPerformed
170
171 private void jList2ValueChanged(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_jList2ValueChanged
172 Filter filter = (Filter) jList2.getSelectedValue();
173 try {
174 if (filter.getID() == -65536) {
175 jButton1.setText("Add");
176 jButton2.setEnabled(false);
177 } else {
178 jButton1.setText("Edit");
179 jButton2.setEnabled(true);
180 }
181 } catch (Exception ex) {
182 jButton1.setText("Edit");
183 jButton1.setEnabled(false);
184 jButton2.setEnabled(false);
185 }
186 }//GEN-LAST:event_jList2ValueChanged
187
188 private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
189 Wrapper.deleteFilter(((Filter) jList2.getSelectedValue()).getID());
190 refreshFilterPane();
191 }//GEN-LAST:event_jButton2ActionPerformed
192
193 private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
194 ActionFilterForm aff = new ActionFilterForm(new JFrame(), true);
195 aff.setFilter((Filter) jList2.getSelectedValue());
196 aff.setVisible(true);
197 refreshFilterPane();
198 }//GEN-LAST:event_jButton1ActionPerformed
199
200 /**
201 * @param args the command line arguments
202 */
203 public static void main(String args[]) {
204 java.awt.EventQueue.invokeLater(new Runnable() {
205
206 public void run() {
207 ManageFiltersForm dialog = new ManageFiltersForm(new javax.swing.JFrame(), true);
208 dialog.addWindowListener(new java.awt.event.WindowAdapter() {
209
210 public void windowClosing(java.awt.event.WindowEvent e) {
211 System.exit(0);
212 }
213 });
214 dialog.setVisible(true);
215 }
216 });
217 }
218 // Variables declaration - do not modify//GEN-BEGIN:variables
219 private javax.swing.JButton jButton1;
220 private javax.swing.JButton jButton2;
221 private javax.swing.JButton jButton3;
222 private javax.swing.JLabel jLabel1;
223 private javax.swing.JLabel jLabel2;
224 private javax.swing.JList jList1;
225 private javax.swing.JList jList2;
226 private javax.swing.JScrollPane jScrollPane1;
227 private javax.swing.JScrollPane jScrollPane2;
228 // End of variables declaration//GEN-END:variables
229 DefaultListModel lm = new DefaultListModel();
230 DefaultListModel lm2 = new DefaultListModel();
231
232 public void refreshSubscriptionPane() {
233 lm.clear();
234 Subscription[] subscriptions = Wrapper.getAllSubscription();
235 int i = 0;
236 for (i = 0; i < subscriptions.length; i++) {
237 lm.addElement(subscriptions[i]);
238 }
239
240 jList1.setEnabled(!lm.isEmpty());
241 jList2.setEnabled(!lm.isEmpty());
242 jButton1.setEnabled(!lm.isEmpty());
243 jButton2.setEnabled(!lm.isEmpty());
244
245 if (lm.isEmpty()) {
246 lm2.clear();
247 }
248 }
249
250 public void refreshFilterPane() {
251 lm2.clear();
252
253 Filter addNew = new Filter();
254 addNew.setID(-65536);
255 addNew.setSubscription(((Subscription) jList1.getSelectedValue()).getURL());
256 lm2.addElement(addNew);
257
258 Filter[] filters = Wrapper.getAllFilter();
259 int i = 0;
260 for (i = 0; i < filters.length; i++) {
261 if (filters[i].getSubscription().equals(((Subscription) jList1.getSelectedValue()).getURL())) {
262 lm2.addElement(filters[i]);
263 }
264 }
265 }
266}
diff --git a/client/trunk/src/com/fourisland/instadisc/ManageSubscriptionsForm.form b/client/trunk/src/com/fourisland/instadisc/ManageSubscriptionsForm.form index f9efe54..897f8a8 100644 --- a/client/trunk/src/com/fourisland/instadisc/ManageSubscriptionsForm.form +++ b/client/trunk/src/com/fourisland/instadisc/ManageSubscriptionsForm.form
@@ -29,13 +29,13 @@
29 <Group type="102" alignment="0" attributes="0"> 29 <Group type="102" alignment="0" attributes="0">
30 <EmptySpace min="12" pref="12" max="12" attributes="0"/> 30 <EmptySpace min="12" pref="12" max="12" attributes="0"/>
31 <Group type="103" groupAlignment="0" max="-2" attributes="0"> 31 <Group type="103" groupAlignment="0" max="-2" attributes="0">
32 <Component id="jLabel2" alignment="0" min="0" pref="0" max="32767" attributes="1"/>
33 <Component id="jScrollPane1" alignment="0" pref="343" max="32767" attributes="1"/> 32 <Component id="jScrollPane1" alignment="0" pref="343" max="32767" attributes="1"/>
34 <Group type="102" alignment="1" attributes="0"> 33 <Group type="102" alignment="1" attributes="0">
35 <Component id="jButton1" min="-2" max="-2" attributes="0"/> 34 <Component id="jButton1" min="-2" max="-2" attributes="0"/>
36 <EmptySpace max="-2" attributes="0"/> 35 <EmptySpace max="-2" attributes="0"/>
37 <Component id="jButton2" min="-2" max="-2" attributes="0"/> 36 <Component id="jButton2" min="-2" max="-2" attributes="0"/>
38 </Group> 37 </Group>
38 <Component id="jLabel2" alignment="0" min="0" pref="0" max="32767" attributes="1"/>
39 </Group> 39 </Group>
40 </Group> 40 </Group>
41 </Group> 41 </Group>
@@ -74,6 +74,9 @@
74 <Properties> 74 <Properties>
75 <Property name="text" type="java.lang.String" resourceKey="jLabel2.text"/> 75 <Property name="text" type="java.lang.String" resourceKey="jLabel2.text"/>
76 <Property name="name" type="java.lang.String" value="jLabel2" noResource="true"/> 76 <Property name="name" type="java.lang.String" value="jLabel2" noResource="true"/>
77 <Property name="preferredSize" type="java.awt.Dimension" editor="org.netbeans.beaninfo.editors.DimensionEditor">
78 <Dimension value="[1061, 71]"/>
79 </Property>
77 </Properties> 80 </Properties>
78 </Component> 81 </Component>
79 <Container class="javax.swing.JScrollPane" name="jScrollPane1"> 82 <Container class="javax.swing.JScrollPane" name="jScrollPane1">
diff --git a/client/trunk/src/com/fourisland/instadisc/ManageSubscriptionsForm.java b/client/trunk/src/com/fourisland/instadisc/ManageSubscriptionsForm.java index 6eeac2c..94a8075 100644 --- a/client/trunk/src/com/fourisland/instadisc/ManageSubscriptionsForm.java +++ b/client/trunk/src/com/fourisland/instadisc/ManageSubscriptionsForm.java
@@ -8,6 +8,7 @@ package com.fourisland.instadisc;
8 8
9import com.fourisland.instadisc.Database.Subscription; 9import com.fourisland.instadisc.Database.Subscription;
10import com.fourisland.instadisc.Database.Wrapper; 10import com.fourisland.instadisc.Database.Wrapper;
11import com.fourisland.instadisc.Item.SubscriptionFile;
11import javax.swing.DefaultListModel; 12import javax.swing.DefaultListModel;
12 13
13/** 14/**
@@ -51,6 +52,7 @@ public class ManageSubscriptionsForm extends javax.swing.JDialog {
51 52
52 jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N 53 jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
53 jLabel2.setName("jLabel2"); // NOI18N 54 jLabel2.setName("jLabel2"); // NOI18N
55 jLabel2.setPreferredSize(new java.awt.Dimension(1061, 71));
54 56
55 jScrollPane1.setName("jScrollPane1"); // NOI18N 57 jScrollPane1.setName("jScrollPane1"); // NOI18N
56 58
@@ -84,12 +86,12 @@ public class ManageSubscriptionsForm extends javax.swing.JDialog {
84 .addGroup(layout.createSequentialGroup() 86 .addGroup(layout.createSequentialGroup()
85 .addGap(12, 12, 12) 87 .addGap(12, 12, 12)
86 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) 88 .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
87 .addComponent(jLabel2, 0, 0, Short.MAX_VALUE)
88 .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 343, Short.MAX_VALUE) 89 .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 343, Short.MAX_VALUE)
89 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() 90 .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
90 .addComponent(jButton1) 91 .addComponent(jButton1)
91 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 92 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
92 .addComponent(jButton2))))) 93 .addComponent(jButton2))
94 .addComponent(jLabel2, 0, 0, Short.MAX_VALUE))))
93 .addContainerGap()) 95 .addContainerGap())
94 ); 96 );
95 layout.setVerticalGroup( 97 layout.setVerticalGroup(
@@ -98,7 +100,7 @@ public class ManageSubscriptionsForm extends javax.swing.JDialog {
98 .addContainerGap() 100 .addContainerGap()
99 .addComponent(jLabel1) 101 .addComponent(jLabel1)
100 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 102 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
101 .addComponent(jLabel2) 103 .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
102 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 104 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
103 .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 105 .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
104 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 106 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
@@ -115,11 +117,7 @@ public class ManageSubscriptionsForm extends javax.swing.JDialog {
115 if (!jList1.isSelectionEmpty()) 117 if (!jList1.isSelectionEmpty())
116 { 118 {
117 Subscription subscription = (Subscription) jList1.getSelectedValue(); 119 Subscription subscription = (Subscription) jList1.getSelectedValue();
118 Wrapper.deleteSubscription(subscription.getURL()); 120 SubscriptionFile.deleteSubscription(subscription, true);
119
120 XmlRpc xmlrpc = new XmlRpc("deleteSubscription");
121 xmlrpc.addParam(subscription.getURL());
122 xmlrpc.execute();
123 121
124 refreshSubscriptionPane(); 122 refreshSubscriptionPane();
125 } 123 }
diff --git a/client/trunk/src/com/fourisland/instadisc/resources/ActionFilterForm.properties b/client/trunk/src/com/fourisland/instadisc/resources/ActionFilterForm.properties new file mode 100644 index 0000000..ebf3a91 --- /dev/null +++ b/client/trunk/src/com/fourisland/instadisc/resources/ActionFilterForm.properties
@@ -0,0 +1,12 @@
1jLabel1.text=Edit Filter
2#NOI18N
3jLabel1.font=DejaVu Sans-Plain-18
4jLabel2.text=<HTML>You can choose the conditions that Items are filtered out upon here.
5jLabel3.text=Field:
6jCheckBox1.text=
7jLabel4.text=Remove if Equal:
8jLabel5.text=<HTML>If this is set, Items are filtered out when the field set above is equal to the text set below. If unset, Items are kept when the field specified above is equal to the text below.
9jLabel6.text=Test Value:
10jTextField1.text=
11jButton1.text=Cancel
12jButton2.text=OK
diff --git a/client/trunk/src/com/fourisland/instadisc/resources/ManageFiltersForm.properties b/client/trunk/src/com/fourisland/instadisc/resources/ManageFiltersForm.properties new file mode 100644 index 0000000..a163ede --- /dev/null +++ b/client/trunk/src/com/fourisland/instadisc/resources/ManageFiltersForm.properties
@@ -0,0 +1,7 @@
1jLabel1.text=Manage Filters
2#NOI18N
3jLabel1.font=DejaVu Sans-Plain-18
4jLabel2.text=<HTML>You can <I>filter</I> out specific Items that you don't want using Filters. For more information, see <A HREF="http://fourisland.com/projects/instadisc/wiki/Filters">Filters</A>.
5jButton1.text=Edit
6jButton2.text=Delete
7jButton3.text=Done