id
stringlengths
36
36
text
stringlengths
1
1.25M
3627e4a2-b517-4184-b3b9-e6ff57e6fee3
public int getDay(){ DateFormat dateFormat = new SimpleDateFormat("dd"); Date date = new Date(); return Integer.parseInt(dateFormat.format(date)); }
36c16863-a1f4-4cc8-8a7f-42b7efbf7492
public int getYear(){ DateFormat dateFormat = new SimpleDateFormat("yyyy"); Date date = new Date(); return Integer.parseInt(dateFormat.format(date)); }
27ae140a-ce3d-43eb-8b87-14cc34d88096
ClubDoors(){ super("Club Doors"); //Title name this.setup(); // Setup the GUI // Make a startup class to quickly veryfy the database IP new Startup(); }
d969f367-31ef-460b-a5c8-e5bd58714287
public static void main(String[] args) { JFrame.setDefaultLookAndFeelDecorated(true); new ClubDoors(); }
ed28c4b3-78d4-402d-a26d-ec0965ffb3d2
public final void setup(){ setLocationRelativeTo(null); setDefaultCloseOperation(EXIT_ON_CLOSE); setSize(640,480); setVisible(true); setResizable(true); getContentPane().add(this.mainPanel); //MainPanel this.mainPanel.errorLabel.setVisible(false); ...
2f6b999e-44e6-435e-a802-2947b1355143
public final void setupDates(){ DateFormat dateFormat = new SimpleDateFormat("yyyy"); Date date = new Date(); int cYear = Integer.parseInt(dateFormat.format(date)); ArrayList years = new ArrayList(); for(int i=cYear-5; i<=cYear+5; i++){ this.dateFrame.yearBox.addItem...
ffc1d383-ba55-4cdc-97d7-14b5cacb1b64
public void actionPerformed(ActionEvent e) { // Whenever anything happens clear the error this.mainPanel.errorLabel.setVisible(false); //MainPanel if(e.getSource() == mainPanel.fiveButton){ this.printAddClear("$5"); } if(e.getSource() == mainPanel.tenButton){...
f85e32d9-416d-4acf-9dfc-5a4fb4de0486
public void printReceipt(String s){ try{ for(int i=1; i<=this.mainPanel.getNum(); i++){ this.receiptPrinter.print(s); } } catch(Exception ex){ this.mainPanel.errorLabel.setVisible(true); } }
5eb77df6-477c-4194-bf48-6250e3c76076
public void printZ(){ try{ this.zPrinter.print( this.cons.mysql.getAdmissions(), this.cons.mysql.lastZ()); this.cons.mysql.resetZ(); } catch(Exception ex){ new ClubException("Error Selecting from Database", e...
ef04e830-6b7e-4ab5-a0a9-95a5672eb550
public void printDate(){ try{ this.datePrinter.print( this.cons.mysql.getRangeAdmissions( this.dateFrame.getFrom(), this.dateFrame.getTo()), this.dateFrame.getFromTo()); } catch(Exception ex){ ...
620ad992-4f7e-44a4-8783-68acb291fd97
public void addToDatabase(String s){ try{ for(int i=1; i<=this.mainPanel.getNum(); i++){ this.cons.mysql.update("INSERT INTO tbl_admissions " + "(type, month, day, year, z, date) VALUES " + "('" + s // the given type ...
1eb3b8d7-e947-43a3-9220-148c0116614b
public void printAddClear(String s){ this.printReceipt(s); this.addToDatabase(s); this.mainPanel.clear(); }
eda02ca9-4fc4-4aa4-9cbd-69353a725fa7
public ReportsPanel() { initComponents(); }
d71faa5b-d955-4169-8312-7244ec97cb1d
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { backButton = new javax.swing.JButton(); zButton = new javax.swing.JButton(); dateButton = new javax.swing.JButton(); setBackg...
fcfffda0-5910-4368-ab32-8307b7348f5e
public PassFrame() { initComponents(); }
93d30065-0bba-492b-abb2-ec5f60b8a1f1
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { one = new javax.swing.JButton(); five = new javax.swing.JButton(); cancelButton = new javax.swing.JButton(); eight = new javax...
ab6ab5ef-fb29-47ce-9dde-d679f835ef39
public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new PassFrame().setVisible(true); } }); }
c3f2dd1a-66e2-4899-982f-76841bbb90b7
public void run() { new PassFrame().setVisible(true); }
4b9d1e4f-a348-45c6-a650-66c341c4cb44
public void clear(){ this.passField.setText(""); }
6836f0fe-74fe-4e47-84d0-026aa72bf723
public boolean checkPass(){ return this.get().equals("8008"); //CURRENT PASSWORD }
d59eb5aa-58b2-4320-8664-ab97ecaa9626
public void add(int i){ this.passField.setText(this.get() + Integer.toString(i)); }
50d41c22-8ae0-4ee9-8e3c-b10641dc08ef
public String get(){ return new String(this.passField.getPassword()); }
02aff542-a056-465f-a9ee-2eeb77032b23
public int print(Graphics g, PageFormat pf, int page) throws PrinterException { Graphics2D g2d = (Graphics2D)g; g2d.translate(pf.getImageableX(), pf.getImageableY()); // Draw in the x boundaries of 10 and 190 // Draw in the y boundaries of 10 and 990 g2d.setFont(ne...
0a4cf37e-d251-4399-87dd-3e607b546312
public void print(int[] adm, String fromTo){ this.fromTo = fromTo; this.five = adm[0]; this.ten = adm[1]; this.twenty = adm[2]; this.game = adm[3]; this.mgr = adm[4]; this.comp = adm[5]; this.door = adm[6]; this.hotel = adm[7]; PrinterJob...
81494269-a368-4c61-8062-c887bf56b772
public int getNumberOfPages() { throw new UnsupportedOperationException("Not supported yet."); }
004e0022-e288-4b6b-b6eb-ecd2bd8ab71d
public PageFormat getPageFormat(int pageIndex) throws IndexOutOfBoundsException { throw new UnsupportedOperationException("Not supported yet."); }
0e421665-5109-4703-b1b8-1c5705ea41cb
public Printable getPrintable(int pageIndex) throws IndexOutOfBoundsException { throw new UnsupportedOperationException("Not supported yet."); }
add258a5-a9d6-44a3-9c5a-19fbf3de9eb3
public int calcTotal(){ int total = 0; for(int i=1; i<=this.five; i++){ total+=5; } for(int i=1; i<=this.ten; i++){ total+=10; } for(int i=1; i<=this.twenty; i++){ total+=20; } return total; }
4ba0ffd3-3c64-4d31-8021-794d150eb794
public int calcAdmissions(){ return this.five + this.ten + this.twenty + this.game + this.mgr + this.comp + this.door + this.hotel; }
fc562ff7-143c-40b9-8562-98487a550cb9
private String getDate() { DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy"); Date date = new Date(); return dateFormat.format(date); }
5cc9ca2d-f8c5-4910-bde5-cdf7fa6bfc00
private String geTime() { DateFormat dateFormat = new SimpleDateFormat("hh:mm:ss a"); Date date = new Date(); return dateFormat.format(date); }
dcb66254-b250-41b7-95d5-9acb86b1356d
public Constants(){}
cd0645c4-ed5e-45ca-aede-19f5fadea033
public String getIP(){ return this.algos.getIP(this.startupURL); }
587f0129-419e-4097-ab43-e292221eb195
public int print(Graphics g, PageFormat pf, int page) throws PrinterException { Graphics2D g2d = (Graphics2D)g; g2d.translate(pf.getImageableX(), pf.getImageableY()); // Draw in the x boundaries of 10 and 190 // Draw in the y boundaries of 10 and 990 g2d.setFont(ne...
a544df38-7dac-40ba-b037-a9079258c8e0
public void print(int[] adm, String time){ this.time = time; this.five = adm[0]; this.ten = adm[1]; this.twenty = adm[2]; this.game = adm[3]; this.mgr = adm[4]; this.comp = adm[5]; this.door = adm[6]; this.hotel = adm[7]; PrinterJob job =...
ff5eeeea-6503-4e99-b4c5-628eb532ca2b
public int getNumberOfPages() { throw new UnsupportedOperationException("Not supported yet."); }
c5e4e087-2d83-4ad6-b6ba-7b2f604bc15f
public PageFormat getPageFormat(int pageIndex) throws IndexOutOfBoundsException { throw new UnsupportedOperationException("Not supported yet."); }
49875111-b3bb-4f78-8561-4ebf954fad95
public Printable getPrintable(int pageIndex) throws IndexOutOfBoundsException { throw new UnsupportedOperationException("Not supported yet."); }
ad886281-d6e3-4147-94f8-fa2616ae43b5
public int calcTotal(){ int total = 0; for(int i=1; i<=this.five; i++){ total+=5; } for(int i=1; i<=this.ten; i++){ total+=10; } for(int i=1; i<=this.twenty; i++){ total+=20; } return total; }
ca7c072a-c341-444d-b032-66267ca55c36
public int calcAdmissions(){ return this.five + this.ten + this.twenty + this.game + this.mgr + this.comp + this.door + this.hotel; }
f748f61c-0457-4c51-bf9b-3983d76df045
private String getDate() { DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy"); Date date = new Date(); return dateFormat.format(date); }
d9e9f5b3-0848-4f92-89c8-1fe2cf554ec0
private String geTime() { DateFormat dateFormat = new SimpleDateFormat("hh:mm:ss a"); Date date = new Date(); return dateFormat.format(date); }
a8cb9ed6-ed77-4161-8992-7bb7b100af7e
public DateFrame() { initComponents(); }
cb726458-0189-4456-9541-885648de2a24
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { monthBox = new javax.swing.JComboBox(); dayBox = new javax.swing.JComboBox(); yearBox = new javax.swing.JComboBox(); submitBut...
7a0fc3a4-7aa7-43fa-8c53-7016452e2ff0
public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new DateFrame().setVisible(true); } }); }
e2dc4ca5-7890-425b-bdcb-1645a07dacc8
public void run() { new DateFrame().setVisible(true); }
fe749603-a803-4629-8545-9025a1d957a6
public void reset(){ this.monthBox.setSelectedIndex(0); this.dayBox.setSelectedIndex(0); this.yearBox.setSelectedIndex(5); this.monthBoxTo.setSelectedIndex(0); this.dayBoxTo.setSelectedIndex(0); this.yearBoxTo.setSelectedIndex(5); }
58bdc3f3-99f2-4e8b-b1b4-36d83a2c772c
public String getFromTo(){ String fMonth = Integer.toString(this.monthBox.getSelectedIndex() + 1); String fDay = this.dayBox.getSelectedItem().toString(); String fYear = this.yearBox.getSelectedItem().toString(); String tMonth = Integer.toString(this.mont...
5e916070-5bc6-4812-a88a-b3ee44fe66df
public int[] getFrom(){ int month = this.monthBox.getSelectedIndex() + 1; int day = Integer.parseInt(this.dayBox.getSelectedItem().toString()); int year = Integer.parseInt(this.yearBox.getSelectedItem().toString()); return new int[]{month, day, year}; ...
c0ca33c0-fc5b-47bb-860f-4fbc5864334c
public int[] getTo(){ int month = this.monthBoxTo.getSelectedIndex() + 1; int day = Integer.parseInt(this.dayBoxTo.getSelectedItem().toString()); int year = Integer.parseInt(this.yearBoxTo.getSelectedItem().toString()); return new int[]{month, day, year};...
192cfa4b-66f5-4d8b-95f9-8f8bc2c9bd1d
Algorithms(){}
245f8838-9a58-43a5-8434-ebfba5d3845e
public boolean isIP(String s){ // Make an ArrayList splitting the string up based off of . and : ArrayList<String> alist = new ArrayList<String>(Arrays.asList(s.split("[.:]+"))); if(alist.size() != 5){ // If the string wasn't a long enough IP return false; } ...
cc15d384-b07e-44c1-a638-59b79b30e7a2
public String getIP(String s){ String ip = ""; try{ File file = new File(s); BufferedReader reader = new BufferedReader(new FileReader(file)); ip = reader.readLine(); // Only one line } catch(Exception ex){ new ClubException("Error Reading IP", ex....
d55b2d43-d34d-4d0a-bfe4-d1edaeab26b2
public MainPanel() { initComponents(); }
475c84e6-fe74-4f6b-9f6b-3ce9a1eafe61
@SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents private void initComponents() { fiveButton = new javax.swing.JButton(); tenButton = new javax.swing.JButton(); twentyButton = new javax.swing.JButton(); gameB...
fd01775e-a780-401b-a2f8-0dabfc1d736e
public void clear(){ this.numField.setText(""); }
74e9d1bf-2673-41c7-86a4-9cac2dd3cc9f
public void add(int i){ this.numField.setText(this.get() + Integer.toString(i)); }
81f11a85-e42f-4099-82ba-d0f4281abe33
public String get(){ return this.numField.getText(); }
cff26d8a-d516-4ab0-8b2f-1f4a9ece6b51
public int getNum() throws Exception{ if(this.get().equals("")){return 1;} int i = Integer.parseInt(this.get()); if(i>20){ throw new Exception(); }else{ return i; } }
49a31316-923a-482f-b3f9-36fa0cff3dc2
public int print(Graphics g, PageFormat pf, int page) throws PrinterException { Graphics2D g2d = (Graphics2D)g; g2d.translate(pf.getImageableX(), pf.getImageableY()); // Draw in the x boundaries of 10 and 190 // Draw in the y boundaries of 10 and 990 g2d.setFont(ne...
6fd06137-974a-40df-9b40-ce41bf5e4e5e
public void print(String s){ this.type = s; PrinterJob job = PrinterJob.getPrinterJob(); PageFormat pf = new PageFormat(); Paper paper = new Paper(); paper.setImageableArea(0, 0, 200, 1000); pf.setPaper(paper); Book book = new Book(); book.append(this, ...
887aaa1d-d0c1-407c-8c42-994dac500902
public int getNumberOfPages() { throw new UnsupportedOperationException("Not supported yet."); }
34fbb39a-a2b3-4dd1-bd50-cd6f1528c760
public PageFormat getPageFormat(int pageIndex) throws IndexOutOfBoundsException { throw new UnsupportedOperationException("Not supported yet."); }
ff4f8ee5-3bfe-4cc2-828c-09f9a2f6b0a9
public Printable getPrintable(int pageIndex) throws IndexOutOfBoundsException { throw new UnsupportedOperationException("Not supported yet."); }
0d620e9d-2254-4271-b86b-c0d1afd33e80
private String getDate() { DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy"); Date date = new Date(); return dateFormat.format(date); }
0a579bff-5c48-4443-9901-e4327da6f70a
private String geTime() { DateFormat dateFormat = new SimpleDateFormat("hh:mm:ss a"); Date date = new Date(); return dateFormat.format(date); }
a93caf7b-d33c-4f92-9d79-f0af65720e8d
Startup(){ if (Desktop.isDesktopSupported()) { this.desktop = Desktop.getDesktop(); } this.verifyFile(); // If the file is there, start connecting to the server this.connect(); }
44dfd5b7-cc6b-4661-956d-e978ae91b752
private void verifyFile(){ if(this.file.exists()){ // Move forwards... }else{ // Tell the error and ask to setup the file this.setup(); } }
2432aa00-c0c6-41cc-92cf-295d64b04e05
public void setup(){ Object[] options = {"Browse", "Build"}; int i = JOptionPane.showOptionDialog(null, "There has been an error locating the startup file." + "\nPlease select below either 'Browse' to navigate to" + " the correct file" + "...
b0d80b19-ac4a-44a7-ae1b-63cdbaac7a46
public void browse(){ JFileChooser fc = new JFileChooser(); fc.showOpenDialog(null); File browse = fc.getSelectedFile(); try{ FileReader in = new FileReader(browse); FileWriter out = new FileWriter(this.file); int c; while((c=in.read()) ...
aca82cc7-e633-4a9b-8575-6d51eec48371
public void rebuild(){ try{ String s = JOptionPane.showInputDialog(null, "What is the MySQL database IP address?" + "\nDefault: 127.0.0.1:3306", "IP Address", JOptionPane.QUESTION_MESSAGE); if(this.cons.algos...
b64e7587-3a93-4028-aafc-603e420c4bfb
public void makeFile(String s){ Writer output; File outputFile = new File(this.cons.startupURL); try{ output = new BufferedWriter(new FileWriter(outputFile)); output.write(s); output.close(); JOptionPane.showMessageDialog(null, ...
2e3474b3-4c20-4dd6-8ca1-dfd7d2d31e1f
private void connect(){ try{ Class.forName("com.mysql.jdbc.Driver").newInstance(); Connection con = DriverManager.getConnection( "jdbc:mysql://"+this.cons.getIP()+"/clubdoors", "club_user","club_password"); } catch(Exception ex){ ...
4edcb522-d493-41c9-ae6c-1880d20a90ee
public ClubException(){ this.type = ""; this.msg = ""; this.checkResponse(this.giveMessage()); }
3a70e77b-71ed-4ade-b2e6-18a2158f6b16
public ClubException(String type, String msg){ this.type = type; this.msg = msg; this.checkResponse(this.giveMessage()); }
244cac68-68d6-459f-943e-09e627b17aaa
public int giveMessage(){ JFrame frame = new JFrame(); Object[] options = {"Ok"}; return JOptionPane.showOptionDialog(null, "Error Message:\n"+this.msg, type, JOptionPane.DEFAULT_OPTION, JOptionPane.ERROR_MESSAGE, null, options, options[0]); }
4e96197d-2a71-4705-9096-729d6eaba0ad
public void checkResponse(int i){ switch(i){ case 0: break; // Moves on... case -1: // If the close button is pressed System.exit(0); break; default: // Should never really happen - defensive pro...
e778a8b3-c625-46a7-8d51-c16c1f26139c
@Test public void testCreateUndoManager() throws Exception { UndoManagerFactory undoManagerFactory = new UndoManagerFactoryImpl(); undoManagerFactory.createUndoManager(new DocumentImpl(), 1); }
8f20ae05-9c2a-4f56-a9fb-7cae25e5aa4a
@Test(expected = IllegalArgumentException.class) public void testCreateUndoManagerNullDocument() throws Exception { UndoManagerFactory undoManagerFactory = new UndoManagerFactoryImpl(); undoManagerFactory.createUndoManager(null, 1); }
b8b39978-b539-4a0f-ae34-2575a6a4d7ac
@Test(expected = IllegalArgumentException.class) public void testCreateUndoManagerZeroBuffer() throws Exception { UndoManagerFactory undoManagerFactory = new UndoManagerFactoryImpl(); undoManagerFactory.createUndoManager(new DocumentImpl(), 0); }
659b6fbc-493f-4c72-8e8f-603f5df75ed2
@Test public void testDocumentChange() throws Exception { UndoManagerFactory undoManagerFactory = new UndoManagerFactoryImpl(); ChangeFactory changeFactory = new ChangeFactoryImpl(); Document document = new DocumentImpl(); UndoManager undoManager = undoManagerFactory.createUndoManage...
263788b4-cd77-441d-ad83-90cb5c989412
public void delete(int pos, String s);
2d594767-dbe6-432d-b541-759ac554e261
public void insert(int pos, String s);
47bf9363-ac36-4d0b-b7ff-5bd4bd2df35a
public void setDot(int pos);
677c942c-7eb1-496f-8e4c-c05ef08413d5
private ChangeType(final String changeType) { type = changeType; }
e2b82102-80bc-4727-a63d-3f2ac9d3383a
public String getType() { return type; }
f80b758d-45cb-415b-929f-3c7853ba2ac3
public void registerChange(Change change);
b5842f95-04c2-4189-a87f-c973a79a0d1c
public boolean canUndo();
d75b88c7-025b-4efa-89c9-27d3e98ef00e
public void undo();
f5842755-7ae2-422b-805d-68c71343bc3c
public boolean canRedo();
81a8365c-17b2-4f7c-8056-0d83f68aeb6d
public void redo();
207bdbad-f01f-4b4e-b158-96503cae2696
public Change createDeletion(int pos, String s, int oldDot, int newDot);
ade43d6e-5ec7-4517-b391-c595043dc55d
public Change createInsertion(int pos, String s, int oldDot, int newDot);
f7be6d84-8270-46a7-ae60-157c185090b2
public String getType();
541d19b1-22ce-4952-80f3-839110f2f366
public void apply(Document doc);
8b13bd70-767f-4f60-a825-1cca9f8e4d4f
public void revert(Document doc);
5e1db082-2fc1-4e7f-b5a5-d341bda0b883
public UndoManager createUndoManager(Document doc, int bufferSize);
7c632e7a-6b27-4a88-8a9a-2817e763c291
@Override public void delete(final int pos, final String s) { System.out.println("Deleting in document: " + s); }
e623b6e0-76c2-48b0-988d-1110df312ea0
@Override public void insert(final int pos, final String s) { System.out.println("Inserting in document: " + s); }
122d8a4b-7dfc-41b4-9810-ba1cba6b3e74
@Override public void setDot(final int pos) { System.out.println("Setting dot at: " + pos); }