Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LibLaserCut
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Elektronikföreningen Admittansen
LibLaserCut
Commits
6945cebc
Commit
6945cebc
authored
12 years ago
by
Thomas Oster
Browse files
Options
Downloads
Patches
Plain Diff
Better Serialization
parent
2fc2c194
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/com/t_oster/liblasercut/TimeIntensiveOperation.java
+39
-29
39 additions, 29 deletions
src/com/t_oster/liblasercut/TimeIntensiveOperation.java
with
39 additions
and
29 deletions
src/com/t_oster/liblasercut/TimeIntensiveOperation.java
+
39
−
29
View file @
6945cebc
/**
* This file is part of VisiCut.
*
Copyright (C) 2012 Thomas Oster <thomas.oster@rwth-aachen.de>
*
RWTH Aachen University - 52062 Aachen, Germany
*
*
VisiCut is free software: you can redistribute it and/or modify
*
it under the terms of the GNU Lesser General Public License as published b
y
*
the Free Software Foundation, either version 3 of the License, or
*
(at your option) any later version.
*
*
VisiCut is distributed in the hope that it will be useful,
*
but WITHOUT ANY WARRANTY; without even the implied warranty of
*
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
*
GNU Lesser General Public License for more details.
*
*
You should have received a copy of the GNU Lesser General Public L
icense
*
along with VisiCut. If not, see <http://www.gnu.org/licenses/>.
*
*/
* This file is part of VisiCut.
Copyright (C) 2012 Thomas Oster
*
<thomas.oster@rwth-aachen.de> RWTH Aachen University - 52062 Aachen, Germany
*
*
VisiCut is free software: you can redistribute it and/or modify it under the
*
terms of the GNU Lesser General Public License as published by the Free
*
Software Foundation, either version 3 of the License, or (at your option) an
y
*
later version.
*
*
VisiCut is distributed in the hope that it will be useful, but WITHOUT ANY
*
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
*
A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
*
details.
*
*
You should have received a copy of the GNU Lesser General Public License
*
along with VisiCut. If not, see <http://www.gnu.org/l
icense
s/>.
*
*/
package
com.t_oster.liblasercut
;
import
java.util.LinkedList
;
import
java.util.List
;
/**
* This class is for easy support for Progress Listeners
* just extend this class and use the fireProgressChanged
* and fireTaskNameChanged method.
*
* This class is for easy support for Progress Listeners just extend this class
* and use the fireProgressChanged and fireTaskNameChanged method.
*
* @author Thomas Oster <thomas.oster@rwth-aachen.de>
*/
public
abstract
class
TimeIntensiveOperation
{
private
List
<
ProgressListener
>
listeners
=
new
LinkedList
<
ProgressListener
>();
private
List
<
ProgressListener
>
listeners
=
null
;
private
List
<
ProgressListener
>
getListeners
()
{
if
(
listeners
==
null
)
{
listeners
=
new
LinkedList
<
ProgressListener
>();
}
return
listeners
;
}
public
void
addProgressListener
(
ProgressListener
l
)
{
l
isteners
.
add
(
l
);
getL
isteners
()
.
add
(
l
);
}
public
void
removeProgressListener
(
ProgressListener
l
)
{
l
isteners
.
remove
(
l
);
getL
isteners
()
.
remove
(
l
);
}
public
void
fireProgressChanged
(
int
progress
)
{
for
(
ProgressListener
l
:
l
isteners
)
for
(
ProgressListener
l
:
getL
isteners
()
)
{
l
.
progressChanged
(
this
,
progress
);
}
...
...
@@ -53,15 +61,17 @@ public abstract class TimeIntensiveOperation
public
void
fireTaskChanged
(
String
name
)
{
for
(
ProgressListener
l
:
l
isteners
)
for
(
ProgressListener
l
:
getL
isteners
()
)
{
l
.
taskChanged
(
this
,
name
);
}
}
private
int
progress
=
0
;
protected
void
setProgress
(
int
progress
){
if
(
progress
!=
this
.
progress
){
protected
void
setProgress
(
int
progress
)
{
if
(
progress
!=
this
.
progress
)
{
this
.
progress
=
progress
;
this
.
fireProgressChanged
(
this
.
progress
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment