Skip to content
This repository has been archived by the owner on Oct 20, 2022. It is now read-only.

Added a better GUI (multilang, with download list) #10

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 16 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
SpigotPatcher
SpigotPatcherGUI
=============

**Binary patcher for distribution of Spigot and related updates.**
GUI for the SpigotPatcher app!

Usage
-----
See the [initial release announcement](http://www.spigotmc.org/threads/29091/) or [this wiki page](http://www.spigotmc.org/wiki/spigot-patcher/) for detailed usage instructions on how to use SpigotPatcher. For command line invocation, simply run the program without any arguments.

Changelog
---------

* **1.0.1**: Check file read and write permissions before beginning patch process.
* **1.0.0**: Initial Release

Download
--------
You can grab downloads of current and past versions from our [Jenkins server](http://ci.md-5.net/job/SpigotPatcher/).

TODO
----
* Simple and easy to use GUI.
##Features##
* Version checker
* Multi Language (EN, HU, ...)
* Automatically check the checksum
* File browser GUI
* File downloader (The list updates every launch)

##With or without GUI:##
* If you start the application with **--nogui** argument, you can use the original console based patcher.

##JVM arguments:##
* If you start the application with **-Dlanguage=en** JVM argument, your patcher will start with the selected language.

![ScreenShot](http://content.screencast.com/users/Gerviba/folders/Jing/media/139d0738-9668-45cb-9ee3-da8685f663ac/2014-09-13_1743.png)
13 changes: 12 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>org.spigotmc</groupId>
<artifactId>patcher</artifactId>
<version>1.0.1-SNAPSHOT</version>
<version>1.0.6-SNAPSHOT</version>
<packaging>jar</packaging>

<name>SpigotPatcher</name>
Expand Down Expand Up @@ -38,6 +38,17 @@

<build>
<finalName>${project.name}</finalName>

<resources>
<resource>
<directory>${project.basedir}</directory>
<targetPath>.</targetPath>
<includes>
<include>**/*.png</include>
</includes>
</resource>
</resources>

<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down
Binary file added resources/spigot_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/spigot_upperbar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
92 changes: 92 additions & 0 deletions src/main/java/org/eclipse/wb/swing/FocusTraversalOnArray.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/*******************************************************************************
* Copyright (c) 2011 Google, Inc.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Google, Inc. - initial API and implementation
*******************************************************************************/
package org.eclipse.wb.swing;

import java.awt.Component;
import java.awt.Container;
import java.awt.FocusTraversalPolicy;

/**
* Cyclic focus traversal policy based on array of components.
* <p>
* This class may be freely distributed as part of any application or plugin.
*
* @author scheglov_ke
*/
public class FocusTraversalOnArray extends FocusTraversalPolicy {
private final Component m_Components[];
////////////////////////////////////////////////////////////////////////////
//
// Constructor
//
////////////////////////////////////////////////////////////////////////////
public FocusTraversalOnArray(Component components[]) {
m_Components = components;
}
////////////////////////////////////////////////////////////////////////////
//
// Utilities
//
////////////////////////////////////////////////////////////////////////////
private int indexCycle(int index, int delta) {
int size = m_Components.length;
int next = (index + delta + size) % size;
return next;
}
private Component cycle(Component currentComponent, int delta) {
int index = -1;
loop : for (int i = 0; i < m_Components.length; i++) {
Component component = m_Components[i];
for (Component c = currentComponent; c != null; c = c.getParent()) {
if (component == c) {
index = i;
break loop;
}
}
}
// try to find enabled component in "delta" direction
int initialIndex = index;
while (true) {
int newIndex = indexCycle(index, delta);
if (newIndex == initialIndex) {
break;
}
index = newIndex;
//
Component component = m_Components[newIndex];
if (component.isEnabled() && component.isVisible() && component.isFocusable()) {
return component;
}
}
// not found
return currentComponent;
}
////////////////////////////////////////////////////////////////////////////
//
// FocusTraversalPolicy
//
////////////////////////////////////////////////////////////////////////////
public Component getComponentAfter(Container container, Component component) {
return cycle(component, 1);
}
public Component getComponentBefore(Container container, Component component) {
return cycle(component, -1);
}
public Component getFirstComponent(Container container) {
return m_Components[0];
}
public Component getLastComponent(Container container) {
return m_Components[m_Components.length - 1];
}
public Component getDefaultComponent(Container container) {
return getFirstComponent(container);
}
}
Loading