[java-atk-wrapper] Small code adjustement
- From: Samuel Thibault <sthibaul src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [java-atk-wrapper] Small code adjustement
- Date: Thu, 6 Jun 2019 19:37:19 +0000 (UTC)
commit 9a94adea8cf9af5b4f4546ed5f8b048de445718d
Author: Giuseppe <giuseppecapaldo93 gmail com>
Date: Thu Jun 6 10:17:27 2019 +0200
Small code adjustement
- updated gitignore, now after compiling the configuration files will be
ignored in the future pushes
- removed some spurious packages qualifiers because they are present in the
import
- added comments on get_description() in AtkAction and on
setAccessibleColumnHeader() in AtkTable.
.gitignore | 5 +--
wrapper/org/GNOME/Accessibility/AtkAction.java | 40 +++++++++++------------
wrapper/org/GNOME/Accessibility/AtkComponent.java | 3 +-
wrapper/org/GNOME/Accessibility/AtkHyperlink.java | 3 +-
wrapper/org/GNOME/Accessibility/AtkSelection.java | 3 +-
wrapper/org/GNOME/Accessibility/AtkTable.java | 20 ++++++------
6 files changed, 36 insertions(+), 38 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index c285c14..4846ec9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,9 +21,9 @@ nbproject/
Makefile
Makefile.in
/aclocal.m4
+/config
/config.guess
-/config.h
-/config.h.in
+/config.h*
/config.log
/config.status
/config.sub
@@ -33,6 +33,7 @@ Makefile.in
/install-sh
/libtool
/ltmain.sh
+/m4
/missing
/mkinstalldirs
/stamp-h1
diff --git a/wrapper/org/GNOME/Accessibility/AtkAction.java b/wrapper/org/GNOME/Accessibility/AtkAction.java
index 09dedbf..eefb4b5 100644
--- a/wrapper/org/GNOME/Accessibility/AtkAction.java
+++ b/wrapper/org/GNOME/Accessibility/AtkAction.java
@@ -52,7 +52,7 @@ public class AtkAction {
acc_action.doAccessibleAction(index);
}
}
-
+
public boolean do_action (int i) {
SwingUtilities.invokeLater(new ActionRunner(acc_action, i));
return true;
@@ -62,6 +62,7 @@ public class AtkAction {
return acc_action.getAccessibleActionCount();
}
+ // FIXME: get and set methods seem wrong
public String get_description (int i) {
String description = "<description>";
return description;
@@ -77,7 +78,7 @@ public class AtkAction {
public String get_name (int i) {
String name = acc_action.getAccessibleActionDescription(i);
if (name == null) {
- name = " ";
+ name = "";
}
return name;
@@ -105,7 +106,7 @@ public class AtkAction {
else if (description != null)
return description;
- return null;
+ return "";
}
private String convertModString (String mods) {
@@ -118,7 +119,7 @@ public class AtkAction {
for (int i = 0; i < modStrs.length; i++) {
newModString += "<" + modStrs[i] + ">";
}
-
+
return newModString;
}
@@ -126,7 +127,7 @@ public class AtkAction {
// TODO: improve/fix conversion to strings, concatenate,
// and follow our formatting convention for the role of
// various keybindings (i.e. global, transient, etc.)
-
+
//
// Presently, JAA doesn't define a relationship between the index used
// and the action associated. As such, all keybindings are only
@@ -135,10 +136,10 @@ public class AtkAction {
if (index > 0) {
return "";
}
-
+
if(acc_ext_component != null) {
AccessibleKeyBinding akb = acc_ext_component.getAccessibleKeyBinding();
-
+
if (akb != null && akb.getAccessibleKeyBindingCount() > 0) {
String rVal = "";
int i;
@@ -162,16 +163,16 @@ public class AtkAction {
// Since only the first three are relevant, ignore others
for (i = 0;( i < akb.getAccessibleKeyBindingCount() && i < 3); i++) {
Object o = akb.getAccessibleKeyBinding(i);
-
+
if ( i > 0 ) {
rVal += ";";
}
-
- if (o instanceof javax.swing.KeyStroke) {
- javax.swing.KeyStroke keyStroke = (javax.swing.KeyStroke)o;
+
+ if (o instanceof KeyStroke) {
+ KeyStroke keyStroke = (KeyStroke)o;
String modString =
KeyEvent.getKeyModifiersText(keyStroke.getModifiers());
String keyString =
KeyEvent.getKeyText(keyStroke.getKeyCode());
-
+
if ( keyString != null ) {
if ( modString != null && modString.length() > 0 ) {
rVal += convertModString(modString) +
keyString;
@@ -179,16 +180,16 @@ public class AtkAction {
rVal += keyString;
}
}
- } else if (o instanceof javax.swing.KeyStroke[]) {
- javax.swing.KeyStroke[] keyStroke =
(javax.swing.KeyStroke[])o;
+ } else if (o instanceof KeyStroke[]) {
+ KeyStroke[] keyStroke = (KeyStroke[])o;
for ( int j = 0; j < keyStroke.length; j++ ) {
String modString =
KeyEvent.getKeyModifiersText(keyStroke[j].getModifiers());
String keyString =
KeyEvent.getKeyText(keyStroke[j].getKeyCode());
-
+
if (j > 0) {
rVal += ":";
}
-
+
if ( keyString != null ) {
if (modString != null && modString.length() >
0) {
rVal += convertModString(modString) +
keyString;
@@ -199,15 +200,14 @@ public class AtkAction {
}
}
}
-
+
if ( i < 2 ) rVal += ";";
if ( i < 3 ) rVal += ";";
-
+
return rVal;
}
}
-
+
return "";
}
}
-
diff --git a/wrapper/org/GNOME/Accessibility/AtkComponent.java
b/wrapper/org/GNOME/Accessibility/AtkComponent.java
index 46a1a86..6449dcc 100644
--- a/wrapper/org/GNOME/Accessibility/AtkComponent.java
+++ b/wrapper/org/GNOME/Accessibility/AtkComponent.java
@@ -55,7 +55,7 @@ public class AtkComponent {
this.y -= p.y;
}
- javax.accessibility.Accessible accessible = acc_component.getAccessibleAt(new Point(x, y));
+ Accessible accessible = acc_component.getAccessibleAt(new Point(x, y));
if (accessible == null) {
return null;
}
@@ -132,4 +132,3 @@ public class AtkComponent {
return AtkLayer.WIDGET;
}
}
-
diff --git a/wrapper/org/GNOME/Accessibility/AtkHyperlink.java
b/wrapper/org/GNOME/Accessibility/AtkHyperlink.java
index af73079..714af45 100644
--- a/wrapper/org/GNOME/Accessibility/AtkHyperlink.java
+++ b/wrapper/org/GNOME/Accessibility/AtkHyperlink.java
@@ -43,7 +43,7 @@ public class AtkHyperlink {
public Object get_object (int i) {
Object o = null;
Object anchor = acc_hyperlink.getAccessibleActionAnchor(i);
- if (anchor instanceof javax.accessibility.Accessible) {
+ if (anchor instanceof Accessible) {
o = anchor;
}
@@ -66,4 +66,3 @@ public class AtkHyperlink {
return acc_hyperlink.getAccessibleActionCount();
}
}
-
diff --git a/wrapper/org/GNOME/Accessibility/AtkSelection.java
b/wrapper/org/GNOME/Accessibility/AtkSelection.java
index d061dd5..5e72b3c 100644
--- a/wrapper/org/GNOME/Accessibility/AtkSelection.java
+++ b/wrapper/org/GNOME/Accessibility/AtkSelection.java
@@ -42,7 +42,7 @@ public class AtkSelection {
return true;
}
- public javax.accessibility.Accessible ref_selection (int i) {
+ public Accessible ref_selection (int i) {
return acc_selection.getAccessibleSelection(i);
}
@@ -78,4 +78,3 @@ public class AtkSelection {
return false;
}
}
-
diff --git a/wrapper/org/GNOME/Accessibility/AtkTable.java b/wrapper/org/GNOME/Accessibility/AtkTable.java
index d547ba3..006286f 100644
--- a/wrapper/org/GNOME/Accessibility/AtkTable.java
+++ b/wrapper/org/GNOME/Accessibility/AtkTable.java
@@ -33,7 +33,7 @@ public class AtkTable {
}
public AccessibleContext ref_at (int row, int column) {
- javax.accessibility.Accessible accessible = acc_table.getAccessibleAt(row, column);
+ Accessible accessible = acc_table.getAccessibleAt(row, column);
if (accessible != null) {
return accessible.getAccessibleContext();
}
@@ -78,7 +78,7 @@ public class AtkTable {
}
public AccessibleContext get_caption () {
- javax.accessibility.Accessible accessible = acc_table.getAccessibleCaption();
+ Accessible accessible = acc_table.getAccessibleCaption();
if (accessible != null) {
return accessible.getAccessibleContext();
@@ -96,7 +96,7 @@ public class AtkTable {
}
public String get_column_description (int column) {
- javax.accessibility.Accessible accessible =
+ Accessible accessible =
acc_table.getAccessibleColumnDescription(column);
if (accessible != null) {
@@ -116,14 +116,14 @@ public class AtkTable {
* specified column of the table
*/
public void setColumnDescription(int column, String description) {
- javax.accessibility.Accessible accessible = acc_table.getAccessibleColumnDescription(column);
+ Accessible accessible = acc_table.getAccessibleColumnDescription(column);
if (description.equals(accessible.toString()) && accessible != null) {
acc_table.setAccessibleColumnDescription(column, accessible);
}
}
public String get_row_description (int row) {
- javax.accessibility.Accessible accessible =
+ Accessible accessible =
acc_table.getAccessibleRowDescription(row);
if (accessible != null) {
@@ -143,7 +143,7 @@ public class AtkTable {
* specified row of the table
*/
public void setRowDescription(int row, String description) {
- javax.accessibility.Accessible accessible = acc_table.getAccessibleRowDescription(row);
+ Accessible accessible = acc_table.getAccessibleRowDescription(row);
if (description.equals(accessible.toString()) && accessible != null) {
acc_table.setAccessibleRowDescription(row, accessible);
}
@@ -154,7 +154,7 @@ public class AtkTable {
acc_table.getAccessibleColumnHeader();
if (accessibleTable != null) {
- javax.accessibility.Accessible accessible = accessibleTable.getAccessibleAt(0,
column);
+ Accessible accessible = accessibleTable.getAccessibleAt(0, column);
if (accessible != null) {
return accessible.getAccessibleContext();
@@ -170,6 +170,7 @@ public class AtkTable {
* @param table an AccessibleTable object
*/
public void setColumnHeader (int column, AccessibleTable table) {
+ // FIXME: this isn't using column for anything
acc_table.setAccessibleColumnHeader(table);
}
@@ -178,7 +179,7 @@ public class AtkTable {
acc_table.getAccessibleRowHeader();
if (accessibleTable != null) {
- javax.accessibility.Accessible accessible = accessibleTable.getAccessibleAt(row, 0);
+ Accessible accessible = accessibleTable.getAccessibleAt(row, 0);
if (accessible != null) {
return accessible.getAccessibleContext();
@@ -193,7 +194,7 @@ public class AtkTable {
}
public AccessibleContext get_summary () {
- javax.accessibility.Accessible accessible = acc_table.getAccessibleSummary();
+ Accessible accessible = acc_table.getAccessibleSummary();
if (accessible != null) {
return accessible.getAccessibleContext();
@@ -246,4 +247,3 @@ public class AtkTable {
return false;
}
}
-
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]