-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Grzegorz Jaszewski
authored and
jjroman
committed
Jan 30, 2013
1 parent
95a18fd
commit 2fb4289
Showing
10 changed files
with
374 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
|
||
<Form version="1.3" maxVersion="1.8" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> | ||
<Properties> | ||
<Property name="defaultCloseOperation" type="int" value="3"/> | ||
</Properties> | ||
<SyntheticProperties> | ||
<SyntheticProperty name="formSizePolicy" type="int" value="1"/> | ||
</SyntheticProperties> | ||
<AuxValues> | ||
<AuxValue name="FormSettings_autoResourcing" type="java.lang.Integer" value="0"/> | ||
<AuxValue name="FormSettings_autoSetComponentName" type="java.lang.Boolean" value="false"/> | ||
<AuxValue name="FormSettings_generateFQN" type="java.lang.Boolean" value="true"/> | ||
<AuxValue name="FormSettings_generateMnemonicsCode" type="java.lang.Boolean" value="false"/> | ||
<AuxValue name="FormSettings_i18nAutoMode" type="java.lang.Boolean" value="false"/> | ||
<AuxValue name="FormSettings_layoutCodeTarget" type="java.lang.Integer" value="1"/> | ||
<AuxValue name="FormSettings_listenerGenerationStyle" type="java.lang.Integer" value="0"/> | ||
<AuxValue name="FormSettings_variablesLocal" type="java.lang.Boolean" value="false"/> | ||
<AuxValue name="FormSettings_variablesModifier" type="java.lang.Integer" value="2"/> | ||
</AuxValues> | ||
|
||
<Layout> | ||
<DimensionLayout dim="0"> | ||
<Group type="103" groupAlignment="0" attributes="0"> | ||
<Group type="102" alignment="0" attributes="0"> | ||
<EmptySpace max="-2" attributes="0"/> | ||
<Component id="jTabbedPane1" pref="380" max="32767" attributes="0"/> | ||
<EmptySpace max="-2" attributes="0"/> | ||
</Group> | ||
</Group> | ||
</DimensionLayout> | ||
<DimensionLayout dim="1"> | ||
<Group type="103" groupAlignment="0" attributes="0"> | ||
<Group type="102" alignment="1" attributes="0"> | ||
<EmptySpace max="-2" attributes="0"/> | ||
<Component id="jTabbedPane1" max="32767" attributes="0"/> | ||
<EmptySpace max="-2" attributes="0"/> | ||
</Group> | ||
</Group> | ||
</DimensionLayout> | ||
</Layout> | ||
<SubComponents> | ||
<Container class="javax.swing.JTabbedPane" name="jTabbedPane1"> | ||
|
||
<Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/> | ||
<SubComponents> | ||
<Component class="sem2.iwi.gui.MainPanel" name="mainPanel1"> | ||
<Constraints> | ||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription"> | ||
<JTabbedPaneConstraints tabName="Klasyfikator"> | ||
<Property name="tabTitle" type="java.lang.String" value="Klasyfikator"/> | ||
</JTabbedPaneConstraints> | ||
</Constraint> | ||
</Constraints> | ||
</Component> | ||
<Component class="sem2.iwi.gui.TwellowCrawler" name="twellowCrawler1"> | ||
<Constraints> | ||
<Constraint layoutClass="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout" value="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout$JTabbedPaneConstraintsDescription"> | ||
<JTabbedPaneConstraints tabName="Kategorie Twittów"> | ||
<Property name="tabTitle" type="java.lang.String" value="Kategorie Twittów"/> | ||
</JTabbedPaneConstraints> | ||
</Constraint> | ||
</Constraints> | ||
</Component> | ||
</SubComponents> | ||
</Container> | ||
</SubComponents> | ||
</Form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
/* | ||
* To change this template, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package sem2.iwi.gui; | ||
|
||
/** | ||
* | ||
* @author jjroman | ||
*/ | ||
public class MainWindow extends javax.swing.JFrame { | ||
|
||
/** | ||
* Creates new form MainWindow | ||
*/ | ||
public MainWindow() { | ||
initComponents(); | ||
} | ||
|
||
/** | ||
* This method is called from within the constructor to initialize the form. | ||
* WARNING: Do NOT modify this code. The content of this method is always | ||
* regenerated by the Form Editor. | ||
*/ | ||
@SuppressWarnings("unchecked") | ||
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents | ||
private void initComponents() { | ||
|
||
jTabbedPane1 = new javax.swing.JTabbedPane(); | ||
mainPanel1 = new sem2.iwi.gui.MainPanel(); | ||
twellowCrawler1 = new sem2.iwi.gui.TwellowCrawler(); | ||
|
||
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); | ||
|
||
jTabbedPane1.addTab("Klasyfikator", mainPanel1); | ||
jTabbedPane1.addTab("Kategorie Twittów", twellowCrawler1); | ||
|
||
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); | ||
getContentPane().setLayout(layout); | ||
layout.setHorizontalGroup( | ||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) | ||
.addGroup(layout.createSequentialGroup() | ||
.addContainerGap() | ||
.addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE) | ||
.addContainerGap()) | ||
); | ||
layout.setVerticalGroup( | ||
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) | ||
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup() | ||
.addContainerGap() | ||
.addComponent(jTabbedPane1) | ||
.addContainerGap()) | ||
); | ||
|
||
pack(); | ||
}// </editor-fold>//GEN-END:initComponents | ||
|
||
/** | ||
* @param args the command line arguments | ||
*/ | ||
public static void main(String args[]) { | ||
/* Set the Nimbus look and feel */ | ||
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> | ||
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel. | ||
* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html | ||
*/ | ||
try { | ||
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) { | ||
if ("Nimbus".equals(info.getName())) { | ||
javax.swing.UIManager.setLookAndFeel(info.getClassName()); | ||
break; | ||
} | ||
} | ||
} catch (ClassNotFoundException ex) { | ||
java.util.logging.Logger.getLogger(MainWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); | ||
} catch (InstantiationException ex) { | ||
java.util.logging.Logger.getLogger(MainWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); | ||
} catch (IllegalAccessException ex) { | ||
java.util.logging.Logger.getLogger(MainWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); | ||
} catch (javax.swing.UnsupportedLookAndFeelException ex) { | ||
java.util.logging.Logger.getLogger(MainWindow.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); | ||
} | ||
//</editor-fold> | ||
|
||
/* Create and display the form */ | ||
java.awt.EventQueue.invokeLater(new Runnable() { | ||
public void run() { | ||
new MainWindow().setVisible(true); | ||
} | ||
}); | ||
} | ||
// Variables declaration - do not modify//GEN-BEGIN:variables | ||
private javax.swing.JTabbedPane jTabbedPane1; | ||
private sem2.iwi.gui.MainPanel mainPanel1; | ||
private sem2.iwi.gui.TwellowCrawler twellowCrawler1; | ||
// End of variables declaration//GEN-END:variables | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* To change this template, choose Tools | Templates | ||
* and open the template in the editor. | ||
*/ | ||
package sem2.iwi.gui; | ||
|
||
import java.util.HashSet; | ||
import java.util.Iterator; | ||
import javax.swing.table.DefaultTableModel; | ||
import sem2.iwi.crawler.MainTwellowCrawler; | ||
import sem2.iwi.crawler.TwellowCategory; | ||
|
||
/** | ||
* | ||
* @author jjroman | ||
*/ | ||
class TwellowCateryModel extends DefaultTableModel { | ||
|
||
|
||
|
||
public TwellowCateryModel(Object[][] data, String[] columnNames) { | ||
super(data,columnNames); | ||
} | ||
|
||
public static String[] getColumnNames(){ | ||
return new String[]{"Nazwa", "Liczba użytkowników", "URL"}; | ||
} | ||
public static Object[][] getData(){ | ||
HashSet<TwellowCategory> hstc = MainTwellowCrawler.getMainCategoryList(); | ||
Object[][] data = new Object[hstc.size()][3]; | ||
int i = 0; | ||
for (Iterator<TwellowCategory> it = hstc.iterator(); it.hasNext(); i++) { | ||
TwellowCategory tc = it.next(); | ||
data[i][0] = tc.getName(); | ||
data[i][1] = tc.getUsers(); | ||
data[i][2] = tc.getUrl(); | ||
} | ||
return data; | ||
} | ||
|
||
@Override | ||
public boolean isCellEditable(int y, int x){ | ||
return false; | ||
} | ||
|
||
@Override | ||
public Class<?> getColumnClass(int columnIndex) { | ||
if (columnIndex == 1) { | ||
return Integer.class; | ||
} | ||
return String.class; | ||
} | ||
} |
Oops, something went wrong.