Created
December 2, 2014 22:51
-
-
Save NicklasAndersson/f3e8ec7e03b674c1631a to your computer and use it in GitHub Desktop.
DSVMaraton 0.0.1
This file contains hidden or 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
| DSVMaraton |
This file contains hidden or 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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <project version="4"> | |
| <component name="CompilerConfiguration"> | |
| <option name="DEFAULT_COMPILER" value="Javac" /> | |
| <resourceExtensions /> | |
| <wildcardResourcePatterns> | |
| <entry name="!?*.java" /> | |
| <entry name="!?*.form" /> | |
| <entry name="!?*.class" /> | |
| <entry name="!?*.groovy" /> | |
| <entry name="!?*.scala" /> | |
| <entry name="!?*.flex" /> | |
| <entry name="!?*.kt" /> | |
| <entry name="!?*.clj" /> | |
| </wildcardResourcePatterns> | |
| <annotationProcessing> | |
| <profile default="true" name="Default" enabled="false"> | |
| <processorPath useClasspath="true" /> | |
| </profile> | |
| </annotationProcessing> | |
| </component> | |
| </project> |
This file contains hidden or 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
| <component name="CopyrightManager"> | |
| <settings default="" /> | |
| </component> |
This file contains hidden or 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
| <component name="ProjectDictionaryState"> | |
| <dictionary name="Nicklas" /> | |
| </component> |
This file contains hidden or 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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <project version="4"> | |
| <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" /> | |
| </project> |
This file contains hidden or 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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <project version="4"> | |
| <component name="ClientPropertiesManager"> | |
| <properties class="javax.swing.AbstractButton"> | |
| <property name="hideActionText" class="java.lang.Boolean" /> | |
| </properties> | |
| <properties class="javax.swing.JComponent"> | |
| <property name="html.disable" class="java.lang.Boolean" /> | |
| </properties> | |
| <properties class="javax.swing.JEditorPane"> | |
| <property name="JEditorPane.w3cLengthUnits" class="java.lang.Boolean" /> | |
| <property name="JEditorPane.honorDisplayProperties" class="java.lang.Boolean" /> | |
| <property name="charset" class="java.lang.String" /> | |
| </properties> | |
| <properties class="javax.swing.JList"> | |
| <property name="List.isFileList" class="java.lang.Boolean" /> | |
| </properties> | |
| <properties class="javax.swing.JPasswordField"> | |
| <property name="JPasswordField.cutCopyAllowed" class="java.lang.Boolean" /> | |
| </properties> | |
| <properties class="javax.swing.JSlider"> | |
| <property name="Slider.paintThumbArrowShape" class="java.lang.Boolean" /> | |
| <property name="JSlider.isFilled" class="java.lang.Boolean" /> | |
| </properties> | |
| <properties class="javax.swing.JTable"> | |
| <property name="Table.isFileList" class="java.lang.Boolean" /> | |
| <property name="JTable.autoStartsEdit" class="java.lang.Boolean" /> | |
| <property name="terminateEditOnFocusLost" class="java.lang.Boolean" /> | |
| </properties> | |
| <properties class="javax.swing.JToolBar"> | |
| <property name="JToolBar.isRollover" class="java.lang.Boolean" /> | |
| </properties> | |
| <properties class="javax.swing.JTree"> | |
| <property name="JTree.lineStyle" class="java.lang.String" /> | |
| </properties> | |
| <properties class="javax.swing.text.JTextComponent"> | |
| <property name="caretAspectRatio" class="java.lang.Double" /> | |
| <property name="caretWidth" class="java.lang.Integer" /> | |
| </properties> | |
| </component> | |
| <component name="CompilerConfiguration"> | |
| <option name="DEFAULT_COMPILER" /> | |
| <resourceExtensions /> | |
| <wildcardResourcePatterns> | |
| <entry name="!?*.java" /> | |
| <entry name="!?*.form" /> | |
| <entry name="!?*.class" /> | |
| <entry name="!?*.groovy" /> | |
| <entry name="!?*.scala" /> | |
| <entry name="!?*.flex" /> | |
| <entry name="!?*.kt" /> | |
| <entry name="!?*.clj" /> | |
| </wildcardResourcePatterns> | |
| <annotationProcessing> | |
| <profile default="true" name="Default" enabled="false"> | |
| <processorPath useClasspath="true" /> | |
| </profile> | |
| </annotationProcessing> | |
| </component> | |
| <component name="CopyrightManager" default="" /> | |
| <component name="DaemonCodeAnalyzer"> | |
| <disable_hints /> | |
| </component> | |
| <component name="DependencyValidationManager"> | |
| <option name="SKIP_IMPORT_STATEMENTS" value="false" /> | |
| </component> | |
| <component name="Encoding" useUTFGuessing="true" native2AsciiForPropertiesFiles="false" /> | |
| <component name="EntryPointsManager"> | |
| <entry_points version="2.0" /> | |
| </component> | |
| <component name="ProjectLevelVcsManager" settingsEditedManually="true"> | |
| <OptionsSetting value="true" id="Add" /> | |
| <OptionsSetting value="true" id="Remove" /> | |
| <OptionsSetting value="true" id="Checkout" /> | |
| <OptionsSetting value="true" id="Update" /> | |
| <OptionsSetting value="true" id="Status" /> | |
| <OptionsSetting value="true" id="Edit" /> | |
| <ConfirmationsSetting value="0" id="Add" /> | |
| <ConfirmationsSetting value="0" id="Remove" /> | |
| </component> | |
| <component name="ProjectModuleManager"> | |
| <modules /> | |
| </component> | |
| <component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="1.7" project-jdk-type="JavaSDK"> | |
| <output url="file://$PROJECT_DIR$/out" /> | |
| </component> | |
| <component name="PropertiesComponent"> | |
| <property name="GoToClass.includeLibraries" value="false" /> | |
| <property name="GoToClass.toSaveIncludeLibraries" value="false" /> | |
| <property name="GoToFile.includeJavaFiles" value="false" /> | |
| <property name="MemberChooser.sorted" value="false" /> | |
| <property name="MemberChooser.showClasses" value="true" /> | |
| <property name="MemberChooser.copyJavadoc" value="false" /> | |
| <property name="options.lastSelected" value="reference.idesettings.quicklists" /> | |
| <property name="options.splitter.main.proportions" value="0.3" /> | |
| <property name="options.splitter.details.proportions" value="0.2" /> | |
| </component> | |
| <component name="RunManager"> | |
| <configuration default="true" type="JUnit" factoryName="JUnit"> | |
| <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" /> | |
| <module name="" /> | |
| <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" /> | |
| <option name="ALTERNATIVE_JRE_PATH" /> | |
| <option name="PACKAGE_NAME" /> | |
| <option name="MAIN_CLASS_NAME" /> | |
| <option name="METHOD_NAME" /> | |
| <option name="TEST_OBJECT" value="class" /> | |
| <option name="VM_PARAMETERS" value="-ea" /> | |
| <option name="PARAMETERS" /> | |
| <option name="WORKING_DIRECTORY" value="$MODULE_DIR$" /> | |
| <option name="ENV_VARIABLES" /> | |
| <option name="PASS_PARENT_ENVS" value="true" /> | |
| <option name="TEST_SEARCH_SCOPE"> | |
| <value defaultName="singleModule" /> | |
| </option> | |
| <envs /> | |
| <patterns /> | |
| <method /> | |
| </configuration> | |
| <configuration default="true" type="Remote" factoryName="Remote"> | |
| <option name="USE_SOCKET_TRANSPORT" value="true" /> | |
| <option name="SERVER_MODE" value="false" /> | |
| <option name="SHMEM_ADDRESS" value="javadebug" /> | |
| <option name="HOST" value="localhost" /> | |
| <option name="PORT" value="5005" /> | |
| <method /> | |
| </configuration> | |
| <configuration default="true" type="#org.jetbrains.idea.devkit.run.PluginConfigurationType" factoryName="Plugin"> | |
| <module name="" /> | |
| <option name="VM_PARAMETERS" value="-Xmx512m -Xms256m -XX:MaxPermSize=250m -ea" /> | |
| <option name="PROGRAM_PARAMETERS" /> | |
| <method /> | |
| </configuration> | |
| <configuration default="true" type="Applet" factoryName="Applet"> | |
| <module name="" /> | |
| <option name="MAIN_CLASS_NAME" /> | |
| <option name="HTML_FILE_NAME" /> | |
| <option name="HTML_USED" value="false" /> | |
| <option name="WIDTH" value="400" /> | |
| <option name="HEIGHT" value="300" /> | |
| <option name="POLICY_FILE" value="$APPLICATION_HOME_DIR$/bin/appletviewer.policy" /> | |
| <option name="VM_PARAMETERS" /> | |
| <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" /> | |
| <option name="ALTERNATIVE_JRE_PATH" /> | |
| <method /> | |
| </configuration> | |
| <configuration default="true" type="Application" factoryName="Application"> | |
| <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" /> | |
| <option name="MAIN_CLASS_NAME" /> | |
| <option name="VM_PARAMETERS" /> | |
| <option name="PROGRAM_PARAMETERS" /> | |
| <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" /> | |
| <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" /> | |
| <option name="ALTERNATIVE_JRE_PATH" /> | |
| <option name="ENABLE_SWING_INSPECTOR" value="false" /> | |
| <option name="ENV_VARIABLES" /> | |
| <option name="PASS_PARENT_ENVS" value="true" /> | |
| <module name="" /> | |
| <envs /> | |
| <method /> | |
| </configuration> | |
| <configuration default="true" type="TestNG" factoryName="TestNG"> | |
| <extension name="coverage" enabled="false" merge="false" sample_coverage="true" runner="idea" /> | |
| <module name="" /> | |
| <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" /> | |
| <option name="ALTERNATIVE_JRE_PATH" /> | |
| <option name="SUITE_NAME" /> | |
| <option name="PACKAGE_NAME" /> | |
| <option name="MAIN_CLASS_NAME" /> | |
| <option name="METHOD_NAME" /> | |
| <option name="GROUP_NAME" /> | |
| <option name="TEST_OBJECT" value="CLASS" /> | |
| <option name="VM_PARAMETERS" value="-ea" /> | |
| <option name="PARAMETERS" /> | |
| <option name="WORKING_DIRECTORY" value="$PROJECT_DIR$" /> | |
| <option name="OUTPUT_DIRECTORY" /> | |
| <option name="ANNOTATION_TYPE" /> | |
| <option name="ENV_VARIABLES" /> | |
| <option name="PASS_PARENT_ENVS" value="true" /> | |
| <option name="TEST_SEARCH_SCOPE"> | |
| <value defaultName="singleModule" /> | |
| </option> | |
| <option name="USE_DEFAULT_REPORTERS" value="false" /> | |
| <option name="PROPERTIES_FILE" /> | |
| <envs /> | |
| <properties /> | |
| <listeners /> | |
| <method /> | |
| </configuration> | |
| <list size="0" /> | |
| </component> | |
| <component name="SvnConfiguration"> | |
| <configuration>C:\Users\Nicklas Andersson\AppData\Roaming\Subversion</configuration> | |
| </component> | |
| <component name="VcsContentAnnotationSettings"> | |
| <option name="myLimit" value="2678400000" /> | |
| </component> | |
| <component name="VcsManagerConfiguration"> | |
| <option name="myTodoPanelSettings"> | |
| <TodoPanelSettings /> | |
| </option> | |
| <option name="MAXIMUM_HISTORY_ROWS" value="10000" /> | |
| </component> | |
| <component name="masterDetails"> | |
| <states> | |
| <state key="ScopeChooserConfigurable.UI"> | |
| <settings> | |
| <splitter-proportions> | |
| <option name="proportions"> | |
| <list> | |
| <option value="0.2" /> | |
| </list> | |
| </option> | |
| </splitter-proportions> | |
| </settings> | |
| </state> | |
| </states> | |
| </component> | |
| </project> |
This file contains hidden or 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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <project version="4"> | |
| <component name="ProjectModuleManager"> | |
| <modules> | |
| <module fileurl="file://$PROJECT_DIR$/DSVMaraton.iml" filepath="$PROJECT_DIR$/DSVMaraton.iml" /> | |
| </modules> | |
| </component> | |
| </project> |
This file contains hidden or 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
| <component name="DependencyValidationManager"> | |
| <state> | |
| <option name="SKIP_IMPORT_STATEMENTS" value="false" /> | |
| </state> | |
| </component> |
This file contains hidden or 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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <project version="4"> | |
| <component name="VcsDirectoryMappings"> | |
| <mapping directory="" vcs="" /> | |
| </component> | |
| </project> |
This file contains hidden or 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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <module type="JAVA_MODULE" version="4"> | |
| <component name="NewModuleRootManager" inherit-compiler-output="true"> | |
| <exclude-output /> | |
| <content url="file://$MODULE_DIR$"> | |
| <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> | |
| </content> | |
| <orderEntry type="inheritedJdk" /> | |
| <orderEntry type="sourceFolder" forTests="false" /> | |
| </component> | |
| </module> |
This file contains hidden or 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
| import javax.swing.*; | |
| import java.awt.*; | |
| import java.awt.event.ActionEvent; | |
| import java.awt.event.ActionListener; | |
| import static javax.swing.BoxLayout.Y_AXIS; | |
| /** | |
| * Created by Nicklas on 2014-12-02. | |
| */ | |
| public class DSVMaraton extends JFrame { | |
| DSVMaraton(){ | |
| super("DSVMaraton 0.0.1"); | |
| setLayout(new BorderLayout()); | |
| //Header | |
| JPanel head = new JPanel(); | |
| add(head, BorderLayout.NORTH); | |
| JLabel title = new JLabel("DSV Kista Maraton"); | |
| head.add(title); | |
| //List area | |
| JPanel area = new JPanel(); | |
| add(new JScrollPane(area), BorderLayout.CENTER); | |
| JTextArea TArea = new JTextArea(15,25); | |
| area.add(TArea); | |
| //Footer | |
| JPanel footer = new JPanel(); | |
| footer.setLayout(new BoxLayout(footer, BoxLayout.X_AXIS)); | |
| add(footer, BorderLayout.SOUTH); | |
| JButton newRunner = new JButton("Ny"); | |
| newRunner.addActionListener(new NewRunnerList()); | |
| footer.add(newRunner); | |
| JButton show = new JButton("Visa"); | |
| show.addActionListener(new ShowList()); | |
| footer.add(show); | |
| JButton showTime = new JButton("Tid"); | |
| showTime.addActionListener(new ShowTimeList()); | |
| footer.add(showTime); | |
| //Sidepanel right | |
| JPanel right = new JPanel(); | |
| right.setLayout(new BoxLayout(right, Y_AXIS)); | |
| add(right, BorderLayout.EAST); | |
| JLabel sort = new JLabel("Sortering"); | |
| right.add(sort); | |
| JRadioButton startNr = new JRadioButton("StartNr"); | |
| JRadioButton name = new JRadioButton("Namn"); | |
| JRadioButton age = new JRadioButton("Ålder"); | |
| JRadioButton time = new JRadioButton("Tid"); | |
| right.add(startNr); | |
| right.add(name); | |
| right.add(age); | |
| right.add(time); | |
| //initiate window | |
| pack(); | |
| setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); | |
| setLocationRelativeTo(null); | |
| setVisible(true); | |
| setSize(400, 300); | |
| } | |
| class Form extends JPanel{ | |
| JTextField one = new JTextField(10); | |
| JTextField two = new JTextField(5); | |
| public Form(String oneS, String twoS){ | |
| setLayout(new BoxLayout(this,BoxLayout.Y_AXIS)); | |
| JPanel row1 = new JPanel(); | |
| row1.add(new JLabel(oneS)); | |
| row1.add(one); | |
| add(row1); | |
| JPanel row2 = new JPanel(); | |
| row2.add(new JLabel(twoS)); | |
| row2.add(two); | |
| add(row2); | |
| JPanel row3 = new JPanel(); | |
| add(row3); | |
| row3.add(new JLabel("Spara?")); | |
| } | |
| public Form(String oneS){ | |
| setLayout(new BoxLayout(this,BoxLayout.Y_AXIS)); | |
| JPanel row1 = new JPanel(); | |
| row1.add(new JLabel(oneS)); | |
| row1.add(one); | |
| add(row1); | |
| JPanel row3 = new JPanel(); | |
| add(row3); | |
| row3.add(new JLabel("Spara?")); | |
| } | |
| public String getOne(){ | |
| return one.getText(); | |
| } | |
| public String getTwo(){ | |
| return two.getText(); | |
| } | |
| } | |
| class NewRunnerList implements ActionListener{ | |
| @Override | |
| public void actionPerformed(ActionEvent e) { | |
| try{ | |
| Form form = new Form("Namn: ", "Ålder: "); | |
| int r = JOptionPane.showConfirmDialog(DSVMaraton.this ,form, "Ny Löpare", JOptionPane.YES_OPTION); | |
| if (r != JOptionPane.OK_OPTION) | |
| return; | |
| String name = form.getOne(); | |
| String age = form.getTwo(); | |
| //TODO Save runner | |
| }catch(NumberFormatException nfe){ | |
| JOptionPane.showMessageDialog(DSVMaraton.this,"Fel Inmatning"); | |
| } | |
| } | |
| } | |
| class ShowList implements ActionListener{ | |
| @Override | |
| public void actionPerformed(ActionEvent e) { | |
| //TODO Show runners according to sort | |
| System.out.println("ShowList"); | |
| } | |
| } | |
| class ShowTimeList implements ActionListener{ | |
| @Override | |
| public void actionPerformed(ActionEvent e) { | |
| try{ | |
| Form form = new Form("StartNr: ", "Tid: "); | |
| int r = JOptionPane.showConfirmDialog(DSVMaraton.this ,form, "Ny Tid", JOptionPane.YES_OPTION); | |
| if (r != JOptionPane.OK_OPTION) | |
| return; | |
| String StartNr = form.getOne(); | |
| String Tid = form.getTwo(); | |
| //TODO Save time | |
| }catch(NumberFormatException nfe){ | |
| JOptionPane.showMessageDialog(DSVMaraton.this,"Fel Inmatning"); | |
| } | |
| } | |
| } | |
| public static void main(String[] args){ | |
| new DSVMaraton(); | |
| } | |
| } |
This file contains hidden or 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
| /** | |
| * Created by Nicklas on 2014-12-02. | |
| */ | |
| public class Runner { | |
| private int StartNr; | |
| private String Name; | |
| private double age; | |
| private Double finishTime; | |
| Runner(String StartNr, String Name, String age){ | |
| this.StartNr = Integer.parseInt(StartNr); | |
| this.Name = Name; | |
| this.age = Double.parseDouble(age); | |
| } | |
| public void setFinishTime(String finishTime) { | |
| this.finishTime = Double.parseDouble(finishTime); | |
| } | |
| @Override | |
| public String toString() { | |
| return this.StartNr + " " + this.Name + " " + this.age + " " + this.finishTime; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment