Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
skin-designer
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
VideoLAN
skin-designer
Commits
2b71b37a
Commit
2b71b37a
authored
Dec 29, 2007
by
Daniel Dreibrodt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SubBitamp editing improved: preview can be zoomed
parent
0399979a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
26 deletions
+60
-26
README.TXT
README.TXT
+1
-0
src/vlcskineditor/resources/SubBitmapEditWindow.java
src/vlcskineditor/resources/SubBitmapEditWindow.java
+59
-26
No files found.
README.TXT
View file @
2b71b37a
...
@@ -3,6 +3,7 @@ VLC Skin Editor release 0.6.1b
...
@@ -3,6 +3,7 @@ VLC Skin Editor release 0.6.1b
Changelog:
Changelog:
-----------------------------------------------------------
-----------------------------------------------------------
0.7.0a - Preview can be saved as image
0.7.0a - Preview can be saved as image
- Improved SubBitmap editing
0.6.1b - Critical bufix for the Preview Window
0.6.1b - Critical bufix for the Preview Window
- Bugfix for slider points parsing and XML parsing
- Bugfix for slider points parsing and XML parsing
0.6.0b - Resources/windows/layouts/items can be edited by
0.6.0b - Resources/windows/layouts/items can be edited by
...
...
src/vlcskineditor/resources/SubBitmapEditWindow.java
View file @
2b71b37a
...
@@ -31,9 +31,14 @@ import javax.swing.*;
...
@@ -31,9 +31,14 @@ import javax.swing.*;
* Gives the user the possibilty to edit a SubBitmap visually
* Gives the user the possibilty to edit a SubBitmap visually
* @author Daniel Dreibrodt
* @author Daniel Dreibrodt
*/
*/
public
class
SubBitmapEditWindow
extends
JPanel
implements
MouseListener
,
MouseMotionListener
,
KeyListener
,
WindowListener
{
public
class
SubBitmapEditWindow
extends
JPanel
implements
ActionListener
,
MouseListener
,
MouseMotionListener
,
KeyListener
,
WindowListener
{
public
JFrame
frame
;
public
JFrame
frame
;
JScrollPane
scroll_pane
;
JPanel
zoom_panel
;
JButton
zoom_more
,
zoom_less
;
JLabel
zoom_label
;
int
z_fact
=
1
;
Bitmap
b
;
Bitmap
b
;
SubBitmap
sb
;
SubBitmap
sb
;
FrameUpdater
fu
;
FrameUpdater
fu
;
...
@@ -41,7 +46,7 @@ public class SubBitmapEditWindow extends JPanel implements MouseListener, MouseM
...
@@ -41,7 +46,7 @@ public class SubBitmapEditWindow extends JPanel implements MouseListener, MouseM
boolean
starteddragging
=
false
;
boolean
starteddragging
=
false
;
int
x1
,
y1
,
x2
,
y2
;
int
x1
,
y1
,
x2
,
y2
;
int
x1_org
,
y1_org
,
x2_org
,
y2_org
;
int
x1_org
,
y1_org
,
x2_org
,
y2_org
;
int
maxx
,
maxy
;
int
p_width
,
p_height
;
int
drawcount
;
int
drawcount
;
...
@@ -54,15 +59,28 @@ public class SubBitmapEditWindow extends JPanel implements MouseListener, MouseM
...
@@ -54,15 +59,28 @@ public class SubBitmapEditWindow extends JPanel implements MouseListener, MouseM
x2_org
=
x2
=
sb
.
x
+
sb
.
width
;
x2_org
=
x2
=
sb
.
x
+
sb
.
width
;
y2_org
=
y2
=
sb
.
y
+
sb
.
height
;
y2_org
=
y2
=
sb
.
y
+
sb
.
height
;
frame
=
new
JFrame
(
"Edit SubBitmap"
);
frame
=
new
JFrame
(
"Edit SubBitmap"
);
frame
.
setLayout
(
new
GridLayout
(
1
,
1
));
frame
.
setLayout
(
new
BorderLayout
());
frame
.
add
(
this
);
zoom_panel
=
new
JPanel
();
maxx
=
b
.
image
.
getWidth
();
zoom_panel
.
setLayout
(
new
FlowLayout
());
maxy
=
b
.
image
.
getHeight
();
zoom_less
=
new
JButton
(
"-"
);
setMinimumSize
(
new
Dimension
(
maxx
,
maxy
));
zoom_less
.
addActionListener
(
this
);
setPreferredSize
(
new
Dimension
(
maxx
,
maxy
));
zoom_panel
.
add
(
zoom_less
);
zoom_label
=
new
JLabel
(
"Zoom factor: 1x"
);
zoom_panel
.
add
(
zoom_label
);
zoom_more
=
new
JButton
(
"+"
);
zoom_more
.
addActionListener
(
this
);
zoom_panel
.
add
(
zoom_more
);
zoom_panel
.
setComponentOrientation
(
ComponentOrientation
.
LEFT_TO_RIGHT
);
frame
.
add
(
zoom_panel
,
BorderLayout
.
PAGE_START
);
p_width
=
b
.
image
.
getWidth
();
p_height
=
b
.
image
.
getHeight
();
setPreferredSize
(
new
Dimension
(
p_width
,
p_height
));
scroll_pane
=
new
JScrollPane
(
this
);
scroll_pane
.
setPreferredSize
(
new
Dimension
(
p_width
+
20
,
p_height
+
20
));
frame
.
add
(
scroll_pane
,
BorderLayout
.
CENTER
);
frame
.
pack
();
frame
.
pack
();
frame
.
setLocation
(
sb
.
frame
.
getX
()+
sb
.
frame
.
getWidth
()+
5
,
sb
.
frame
.
getY
());
frame
.
setLocation
(
sb
.
frame
.
getX
()+
sb
.
frame
.
getWidth
()+
5
,
sb
.
frame
.
getY
());
frame
.
set
Resizable
(
false
);
frame
.
set
MinimumSize
(
new
Dimension
(
200
,
100
)
);
frame
.
setVisible
(
true
);
frame
.
setVisible
(
true
);
fu
=
new
FrameUpdater
(
this
,
25
);
fu
=
new
FrameUpdater
(
this
,
25
);
fu
.
start
();
fu
.
start
();
...
@@ -74,18 +92,19 @@ public class SubBitmapEditWindow extends JPanel implements MouseListener, MouseM
...
@@ -74,18 +92,19 @@ public class SubBitmapEditWindow extends JPanel implements MouseListener, MouseM
if
(
b
.
image
==
null
)
return
;
if
(
b
.
image
==
null
)
return
;
if
(
drawcount
>=
40
)
drawcount
=
0
;
if
(
drawcount
>=
40
)
drawcount
=
0
;
g
.
clearRect
(
0
,
0
,
getWidth
(),
getHeight
());
g
.
clearRect
(
0
,
0
,
getWidth
(),
getHeight
());
g
.
drawImage
(
b
.
image
,
0
,
0
,
frame
);
g
.
drawImage
(
b
.
image
,
0
,
0
,
p_width
*
z_fact
,
p_height
*
z_fact
,
frame
);
//g.drawImage(b.image,0,0,frame);
g
.
setColor
(
Color
.
RED
);
g
.
setColor
(
Color
.
RED
);
int
[]
x
=
new
int
[
4
];
int
[]
x
=
new
int
[
4
];
x
[
0
]
=
x1
;
x
[
0
]
=
x1
*
z_fact
;
x
[
1
]
=
x2
;
x
[
1
]
=
x2
*
z_fact
;
x
[
2
]
=
x2
;
x
[
2
]
=
x2
*
z_fact
;
x
[
3
]
=
x1
;
x
[
3
]
=
x1
*
z_fact
;
int
[]
y
=
new
int
[
4
];
int
[]
y
=
new
int
[
4
];
y
[
0
]
=
y1
;
y
[
0
]
=
y1
*
z_fact
;
y
[
1
]
=
y1
;
y
[
1
]
=
y1
*
z_fact
;
y
[
2
]
=
y2
;
y
[
2
]
=
y2
*
z_fact
;
y
[
3
]
=
y2
;
y
[
3
]
=
y2
*
z_fact
;
if
(
drawcount
<=
20
||
starteddragging
)
if
(
drawcount
<=
20
||
starteddragging
)
g
.
drawPolygon
(
x
,
y
,
4
);
g
.
drawPolygon
(
x
,
y
,
4
);
drawcount
++;
drawcount
++;
...
@@ -102,16 +121,16 @@ public class SubBitmapEditWindow extends JPanel implements MouseListener, MouseM
...
@@ -102,16 +121,16 @@ public class SubBitmapEditWindow extends JPanel implements MouseListener, MouseM
y1_org
=
y1
;
y1_org
=
y1
;
x2_org
=
x2
;
x2_org
=
x2
;
y2_org
=
y2
;
y2_org
=
y2
;
x2
=
x1
=
e
.
getX
();
x2
=
x1
=
e
.
getX
()
/
z_fact
;
y2
=
y1
=
e
.
getY
();
y2
=
y1
=
e
.
getY
()
/
z_fact
;
}
}
else
{
else
{
if
(
e
.
getX
()
>=
maxx
)
x2
=
maxx
;
if
(
e
.
getX
()
/
z_fact
>=
p_width
)
x2
=
p_width
;
else
if
(
e
.
getX
()<
0
)
x2
=
0
;
else
if
(
e
.
getX
()
/
z_fact
<
0
)
x2
=
0
;
else
x2
=
e
.
getX
();
else
x2
=
e
.
getX
()
/
z_fact
;
if
(
e
.
getY
()
>=
maxy
)
y2
=
maxy
;
if
(
e
.
getY
()
/
z_fact
>=
p_height
)
y2
=
p_height
;
else
if
(
e
.
getY
()<
0
)
y2
=
0
;
else
if
(
e
.
getY
()
/
z_fact
<
0
)
y2
=
0
;
else
y2
=
e
.
getY
();
else
y2
=
e
.
getY
()
/
z_fact
;
}
}
}
}
public
void
mouseMoved
(
MouseEvent
e
)
{
public
void
mouseMoved
(
MouseEvent
e
)
{
...
@@ -181,4 +200,18 @@ public class SubBitmapEditWindow extends JPanel implements MouseListener, MouseM
...
@@ -181,4 +200,18 @@ public class SubBitmapEditWindow extends JPanel implements MouseListener, MouseM
}
}
public
void
windowDeactivated
(
WindowEvent
e
)
{
public
void
windowDeactivated
(
WindowEvent
e
)
{
}
}
public
void
actionPerformed
(
ActionEvent
e
)
{
if
(
e
.
getSource
().
equals
(
zoom_less
))
{
if
(
z_fact
>
1
)
z_fact
--;
zoom_label
.
setText
(
"Zoom factor: "
+
z_fact
+
"x"
);
setSize
(
p_width
*
z_fact
,
p_height
*
z_fact
);
setPreferredSize
(
new
Dimension
(
p_width
*
z_fact
,
p_height
*
z_fact
));
}
else
if
(
e
.
getSource
().
equals
(
zoom_more
))
{
if
(
z_fact
<
16
)
z_fact
++;
zoom_label
.
setText
(
"Zoom factor: "
+
z_fact
+
"x"
);
setSize
(
p_width
*
z_fact
,
p_height
*
z_fact
);
setPreferredSize
(
new
Dimension
(
p_width
*
z_fact
,
p_height
*
z_fact
));
}
}
}
}
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