Java How To Program Late Objects 10th Edition Deitel Solutions Manual pdf download
Java How To Program Late Objects 10th Edition Deitel Solutions Manual pdf download
https://testbankfan.com/product/java-how-to-program-late-
objects-10th-edition-deitel-solutions-manual/
https://testbankfan.com/product/java-how-to-program-late-
objects-10th-edition-deitel-test-bank/
https://testbankfan.com/product/java-how-to-program-early-
objects-10th-edition-deitel-solutions-manual/
https://testbankfan.com/product/java-how-to-program-early-
objects-10th-edition-deitel-test-bank/
https://testbankfan.com/product/java-how-to-program-early-
objects-11th-edition-deitel-solutions-manual/
C++ How to Program Late Objects Version 7th Edition
Deitel Test Bank
https://testbankfan.com/product/c-how-to-program-late-objects-
version-7th-edition-deitel-test-bank/
https://testbankfan.com/product/java-how-to-program-early-
objects-11th-edition-deitel-test-bank/
https://testbankfan.com/product/java-how-to-program-9th-edition-
deitel-solutions-manual/
https://testbankfan.com/product/java-how-to-program-9th-edition-
deitel-test-bank/
https://testbankfan.com/product/c-how-to-program-10th-edition-
deitel-solutions-manual/
jhtp_13_GraphicsJava2D.FM Page 1 Wednesday, July 16, 2014 12:37 PM
Objectives
In this chapter you’ll:
■ Understand graphics
contexts and graphics
objects.
■ Manipulate colors and fonts.
■ Use methods of class
Graphics to draw various
shapes.
■ Use methods of class
Graphics2D from the Java
2D API to draw various
shapes.
■ Specify Paint and Stroke
characteristics of shapes
displayed with
Graphics2D.
jhtp_13_GraphicsJava2D.FM Page 2 Wednesday, July 16, 2014 12:37 PM
Self-Review Exercises
13.1 Fill in the blanks in each of the following statements:
a) In Java 2D, method of class sets the characteristics of a stroke used
to draw a shape.
ANS:
b) Class helps specify the fill for a shape such that the fill gradually changes from
one color to another.
ANS:
c) The method of class Graphics draws a line between two points.
ANS:
d) RGB is short for , and .
ANS:
e) Font sizes are measured in units called .
ANS:
f) Class helps specify the fill for a shape using a pattern drawn in a BufferedImage.
ANS:
13.2 State whether each of the following is true or false. If false, explain why.
a) The first two arguments of Graphics method drawOval specify the center coordinate of
the oval.
ANS:
b) In the Java coordinate system, x-coordinates increase from left to right and y-coordi-
nates from top to bottom.
ANS:
c) Graphics method fillPolygon draws a filled polygon in the current color.
ANS:
d) Graphics method drawArc allows negative angles.
ANS:
e) Graphics method getSize returns the size of the current font in centimeters.
ANS:
f) Pixel coordinate (0, 0) is located at the exact center of the monitor.
ANS:
13.3 Find the error(s) in each of the following and explain how to correct them. Assume that g
is a Graphics object.
a) g.setFont("SansSerif");
ANS:
b) g.erase(x, y, w, h); // clear rectangle at (x, y)
ANS:
c) Font f = new Font("Serif", Font.BOLDITALIC, 12);
ANS:
d) g.setColor(255, 255, 0); // change color to yellow
ANS:
Exercises 3
d) True.
e) False. Font sizes are measured in points.
f) False. The coordinate (0,0) corresponds to the upper-left corner of a GUI component
on which drawing occurs.
13.3 a) The setFont method takes a Font object as an argument—not a String.
b) The Graphics class does not have an erase method. The clearRect method should be
used.
c) Font.BOLDITALIC is not a valid font style. To get a bold italic font, use Font.BOLD +
Font.ITALIC.
d) Method setColor takes a Color object as an argument, not three integers.
Exercises
NOTE: Solutions to the programming exercises are located in the ch13solutions folder.
Each exercise has its own folder named ex13_## where ## is a two-digit number represent-
ing the exercise number. For example, exercise 13.17’s solution is located in the folder
ex13_17.
13.4 Fill in the blanks in each of the following statements:
a) Class of the Java 2D API is used to draw ovals.
ANS: Ellipse2D.
b) Methods draw and fill of class Graphics2D require an object of type as their
argument.
ANS: Shape.
c) The three constants that specify font style are , and .
ANS: Font.PLAIN, Font.BOLD and Font.ITALIC.
d) Graphics2D method sets the painting color for Java 2D shapes.
ANS: setColor.
13.5 State whether each of the following is true or false. If false, explain why.
a) Graphics method drawPolygon automatically connects the endpoints of the polygon.
ANS: True.
b) Graphics method drawLine draws a line between two points.
ANS: True.
c) Graphics method fillArc uses degrees to specify the angle.
ANS: True.
d) In the Java coordinate system, values on the y-axis increase from left to right.
ANS: False. In the Java coordinate system, values on the y-axis increase from top to bottom.
e) Graphics inherits directly from class Object.
ANS: True.
f) Graphics is an abstract class.
ANS: True.
g) The Font class inherits directly from class Graphics.
ANS: False. Class Font inherits directly from class Object.
Exploring the Variety of Random
Documents with Different Content
Tantallon Castle.
The profit of walking in the footsteps of the past is that you learn
the value of the privilege of life in the present. The men and women
of the past had their opportunity and each improved it after his kind.
These are the same plains in which Wallace and Bruce fought for the
honour, and established the supremacy, of the kingdom of Scotland.
The same sun gilds these plains to-day, the same sweet wind blows
over them, and the same sombre, majestic ocean breaks in solemn
murmurs on their shore. "Hodie mihi, cras tibi,"—as it was written on
the altar skulls in the ancient churches. Yesterday belonged to them;
to-day belongs to us; and well will it be for us if we improve it. In
such an historic town as Berwick the lesson is brought home to a
thoughtful mind with convincing force and significance. So much has
happened here,—and every actor in the great drama is long since
dead and gone! Hither came King John, and slaughtered the people
as if they were sheep, and burnt the city,—himself applying the torch
to the house in which he had slept. Hither came Edward the First,
and mercilessly butchered the inhabitants, men, women, and
children, violating even the sanctuary of the churches. Here, in his
victorious days, Sir William Wallace reigned and prospered; and
here, when Menteith's treachery had wrought his ruin, a fragment of
his mutilated body was long displayed upon the bridge. Here, in the
castle, of which only a few fragments now remain (these being
adjacent to the North British railway station), Edward the First
caused to be confined in a wooden cage that intrepid Countess of
Buchan who had crowned Robert Bruce, at Scone. Hither came
Edward the Third, after the battle of Halidon Hill, which lies close by
this place, had finally established the English power in Scotland. All
the princes that fought in the wars of the Roses have been in
Berwick and have wrangled over the possession of it. Richard the
Third doomed it to isolation. Henry the Seventh declared it a neutral
state. By Elizabeth it was fortified,—in that wise sovereign's resolute
and vigorous resistance to the schemes of the Roman Catholic
church for the dominance of her kingdom. John Knox preached here,
in a church on Hide Hill, before he went to Edinburgh to shake the
throne with his tremendous eloquence. The picturesque, unhappy
James the Fourth went from this place to Ford Castle and Lady
Heron, and thence to his death, at Flodden Field. Here it was that Sir
John Cope first paused in his fugitive ride from the fatal field of
Preston, and here he was greeted as affording the only instance in
which the first news of a defeat had been brought by the
vanquished General himself. And within sight of Berwick ramparts
are those perilous Farne islands, where, at the wreck of the steamer
Forfarshire, in 1838, the heroism of a woman wrote upon the historic
page of her country, in letters of imperishable glory, the name of
Grace Darling. (There is a monument to her memory, in Bamborough
churchyard.) Imagination, however, has done for this region what
history could never do. Each foot of this ground was known to Sir
Walter Scott, and for every lover of that great author each foot of it
is hallowed. It is the Border Land,—the land of chivalry and song,
the land that he has endeared to all the world,—and you come to it
mainly for his sake.
The village of Norham lies a few miles west of Berwick, upon the
south bank of the Tweed,—a group of cottages clustered around a
single long street. The buildings are low and are mostly roofed with
dark slate or red tiles. Some of them are thatched, and grass and
flowers grow wild upon the thatch. At one end of the main highway
is a market-cross, near to which is a little inn. Beyond that and
nearer to the Tweed, which flows close beside the place, is a church
of great antiquity, set toward the western end of a long and ample
churchyard, in which many graves are marked with tall, thick,
perpendicular slabs, many with dark, oblong tombs, tumbling to
ruin, and many with short, stunted monuments. The church tower is
low, square, and of enormous strength. Upon the south side of the
chancel are five windows, beautifully arched,—the dog-toothed
casements being uncommonly complete specimens of that ancient
architectural device. This church has been restored; the south aisle
in 1846, by I. Bononi; the north aisle in 1852, by E. Gray. The
western end of the churchyard is thickly masked in great trees, and
looking directly east from this point your gaze falls upon all that is
left of the stately Castle of Norham, formerly called Ublanford,—built
by Flamberg, Bishop of Durham, in 1121, and restored by Hugh
Pudsey, another Prince of that See, in 1164. It must once have been
a place of tremendous fortitude and of great extent. Now it is wide
open to the sky, and nothing of it remains but roofless walls and
crumbling arches, on which the grass is growing and the pendent
bluebells tremble in the breeze. Looking through the embrasures of
the east wall you see the tops of large trees that are rooted in the
vast trench below, where once were the dark waters of the moat. All
the courtyards are covered now with sod, and quiet sheep nibble
and lazy cattle couch where once the royal banners floated and
plumed and belted knights stood round their king. It was a day of
uncommon beauty,—golden with sunshine and fresh with a
perfumed air; and nothing was wanting to the perfection of solitude.
Near at hand a thin stream of pale blue smoke curled upward from a
cottage chimney. At some distance the sweet voices of playing
children mingled with the chirp of small birds and the occasional
cawing of the rook. The long grasses that grow upon the ruin moved
faintly, but made no sound. A few doves were seen, gliding in and
out of crevices in the mouldering turret. And over all, and calmly and
coldly speaking the survival of nature when the grandest works of
man are dust, sounded the rustle of many branches in the heedless
wind.
The day was setting over Norham as I drove away,—the red sun
slowly obscured in a great bank of slate-coloured cloud,—but to the
last I bent my gaze upon it, and that picture of ruined magnificence
can never fade out of my mind. The road eastward toward Berwick
is a green lane, running between harvest-fields, which now were
thickly piled with golden sheaves, while over them swept great flocks
of sable rooks. There are but few trees in that landscape,—scattered
groups of the ash and the plane,—to break the prospect. For a long
time the stately ruin remained in view,—its huge bulk and serrated
outline, relieved against the red and gold of sunset, taking on the
perfect semblance of a colossal cathedral, like that of Iona, with vast
square tower, and chancel, and nave: only, because of its jagged
lines, it seems in this prospect as if shaken by a convulsion of nature
and tottering to its momentary fall. Never was illusion more perfect.
Yet as the vision faded I could remember only the illusion that will
never fade,—the illusion that a magical poetic genius has cast over
those crumbling battlements, rebuilding the shattered towers, and
pouring through their ancient halls the glowing tide of life and love,
of power and pageant, of beauty, light, and song.
THE END
FOOTNOTES
[1]
"In thy mind thou conjoinest life's practical
knowledge,
And a temper unmoved by the changes of fortune,
Whatsoever her smile or her frown,
Neither bowed nor elate,—but erect"
Transcriber's Notes
Inconsistencies in spelling and hyphenation have been retained.
"Corse" is an archaic form of "corpse". "Oftens" is an archaic adverb.
Page 121, added "a" (after a Worcester fight)
Page 311, changed "along" to "alone" (standing alone among ruins)
*** END OF THE PROJECT GUTENBERG EBOOK GRAY DAYS AND
GOLD IN ENGLAND AND SCOTLAND ***
1.D. The copyright laws of the place where you are located also
govern what you can do with this work. Copyright laws in most
countries are in a constant state of change. If you are outside
the United States, check the laws of your country in addition to
the terms of this agreement before downloading, copying,
displaying, performing, distributing or creating derivative works
based on this work or any other Project Gutenberg™ work. The
Foundation makes no representations concerning the copyright
status of any work in any country other than the United States.
1.E.6. You may convert to and distribute this work in any binary,
compressed, marked up, nonproprietary or proprietary form,
including any word processing or hypertext form. However, if
you provide access to or distribute copies of a Project
Gutenberg™ work in a format other than “Plain Vanilla ASCII” or
other format used in the official version posted on the official
Project Gutenberg™ website (www.gutenberg.org), you must,
at no additional cost, fee or expense to the user, provide a copy,
a means of exporting a copy, or a means of obtaining a copy
upon request, of the work in its original “Plain Vanilla ASCII” or
other form. Any alternate format must include the full Project
Gutenberg™ License as specified in paragraph 1.E.1.
• You pay a royalty fee of 20% of the gross profits you derive
from the use of Project Gutenberg™ works calculated using the
method you already use to calculate your applicable taxes. The
fee is owed to the owner of the Project Gutenberg™ trademark,
but he has agreed to donate royalties under this paragraph to
the Project Gutenberg Literary Archive Foundation. Royalty
payments must be paid within 60 days following each date on
which you prepare (or are legally required to prepare) your
periodic tax returns. Royalty payments should be clearly marked
as such and sent to the Project Gutenberg Literary Archive
Foundation at the address specified in Section 4, “Information
about donations to the Project Gutenberg Literary Archive
Foundation.”
• You comply with all other terms of this agreement for free
distribution of Project Gutenberg™ works.
1.F.