Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
e003f69e
Kaydet (Commit)
e003f69e
authored
May 23, 2003
tarafından
Andre Fischer
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Changed registration of object views.
üst
b2642683
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
230 additions
and
104 deletions
+230
-104
makefile.mk
toolkit/test/accessibility/makefile.mk
+11
-2
ContextView.java
toolkit/test/accessibility/ov/ContextView.java
+7
-3
FocusView.java
toolkit/test/accessibility/ov/FocusView.java
+7
-3
ListeningObjectView.java
toolkit/test/accessibility/ov/ListeningObjectView.java
+5
-0
ObjectView.java
toolkit/test/accessibility/ov/ObjectView.java
+7
-2
ObjectViewContainer.java
toolkit/test/accessibility/ov/ObjectViewContainer.java
+66
-11
StateSetView.java
toolkit/test/accessibility/ov/StateSetView.java
+119
-79
TextView.java
toolkit/test/accessibility/ov/TextView.java
+7
-3
makefile.mk
toolkit/test/accessibility/ov/makefile.mk
+1
-1
No files found.
toolkit/test/accessibility/makefile.mk
Dosyayı görüntüle @
e003f69e
...
...
@@ -16,7 +16,7 @@ JAR_PATH = $(SOLARBINDIR)$/
# The rest of this makefile should not need to be touched.
all
:
AccessibilityWorkBench
dist
all
:
AccessibilityWorkBench
JAR_FILES
=
\
unoil.jar
\
...
...
@@ -94,7 +94,7 @@ JFLAGS = -deprecation -classpath $(CLASSPATH)
%.class
:
%.java
+$(JAVAC)
$(JFLAGS)
$<
AccessibilityWorkBench
:
ObjectView $(JAVA_FILES:b:+".class")
AccessibilityWorkBench
:
ObjectView
Tools
$(JAVA_FILES:b:+".class")
ObjectView .SETDIR=ov
:
@echo
"making package ObjectView"
...
...
@@ -104,6 +104,15 @@ Tools .SETDIR=tools :
@echo
"making package Tools"
dmake
# Remove all class files.
clean
:
ObjectView.clean Tools.clean
rm
*.class
rm
AccessibilityWorkBench.jar
ObjectView.clean .SETDIR=ov
:
rm
*.class
Tools.clean .SETDIR=tools
:
rm
*.class
# Create a jar file of all files neccessary to build and run the work bench.
dist
:
AccessibilityWorkBench.jar
...
...
toolkit/test/accessibility/ov/ContextView.java
Dosyayı görüntüle @
e003f69e
...
...
@@ -21,16 +21,20 @@ public class ContextView
extends
ListeningObjectView
implements
ActionListener
{
static
public
ObjectView
Create
(
XAccessibleContext
xContext
)
static
public
ObjectView
Create
(
ObjectViewContainer
aContainer
,
XAccessibleContext
xContext
)
{
System
.
out
.
println
(
"ContextView.CreateView"
);
if
(
xContext
!=
null
)
return
new
ContextView
(
);
return
new
ContextView
(
aContainer
);
else
return
null
;
}
public
ContextView
()
public
ContextView
(
ObjectViewContainer
aContainer
)
{
super
(
aContainer
);
maNameLabel
=
new
JLabel
(
"Name: "
);
maName
=
new
JLabel
(
""
);
maDescriptionLabel
=
new
JLabel
(
"Description: "
);
...
...
toolkit/test/accessibility/ov/FocusView.java
Dosyayı görüntüle @
e003f69e
...
...
@@ -24,18 +24,22 @@ public class FocusView
/** Create a FocusView when the given object supports the
XAccessibleComponent interface.
*/
static
public
ObjectView
Create
(
XAccessibleContext
xContext
)
static
public
ObjectView
Create
(
ObjectViewContainer
aContainer
,
XAccessibleContext
xContext
)
{
XAccessibleComponent
xComponent
=
(
XAccessibleComponent
)
UnoRuntime
.
queryInterface
(
XAccessibleComponent
.
class
,
xContext
);
if
(
xComponent
!=
null
)
return
new
FocusView
(
);
return
new
FocusView
(
aContainer
);
else
return
null
;
}
public
FocusView
()
public
FocusView
(
ObjectViewContainer
aContainer
)
{
super
(
aContainer
);
setLayout
(
new
GridBagLayout
());
GridBagConstraints
aConstraints
=
new
GridBagConstraints
();
...
...
toolkit/test/accessibility/ov/ListeningObjectView.java
Dosyayı görüntüle @
e003f69e
...
...
@@ -14,6 +14,11 @@ abstract class ListeningObjectView
extends
ObjectView
implements
XAccessibleEventListener
{
public
ListeningObjectView
(
ObjectViewContainer
aContainer
)
{
super
(
aContainer
);
}
/** Add this object as event listener at the broadcasting
accessible object.
*/
...
...
toolkit/test/accessibility/ov/ObjectView.java
Dosyayı görüntüle @
e003f69e
...
...
@@ -24,13 +24,16 @@ abstract public class ObjectView
In the ususal case this will be the support of a specific
accessibility interface.
*/
static
public
ObjectView
Create
(
XAccessibleContext
xContext
)
static
public
ObjectView
Create
(
ObjectViewContainer
aContainer
,
XAccessibleContext
xContext
)
{
return
null
;
}
public
ObjectView
()
public
ObjectView
(
ObjectViewContainer
aContainer
)
{
maContainer
=
aContainer
;
mxContext
=
null
;
}
...
...
@@ -69,4 +72,6 @@ abstract public class ObjectView
/// Reference to the current object to display information about.
protected
XAccessibleContext
mxContext
;
protected
ObjectViewContainer
maContainer
;
}
toolkit/test/accessibility/ov/ObjectViewContainer.java
Dosyayı görüntüle @
e003f69e
...
...
@@ -6,6 +6,13 @@ import java.awt.GridBagLayout;
import
java.awt.GridBagConstraints
;
import
java.awt.Insets
;
import
java.util.Vector
;
import
java.lang.reflect.Method
;
import
java.lang.NoSuchMethodException
;
import
java.lang.IllegalAccessException
;
import
java.lang.reflect.InvocationTargetException
;
import
javax.swing.JPanel
;
import
javax.swing.JTree
;
import
javax.swing.BorderFactory
;
...
...
@@ -17,13 +24,21 @@ import com.sun.star.accessibility.XAccessibleComponent;
import
com.sun.star.accessibility.XAccessibleSelection
;
import
com.sun.star.uno.UnoRuntime
;
public
class
ObjectViewContainer
extends
JPanel
{
public
ObjectViewContainer
()
{
maViewTemplates
=
new
Vector
();
maViewBorder
=
BorderFactory
.
createBevelBorder
(
BevelBorder
.
RAISED
);
setLayout
(
new
GridBagLayout
());
System
.
out
.
println
(
"ObjectViewContainer"
);
RegisterView
(
ContextView
.
class
);
// RegisterView (StateSetView.class);
RegisterView
(
FocusView
.
class
);
RegisterView
(
TextView
.
class
);
}
...
...
@@ -42,11 +57,29 @@ public class ObjectViewContainer
removeAll
();
// Add new views.
Add
(
ContextView
.
Create
(
xContext
));
Add
(
StateSetView
.
Create
(
xContext
));
Add
(
FocusView
.
Create
(
xContext
));
Add
(
SelectionView
.
Create
(
xContext
));
Add
(
TextView
.
Create
(
xContext
));
for
(
int
i
=
0
;
i
<
maViewTemplates
.
size
();
i
++)
{
try
{
Class
aViewClass
=
(
Class
)
maViewTemplates
.
elementAt
(
i
);
Method
aCreateMethod
=
aViewClass
.
getDeclaredMethod
(
"Create"
,
new
Class
[]
{
ObjectViewContainer
.
class
,
XAccessibleContext
.
class
});
if
(
aCreateMethod
!=
null
)
{
ObjectView
aView
=
(
ObjectView
)
aCreateMethod
.
invoke
(
null
,
new
Object
[]
{
this
,
xContext
});
Add
(
aView
);
}
}
catch
(
NoSuchMethodException
e
)
{
System
.
err
.
println
(
"Caught exception while creating view "
+
i
+
" : "
+
e
);}
catch
(
IllegalAccessException
e
)
{
System
.
err
.
println
(
"Caught exception while creating view "
+
i
+
" : "
+
e
);}
catch
(
InvocationTargetException
e
)
{
System
.
err
.
println
(
"Caught exception while creating view "
+
i
+
" : "
+
e
);}
}
UpdateLayoutManager
();
...
...
@@ -59,12 +92,29 @@ public class ObjectViewContainer
}
/** Add the given class to the list of classes which will be
instantiated the next time an accessible object is set.
*/
public
void
RegisterView
(
Class
aObjectViewClass
)
{
System
.
out
.
println
(
"registering "
+
aObjectViewClass
);
maViewTemplates
.
addElement
(
aObjectViewClass
);
}
/** Replace one view class with another.
*/
public
void
ReplaceView
(
Class
aObjectViewClass
,
Class
aSubstitution
)
{
int
nIndex
=
maViewTemplates
.
indexOf
(
aObjectViewClass
);
if
(
nIndex
>=
0
)
maViewTemplates
.
setElementAt
(
aSubstitution
,
nIndex
);
}
/** Add an object view and place it below all previously added views.
@param aView
This argument may be null. In this case nothing happens.
*/
p
ublic
void
Add
(
ObjectView
aView
)
p
rivate
void
Add
(
ObjectView
aView
)
{
if
(
aView
!=
null
)
{
...
...
@@ -97,15 +147,20 @@ public class ObjectViewContainer
private
void
UpdateLayoutManager
()
{
// Adapt the layout manager.
Component
aComponent
=
getComponent
(
getComponentCount
()-
1
);
GridBagLayout
aLayout
=
(
GridBagLayout
)
getLayout
();
GridBagConstraints
aConstraints
=
aLayout
.
getConstraints
(
aComponent
);
aConstraints
.
weighty
=
1
;
aLayout
.
setConstraints
(
aComponent
,
aConstraints
);
if
(
getComponentCount
()
>
0
)
{
Component
aComponent
=
getComponent
(
getComponentCount
()-
1
);
GridBagLayout
aLayout
=
(
GridBagLayout
)
getLayout
();
GridBagConstraints
aConstraints
=
aLayout
.
getConstraints
(
aComponent
);
aConstraints
.
weighty
=
1
;
aLayout
.
setConstraints
(
aComponent
,
aConstraints
);
}
}
/// Observe this tree for selection changes and notify them to all
/// children.
private
JTree
maTree
;
private
Border
maViewBorder
;
/// List of view templates which are instantiated when new object is set.
private
Vector
maViewTemplates
;
}
toolkit/test/accessibility/ov/StateSetView.java
Dosyayı görüntüle @
e003f69e
...
...
@@ -36,21 +36,103 @@ public class StateSetView
/** Create a FocusView when the given object supports the
XAccessibleComponent interface.
*/
static
public
ObjectView
Create
(
XAccessibleContext
xContext
)
static
public
ObjectView
Create
(
ObjectViewContainer
aContainer
,
XAccessibleContext
xContext
)
{
ObjectView
aView
=
null
;
if
(
xContext
!=
null
)
return
new
StateSetView
();
if
(
mnViewMode
==
SHOW_ALL_STATES
)
aView
=
StateSetAllView
.
Create
(
aContainer
,
xContext
);
else
aView
=
StateSetSetView
.
Create
(
aContainer
,
xContext
);
return
aView
;
}
public
StateSetView
(
ObjectViewContainer
aContainer
)
{
super
(
aContainer
);
addMouseListener
(
this
);
}
private
void
SetViewMode
(
int
nViewMode
)
{
mnViewMode
=
nViewMode
;
switch
(
mnViewMode
)
{
case
SHOW_SET_STATES
:
maContainer
.
ReplaceView
(
getClass
(),
StateSetSetView
.
class
);
break
;
case
SHOW_ALL_STATES
:
maContainer
.
ReplaceView
(
getClass
(),
StateSetAllView
.
class
);
break
;
}
aContainer
.
SetObject
(
mxContext
);
}
public
String
GetTitle
()
{
return
(
"StateSet"
);
}
public
void
notifyEvent
(
AccessibleEventObject
aEvent
)
{
if
(
aEvent
.
EventId
==
AccessibleEventId
.
STATE_CHANGED
)
Update
();
}
public
void
mouseClicked
(
MouseEvent
e
)
{
switch
(
mnViewMode
)
{
case
SHOW_SET_STATES
:
SetViewMode
(
SHOW_ALL_STATES
);
break
;
case
SHOW_ALL_STATES
:
SetViewMode
(
SHOW_SET_STATES
);
break
;
}
}
public
void
mouseEntered
(
MouseEvent
e
)
{}
public
void
mouseExited
(
MouseEvent
e
)
{}
public
void
mousePressed
(
MouseEvent
e
)
{}
public
void
mouseReleased
(
MouseEvent
e
)
{}
private
static
int
mnViewMode
=
SHOW_ALL_STATES
;
private
final
static
int
SHOW_SET_STATES
=
0
;
private
final
static
int
SHOW_ALL_STATES
=
1
;
public
class
StateSetAllView
extends
StateSetView
{
/** Create a FocusView when the given object supports the
XAccessibleComponent interface.
*/
static
public
ObjectView
Create
(
ObjectViewContainer
aContainer
,
XAccessibleContext
xContext
)
{
if
(
xContext
!=
null
)
return
new
StateSetAllView
(
aContainer
);
else
return
null
;
}
public
StateSet
View
(
)
public
StateSet
AllView
(
ObjectViewContainer
aContainer
)
{
maStates
=
null
;
mnViewMode
=
SHOW_ALL_STATES
;
super
(
aContainer
)
;
setPreferredSize
(
new
Dimension
(
300
,
90
));
setMinimumSize
(
new
Dimension
(
200
,
80
));
addMouseListener
(
this
);
}
public
void
paintChildren
(
Graphics
g
)
...
...
@@ -68,43 +150,10 @@ public class StateSetView
aSize
.
width
-
aInsets
.
left
-
aInsets
.
right
,
aSize
.
height
-
aInsets
.
top
-
aInsets
.
bottom
);
switch
(
mnViewMode
)
{
case
SHOW_ALL_STATES
:
PaintAllStates
((
Graphics2D
)
g
,
aWidgetArea
);
break
;
case
SHOW_SET_STATES
:
PaintSetStates
((
Graphics2D
)
g
,
aWidgetArea
);
break
;
}
}
}
private
void
SetViewMode
(
int
nViewMode
)
{
mnViewMode
=
nViewMode
;
switch
(
mnViewMode
)
{
case
SHOW_SET_STATES
:
maStates
=
new
JLabel
();
add
(
maStates
,
BorderLayout
.
CENTER
);
Update
();
break
;
case
SHOW_ALL_STATES
:
if
(
maStates
!=
null
)
{
remove
(
maStates
);
maStates
=
null
;
}
repaint
();
break
;
PaintAllStates
((
Graphics2D
)
g
,
aWidgetArea
);
}
}
private
void
PaintSetStates
(
Graphics2D
g
,
Rectangle
aWidgetArea
)
{
}
private
void
PaintAllStates
(
Graphics2D
g
,
Rectangle
aWidgetArea
)
{
Color
aTextColor
=
g
.
getColor
();
...
...
@@ -152,58 +201,49 @@ public class StateSetView
}
}
}
}
synchronized
public
void
Update
()
public
class
StateSetSetView
extends
StateSetView
{
static
public
ObjectView
Create
(
ObjectViewContainer
aContainer
,
XAccessibleContext
xContext
)
{
if
(
mnViewMode
==
SHOW_SET_STATES
)
{
XAccessibleStateSet
xStateSet
=
mxContext
.
getAccessibleStateSet
();
if
(
xStateSet
!=
null
)
{
String
sStates
=
new
String
();
short
aStates
[]
=
xStateSet
.
getStates
();
for
(
int
i
=
0
;
i
<
aStates
.
length
;
i
++)
{
if
(
i
>
0
)
sStates
=
sStates
+
", "
;
sStates
=
sStates
+
NameProvider
.
getStateName
(
aStates
[
i
]);
}
maStates
.
setText
(
sStates
);
}
}
if
(
xContext
!=
null
)
return
new
StateSetSetView
(
aContainer
);
else
return
null
;
}
public
St
ring
GetTitle
(
)
public
St
ateSetSetView
(
ObjectViewContainer
aContainer
)
{
return
(
"StateSet"
);
}
super
(
aContainer
);
public
void
notifyEvent
(
AccessibleEventObject
aEvent
)
{
if
(
aEvent
.
EventId
==
AccessibleEventId
.
STATE_CHANGED
)
Update
();
maStates
=
null
;
setPreferredSize
(
new
Dimension
(
300
,
90
));
}
public
void
mouseClicked
(
MouseEvent
e
)
synchronized
public
void
Update
()
{
switch
(
mnViewMode
)
XAccessibleStateSet
xStateSet
=
mxContext
.
getAccessibleStateSet
();
if
(
xStateSet
!=
null
)
{
case
SHOW_SET_STATES
:
SetViewMode
(
SHOW_ALL_STATES
);
break
;
case
SHOW_ALL_STATES
:
SetViewMode
(
SHOW_SET_STATES
);
break
;
String
sStates
=
new
String
();
short
aStates
[]
=
xStateSet
.
getStates
();
for
(
int
i
=
0
;
i
<
aStates
.
length
;
i
++)
{
if
(
i
>
0
)
sStates
=
sStates
+
", "
;
sStates
=
sStates
+
NameProvider
.
getStateName
(
aStates
[
i
]);
}
maStates
.
setText
(
sStates
);
}
}
public
void
mouseEntered
(
MouseEvent
e
)
{}
public
void
mouseExited
(
MouseEvent
e
)
{}
public
void
mousePressed
(
MouseEvent
e
)
{}
public
void
mouseReleased
(
MouseEvent
e
)
{}
private
JLabel
maStates
;
private
int
mnViewMode
;
private
final
int
SHOW_SET_STATES
=
0
;
private
final
int
SHOW_ALL_STATES
=
1
;
}
}
toolkit/test/accessibility/ov/TextView.java
Dosyayı görüntüle @
e003f69e
...
...
@@ -23,19 +23,23 @@ public class TextView
/** Create a TextView when the given object supports the
XAccessibleText interface.
*/
static
public
ObjectView
Create
(
XAccessibleContext
xContext
)
static
public
ObjectView
Create
(
ObjectViewContainer
aContainer
,
XAccessibleContext
xContext
)
{
XAccessibleText
xText
=
(
XAccessibleText
)
UnoRuntime
.
queryInterface
(
XAccessibleText
.
class
,
xContext
);
if
(
xText
!=
null
)
return
new
TextView
(
);
return
new
TextView
(
aContainer
);
else
return
null
;
}
public
TextView
()
public
TextView
(
ObjectViewContainer
aContainer
)
{
super
(
aContainer
);
setLayout
(
new
GridBagLayout
());
GridBagConstraints
aConstraints
=
new
GridBagConstraints
();
...
...
toolkit/test/accessibility/ov/makefile.mk
Dosyayı görüntüle @
e003f69e
...
...
@@ -33,8 +33,8 @@ JAVA_FILES = \
ov/ContextView.java
\
ov/FocusView.java
\
ov/SelectionView.java
\
ov/StateSetView.java
\
ov/TextView.java
# ov/StateSetView.java \
JAVA_CLASSPATHS
:=
\
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment