Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
yotta
/
pictogram
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
60
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
2c261c44
authored
Jan 22, 2016
by
Fernando Martínez Santiago
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
bug: categorias sin elementos no soportado
parent
b381f832
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
3 deletions
android/Pictogrammar/app/src/main/java/com/yottacode/pictogram/grammar/Vocabulary.java
android/Pictogrammar/app/src/main/java/com/yottacode/pictogram/grammar/Vocabulary.java
View file @
2c261c44
...
...
@@ -119,11 +119,17 @@ public class Vocabulary implements Iterable<Picto>, iRestapiListener, iVocabular
PCBcontext
.
getPcbdb
().
addPicto
(
pic
);
}
private
boolean
empty_category
(
int
pic_cat
)
{
return
this
.
pictos
.
get
(
pic_cat
)==
null
;}
private
int
find_picto_index
(
int
pic_cat
,
int
pic_id
)
{
LinkedList
<
Picto
>
pictos_cat
=
this
.
pictos
.
get
(
pic_cat
);
int
index
=-
1
;
for
(
int
i
=
0
;
i
<
pictos_cat
.
size
()
&&
index
==-
1
;
i
++)
Log
.
d
(
"Vocabulary BORRA 2.1"
,
pic_cat
+
" "
+
pic_id
);
for
(
int
i
=
0
;
i
<
pictos_cat
.
size
()
&&
index
==-
1
;
i
++)
{
Log
.
d
(
"Vocabulary BORRA 2.15"
,
i
+
":"
+
pictos_cat
.
get
(
i
).
get_id
());
if
(
pictos_cat
.
get
(
i
).
get_id
()==
pic_id
)
index
=
i
;
}
Log
.
d
(
"Vocabulary BORRA 2.2"
,
pic_cat
+
" "
+
pic_id
+
" "
+
index
);
return
index
;
}
/**
...
...
@@ -144,7 +150,7 @@ public class Vocabulary implements Iterable<Picto>, iRestapiListener, iVocabular
*/
public
void
modifyAttsPicto
(
int
pic_cat
,
int
pic_id
,
JSONObject
attrs
)
{
Log
.
d
(
"Vocabulary MOD BORRA 2"
,
pic_cat
+
"---"
+
pic_id
);
Picto
picto
=
this
.
pictos
.
get
(
pic_cat
).
get
(
find_picto_index
(
pic_cat
,
pic_id
));
picto
.
set_json_attr
(
attrs
);
PCBcontext
.
getPcbdb
().
modifyPicto
(
pic_id
,
attrs
.
toString
());
...
...
@@ -190,7 +196,10 @@ public class Vocabulary implements Iterable<Picto>, iRestapiListener, iVocabular
* @return
*/
private
boolean
isVisibleCategory
(
int
id
)
{
if
(
empty_category
(
id
))
return
false
;
boolean
visible
=
false
;
for
(
Picto
picto
:
this
.
pictos
.
get
(
id
))
{
visible
=
picto
.
is_enabled
();
if
(
visible
)
break
;
...
...
@@ -289,7 +298,7 @@ public class Vocabulary implements Iterable<Picto>, iRestapiListener, iVocabular
}
case
update:
{
Log
.
d
(
"Vocabulary.java"
,
"
Entra en el case update. Picto cat: "
+
picto_cat
+
" y p
icto_id: "
+
picto_id
);
Log
.
d
(
"Vocabulary.java"
,
"
Update cat"
+
picto_cat
+
".
icto_id: "
+
picto_id
);
modifyAttsPicto
(
picto_cat
,
picto_id
,
args
);
break
;
}
...
...
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