Skip to content

Commit

Permalink
#393 Translate German comments (#431)
Browse files Browse the repository at this point in the history
Co-authored-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
  • Loading branch information
sourav492 and smehrbrodt committed Apr 6, 2023
1 parent 4317f0f commit d6e168e
Show file tree
Hide file tree
Showing 21 changed files with 485 additions and 486 deletions.
63 changes: 31 additions & 32 deletions core/src/main/java/de/muenchen/allg/itd51/wollmux/Shortcuts.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ private Shortcuts()
}

/**
* Liest alle Attribute SHORTCUT und URL aus tastenkombinationenConf aus, löscht
* alle bisher vorhandenen Tastenkombinationen deren URL mit "wollmux:" beginnt und
* setzt neue Tastenkombination in OOo-Writer.
* Reads all attributes SHORTCUT and URL from key combinationsConf, deletes
* all existing key combinations whose URL begins with "wollmux:" and
* sets new keyboard shortcut in OOo-Writer.
*
* @param tastenkombinationenConf
* .conf Abschnitt Tastenkuerzel mit allen Knoten
* .conf section Tastenkuerzel with all nodes
*/
public static void createShortcuts(ConfigThingy tastenkombinationenConf)
{
Expand All @@ -72,21 +72,21 @@ public static void createShortcuts(ConfigThingy tastenkombinationenConf)
return;
}

// löschen aller KeyEvents die mit "wollmux:" beginnen
// Delete all KeyEvents that start with "wollmux:".
removeComandFromAllKeyEvents(shortcutManager);

// lesen des Knoten SHORTCUT
// read the node SHORTCUT
ConfigThingy shortcutConf = tastenkombinationenConf.queryByChild("SHORTCUT");

// Iterieren über die Knoten SHORTCUT
// Iterate over the SHORTCUT nodes
Iterator<ConfigThingy> iterShortcut = shortcutConf.iterator();
while (iterShortcut.hasNext())
{

ConfigThingy tastenkombination = iterShortcut.next();

String shortcut = null;
// lesen der Knoten SHORTCUT
// read the node SHORTCUT
try
{
shortcut = tastenkombination.get("SHORTCUT").toString();
Expand All @@ -98,7 +98,7 @@ public static void createShortcuts(ConfigThingy tastenkombinationenConf)
}

String url = null;
// lesen der Knoten URL
// read the node url
try
{
url = tastenkombination.get("URL").toString();
Expand All @@ -112,7 +112,7 @@ public static void createShortcuts(ConfigThingy tastenkombinationenConf)
KeyEvent keyEvent = createKeyEvent(shortcut);
if (keyEvent != null)
{
// setzen der Tastenkombination mit KeyEvent und WollMux-Url
// set the key combination with KeyEvent and WollMux-Url
try
{
shortcutManager.setKeyEvent(keyEvent, url);
Expand All @@ -128,7 +128,7 @@ public static void createShortcuts(ConfigThingy tastenkombinationenConf)
}
}

// Änderung Persistent machen
// Make change persistent
try
{
if (UNO.XUIConfigurationPersistence(shortcutManager) != null)
Expand All @@ -143,32 +143,31 @@ public static void createShortcuts(ConfigThingy tastenkombinationenConf)
}

/**
* Wenn es Tastenkuerzel mit einer UNO-url beginnent mit "wollmux:" gibt, werden
* diese gelöscht. Workaround wegen nicht funktionierendem
* If there are keyboard shortcuts with a UNO url starting with "wollmux:", they will
* these deleted. Workaround for not working
* xAcceleratorConfiguration.removeCommandFromAllKeyEvents(). OOo Issue #72558
*
* @param xAcceleratorConfiguration
* AcceleratorConfiguration (muß danach noch mit store() persistent
* gemacht werden)
* AcceleratorConfiguration (must be made persistent afterwards with store())
*/
private static void removeComandFromAllKeyEvents(
XAcceleratorConfiguration xAcceleratorConfiguration)
{
// lesen aller gesetzten Tastenkombinationen
// read all set key combinations
KeyEvent[] keys = xAcceleratorConfiguration.getAllKeyEvents();

// Wenn es Tastenkombinationen mit der UNO-url beginnent mit "wollmux:"
// gibt, werden diese gelöscht. Workaround wegen nicht funktionierendem
// If there are key combinations with the UNO url starting with "wollmux:"
// exist, these are deleted. Workaround for not working
// xAcceleratorConfiguration.removeCommandFromAllKeyEvents().
for (int i = 0; i < keys.length; i++)
{
try
{
String event = xAcceleratorConfiguration.getCommandByKeyEvent(keys[i]);
// wenn die UNO-url mit "wollmux:" beginnt, wird sie gelöscht
// if the UNO-url starts with "wollmux:" it will be deleted
if (event.startsWith("wollmux:"))
{
// löschen der Tastenkombination
// delete the key combination
xAcceleratorConfiguration.removeKeyEvent(keys[i]);
}
}
Expand All @@ -180,7 +179,7 @@ private static void removeComandFromAllKeyEvents(
}

/**
* Gibt alle KeyEvents mit Modifier, KeyCode und Command aus
* Outputs all KeyEvents with Modifier, KeyCode and Command
*
* @param xac
* AcceleratorConfigurator
Expand Down Expand Up @@ -208,12 +207,12 @@ public static void showKeyset(XAcceleratorConfiguration xac)
}

/**
* Erzeugt ein Object KeyEvent
* Generates an Object KeyEvent
*
* @param shortcutWithSeparator
* Tastenkombination mit "+" als Separator
* @return gibt ein KeyEvent zurück oder null wenn kein keyCode sondern nur
* keyModifier verwendet werden
* Key combination with "+" as separator
* @return returns a KeyEvent or null if not a keyCode but only
* keyModifier are used
*/
private static KeyEvent createKeyEvent(String shortcutWithSeparator)
{
Expand Down Expand Up @@ -253,11 +252,11 @@ private static KeyEvent createKeyEvent(String shortcutWithSeparator)
}

/**
* Gibt die Konstante com.sun.star.awt.Key für die entsprechende Taste zurück
* Returns the constant com.sun.star.awt.Key for the corresponding key
*
* @param shortcut
* Taste
* @return Key der entsprechenden Taste
* button
* @return key of the corresponding key
*/
private static Short returnKeyCode(String shortcut)
{
Expand Down Expand Up @@ -384,12 +383,12 @@ private static Short returnKeyCode(String shortcut)
}

/**
* Gibt die Konstante com.sun.star.awt.KeyModifier für die entsprechende Taste
* zurück
* Returns the constant com.sun.star.awt.KeyModifier for the corresponding key
* return
*
* @param shortcut
* Taste
* @return KeyModifier der entsprechenden Taste
* button
* @return KeyModifier of the corresponding key
*/
private static Short returnKeyModifier(String shortcut)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,34 +26,34 @@
import java.awt.event.ActionListener;

/**
* Diese Klasse vereinfacht die Synchronisation verschiedener Threads über einen
* ActionListener. Die Anwendung erfolgt in der Regel in folgenden Schritten:
* This class simplifies the synchronization of different threads over one
* ActionListener. The application usually takes place in the following steps:
*
* SyncActionListener s = new SyncActionListener();
* aufrufEinerMethodeDieEinenActionListenerErwartet(..., s); EventObject result =
* calling a method that expects an action listener (..., s); EventObject result =
* s.synchronize();
*
* Es ist sicher gestellt, dass s.synchronize() erst zurück kehrt, wenn der
* ActionListener benachrichtigt wurde. Dabei wird das EventObject zurück gegeben,
* mit dem {@link #actionPerformed(ActionEvent)} des Listeners aufgerufen wurde.
* It is ensured that s.synchronize() does not return until the
* ActionListener was notified. The EventObject is returned,
* was called with the listener's {@link #actionPerformed(ActionEvent)} .
*
* @author Christoph Lutz (D-III-ITD-D101)
*/
public class SyncActionListener implements ActionListener
{
/**
* Das lock-Flag über das die Synchronisierung erfolgt.
* The lock flag over which synchronization is done.
*/
private boolean[] lock = new boolean[] { true };

/**
* Enthält nach erfolgter Syncronisierung das zurückgegebene ActionEvent
* Contains the returned ActionEvent after synchronization has taken place
*/
private ActionEvent result = null;

/**
* Kehrt erst zurück, wenn {@link #actionPerformed(ActionEvent)} des Listeners
* aufgerufen wurde und liefert das dabei übermittelte EventObject zurück.
* Returns only when the listener's {@link #actionPerformed(ActionEvent)}
* was called and returns the EventObject that was transmitted.
*/
public ActionEvent synchronize()
{
Expand Down
Loading

0 comments on commit d6e168e

Please sign in to comment.