-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #177 from Idrinth/adding-progress-bar
- Loading branch information
Showing
20 changed files
with
618 additions
and
102 deletions.
There are no files selected for viewing
Submodule arch-pkgbuild
updated
5 files
+7 −4 | .SRCINFO | |
+8 −4 | PKGBUILD | |
+11 −10 | README.md | |
+9 −0 | permissions.install | |
+4 −38 | waraddonclient |
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,52 @@ | ||
package de.idrinth.waraddonclient.cli; | ||
|
||
import de.idrinth.waraddonclient.service.ProgressReporter; | ||
|
||
public class Progress implements ProgressReporter { | ||
|
||
private int current=0; | ||
|
||
private int max=0; | ||
|
||
private Runnable callback; | ||
|
||
private boolean stopped; | ||
|
||
private void finish() | ||
{ | ||
max = 0; | ||
current = 0; | ||
stopped = false; | ||
callback.run(); | ||
} | ||
|
||
@Override | ||
public synchronized void incrementCurrent() { | ||
current++; | ||
if (current == max && stopped) { | ||
finish(); | ||
} | ||
} | ||
|
||
@Override | ||
public synchronized void incrementMax(int amount) { | ||
max += amount; | ||
} | ||
|
||
@Override | ||
public synchronized void start(String title, Runnable callback) { | ||
max=0; | ||
current=0; | ||
this.callback = callback; | ||
stopped=false; | ||
} | ||
|
||
@Override | ||
public synchronized void stop() { | ||
stopped = true; | ||
if (current == max) { | ||
finish(); | ||
} | ||
} | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
src/main/java/de/idrinth/waraddonclient/gui/BaseFrame.java
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,17 @@ | ||
package de.idrinth.waraddonclient.gui; | ||
|
||
import de.idrinth.waraddonclient.service.Config; | ||
import javax.swing.JFrame; | ||
|
||
abstract class BaseFrame extends JFrame { | ||
private Config config; | ||
|
||
protected BaseFrame(Config config) { | ||
this.config = config; | ||
} | ||
|
||
@Override | ||
public void setTitle(String title) { | ||
super.setTitle(title + " - Idrinth's WAR Addon Client " + config.getVersion()); | ||
} | ||
} |
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,73 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
|
||
<Form version="1.3" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> | ||
<Properties> | ||
<Property name="defaultCloseOperation" type="int" value="3"/> | ||
</Properties> | ||
<SyntheticProperties> | ||
<SyntheticProperty name="formSizePolicy" type="int" value="1"/> | ||
<SyntheticProperty name="generateCenter" type="boolean" value="false"/> | ||
</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"> | ||
<Component id="header" pref="300" max="32767" attributes="0"/> | ||
<Group type="102" alignment="1" attributes="0"> | ||
<EmptySpace max="32767" attributes="0"/> | ||
<Component id="closeButton" min="-2" max="-2" attributes="0"/> | ||
<EmptySpace min="-2" pref="113" max="-2" attributes="0"/> | ||
</Group> | ||
<Group type="102" alignment="0" attributes="0"> | ||
<EmptySpace max="-2" attributes="0"/> | ||
<Component id="progressBar" 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="0" attributes="0"> | ||
<Component id="header" min="-2" pref="16" max="-2" attributes="0"/> | ||
<EmptySpace max="-2" attributes="0"/> | ||
<Component id="progressBar" min="-2" pref="15" max="-2" attributes="0"/> | ||
<EmptySpace max="32767" attributes="0"/> | ||
<Component id="closeButton" min="-2" max="-2" attributes="0"/> | ||
</Group> | ||
</Group> | ||
</DimensionLayout> | ||
</Layout> | ||
<SubComponents> | ||
<Component class="javax.swing.JLabel" name="header"> | ||
<Properties> | ||
<Property name="horizontalAlignment" type="int" value="0"/> | ||
<Property name="text" type="java.lang.String" value="Title"/> | ||
</Properties> | ||
</Component> | ||
<Component class="javax.swing.JProgressBar" name="progressBar"> | ||
<Properties> | ||
<Property name="value" type="int" value="50"/> | ||
<Property name="stringPainted" type="boolean" value="true"/> | ||
</Properties> | ||
</Component> | ||
<Component class="javax.swing.JButton" name="closeButton"> | ||
<Properties> | ||
<Property name="text" type="java.lang.String" value="Close"/> | ||
</Properties> | ||
<Events> | ||
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="closeButtonActionPerformed"/> | ||
</Events> | ||
</Component> | ||
</SubComponents> | ||
</Form> |
Oops, something went wrong.