Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Antti Väyrynen
/
Moya
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 7d449469
authored
Feb 12, 2012
by
Tuukka Kivilahti, TKffTK
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
can I haz colorz
1 parent
45d90475
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
12 deletions
code/LanBortalWeb/WebContent/resources/cditools/products/edit.xhtml
code/LanBortalWeb/src/fi/insomnia/bortal/servlet/PlaceMap.java
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/content/NewsgroupView.java
code/LanBortalWeb/WebContent/resources/cditools/products/edit.xhtml
View file @
7d44946
...
@@ -39,6 +39,10 @@
...
@@ -39,6 +39,10 @@
<h:outputLabel
for=
"barcode"
value=
"#{i18n['product.barcode']}:"
/>
<h:outputLabel
for=
"barcode"
value=
"#{i18n['product.barcode']}:"
/>
<h:inputText
id=
"barcode"
value=
"#{productView.product.barcode}"
/>
<h:inputText
id=
"barcode"
value=
"#{productView.product.barcode}"
/>
<h:message
for=
"barcode"
/>
<h:message
for=
"barcode"
/>
<h:outputLabel
for=
"color"
value=
"#{i18n['product.color']}:"
/>
<h:inputText
id=
"color"
value=
"#{productView.product.color}"
/>
<h:message
for=
"color"
/>
<h:outputLabel
for=
"prepaid"
value=
"#{i18n['product.prepaid']}"
/>
<h:outputLabel
for=
"prepaid"
value=
"#{i18n['product.prepaid']}"
/>
<h:selectBooleanCheckbox
id=
"prepaid"
value=
"#{productView.product.prepaid}"
/>
<h:selectBooleanCheckbox
id=
"prepaid"
value=
"#{productView.product.prepaid}"
/>
...
...
code/LanBortalWeb/src/fi/insomnia/bortal/servlet/PlaceMap.java
View file @
7d44946
...
@@ -233,8 +233,7 @@ public class PlaceMap extends HttpServlet {
...
@@ -233,8 +233,7 @@ public class PlaceMap extends HttpServlet {
private
static
final
int
BORDER_WIDTH
=
2
;
private
static
final
int
BORDER_WIDTH
=
2
;
private
static
void
drawPlace
(
Place
p
,
Graphics2D
g
,
User
user
)
{
private
static
void
drawPlace
(
Place
p
,
Graphics2D
g
,
User
user
)
{
if
(
p
.
isDisabled
())
if
(
p
.
isDisabled
())
{
{
return
;
return
;
}
}
Color
color
=
null
;
Color
color
=
null
;
...
@@ -244,29 +243,33 @@ public class PlaceMap extends HttpServlet {
...
@@ -244,29 +243,33 @@ public class PlaceMap extends HttpServlet {
if
(
p
.
isReservedFor
(
user
))
{
if
(
p
.
isReservedFor
(
user
))
{
color
=
SELECTED_COLOR
;
color
=
SELECTED_COLOR
;
}
else
if
(
user
.
equals
(
p
.
getCurrentUser
())
}
else
if
(
user
.
equals
(
p
.
getCurrentUser
())
||
(
p
.
getGroup
()
!=
null
&&
user
.
equals
(
p
.
getGroup
().
getCreator
()))
||
(
p
.
getGroup
()
!=
null
&&
user
.
equals
(
p
.
getGroup
()
||
(
p
.
getPlaceReserver
()
!=
null
&&
user
.
equals
(
p
.
getPlaceReserver
().
getUser
())))
{
.
getCreator
()))
||
(
p
.
getPlaceReserver
()
!=
null
&&
user
.
equals
(
p
.
getPlaceReserver
().
getUser
())))
{
color
=
OWNED_COLOR
;
color
=
OWNED_COLOR
;
}
else
if
(
p
.
isTaken
())
{
}
else
if
(
p
.
isTaken
())
{
color
=
RESERVED_COLOR
;
color
=
RESERVED_COLOR
;
}
else
if
(
p
.
getProduct
().
getColor
()
!=
null
)
{
}
else
if
(
p
.
getProduct
().
getColor
()
!=
null
)
{
try
{
try
{
color
=
Color
.
decode
(
p
.
getProduct
().
getColor
());
color
=
Color
.
decode
(
p
.
getProduct
().
getColor
());
}
catch
(
NumberFormatException
x
)
{
}
catch
(
NumberFormatException
x
)
{
logger
.
error
(
"Cannot convert string {} to color."
,
p
.
getProduct
().
getColor
());
logger
.
error
(
"Cannot convert string {} to color."
,
p
.
getProduct
().
getColor
());
}
}
}
}
g
.
setColor
(
BORDER_COLOR
);
g
.
setColor
(
BORDER_COLOR
);
g
.
draw
(
new
Rectangle
(
p
.
getMapX
(),
p
.
getMapY
(),
p
.
getWidth
(),
p
.
getHeight
()));
g
.
draw
(
new
Rectangle
(
p
.
getMapX
(),
p
.
getMapY
(),
p
.
getWidth
(),
p
.
getHeight
()));
if
(
color
!=
null
)
{
if
(
color
!=
null
)
{
g
.
setColor
(
color
);
g
.
setColor
(
color
);
g
.
fill
(
new
Rectangle
(
p
.
getMapX
()
+
BORDER_WIDTH
,
p
.
getMapY
()
+
BORDER_WIDTH
,
p
.
getWidth
()
-
BORDER_WIDTH
,
p
.
getHeight
()
-
BORDER_WIDTH
));
g
.
fill
(
new
Rectangle
(
p
.
getMapX
()
+
BORDER_WIDTH
,
p
.
getMapY
()
+
BORDER_WIDTH
,
p
.
getWidth
()
-
BORDER_WIDTH
,
p
.
getHeight
()
-
BORDER_WIDTH
));
}
}
}
}
}
}
code/LanBortalWeb/src/fi/insomnia/bortal/web/cdiview/content/NewsgroupView.java
View file @
7d44946
...
@@ -4,7 +4,7 @@ import javax.ejb.EJB;
...
@@ -4,7 +4,7 @@ import javax.ejb.EJB;
import
javax.enterprise.context.ConversationScoped
;
import
javax.enterprise.context.ConversationScoped
;
import
javax.inject.Named
;
import
javax.inject.Named
;
import
com.sun.imageio.plugins.common.I18N
;
import
fi.insomnia.bortal.beans.NewsBeanLocal
;
import
fi.insomnia.bortal.beans.NewsBeanLocal
;
import
fi.insomnia.bortal.enums.apps.ContentPermission
;
import
fi.insomnia.bortal.enums.apps.ContentPermission
;
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment