Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
chart_inheritance
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Brady James Garvin
chart_inheritance
Commits
078d90ed
Commit
078d90ed
authored
8 years ago
by
Brady James Garvin
Browse files
Options
Downloads
Patches
Plain Diff
Fixed simulated duck typing in App.
parent
571e3eea
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
chart_inheritance/src/main/java/edu/unl/cse/soft160/chart_inheritance/App.java
+11
-8
11 additions, 8 deletions
.../main/java/edu/unl/cse/soft160/chart_inheritance/App.java
with
11 additions
and
8 deletions
chart_inheritance/src/main/java/edu/unl/cse/soft160/chart_inheritance/App.java
+
11
−
8
View file @
078d90ed
...
@@ -46,16 +46,19 @@ public class App extends JFrame {
...
@@ -46,16 +46,19 @@ public class App extends JFrame {
context
.
setFont
(
TEXT_FONT
);
context
.
setFont
(
TEXT_FONT
);
context
.
setColor
(
TEXT_COLOR
);
context
.
setColor
(
TEXT_COLOR
);
context
.
setColor
(
Color
.
BLUE
);
context
.
setColor
(
Color
.
BLUE
);
for
(
Class
<?>
type
=
chart
.
getClass
();
type
!=
null
;
type
=
type
.
getSuperclass
())
{
try
{
try
{
chart
.
getClass
().
getDeclaredMethod
(
"draw"
,
Graphics2D
.
class
).
invoke
(
chart
,
context
);
type
.
getDeclaredMethod
(
"draw"
,
Graphics2D
.
class
).
invoke
(
chart
,
context
);
break
;
}
catch
(
NoSuchMethodException
exception
)
{
}
catch
(
NoSuchMethodException
exception
)
{
throw
new
RuntimeException
(
exception
)
;
continue
;
}
catch
(
InvocationTargetException
exception
)
{
}
catch
(
InvocationTargetException
exception
)
{
throw
new
RuntimeException
(
exception
);
throw
new
RuntimeException
(
exception
);
}
catch
(
IllegalAccessException
exception
)
{
}
catch
(
IllegalAccessException
exception
)
{
throw
new
RuntimeException
(
exception
);
throw
new
RuntimeException
(
exception
);
}
}
}
}
}
public
static
void
main
(
String
...
arguments
)
{
public
static
void
main
(
String
...
arguments
)
{
String
[]
labels
=
{
"Alpha"
,
"Bravo"
,
"Charlie"
,
"Delta"
,
"Echo"
,
"Foxtrot"
,
"Golf"
};
String
[]
labels
=
{
"Alpha"
,
"Bravo"
,
"Charlie"
,
"Delta"
,
"Echo"
,
"Foxtrot"
,
"Golf"
};
...
...
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