Mac OS X Unleashed

Mac OS X Unleashed

By John Ray and William C. Ray

Other Applications

Three more applications will be discussed briefly in this chapter. They don't quite fit anywhere else in the book, so if you're looking for logic to this grouping, that's about as far as you're going to get! This grab bag of miscellaneous applications consists of Applet Launcher, Text Edit, Chess, and DVD player.

Applet Launcher

Most of the time, you'll start Java within Mac OS X either by visiting a Web page in your browser, or by double-clicking a Mac OS X–packaged Java application. In the event that you want to launch Java applications outside of a Web browser, or from a non-natively packaged Java application, you'll need some additional tools.

The Applet Launcher (Path: /Applications/Utilities/Applet Launcher) provides a simple method of launching an applet that is located at a Web (http://) or file (file://) URL.

The Launcher opens windows with a URL field at startup. This is shown in Figure 6.42. To launch an Applet, enter a URL to the containing HTML page within the field, and then click the Launch button. For local applets, click the Open button, or choose Open (Command+O) from the File menu.

06fig42.gif

Figure 6.42 Enter a URL and click Launch to start an applet.

The pop-up menu button at the right of the URL field contains a list of recently visited URLs. You can choose one from the list to quickly jump to it.

Menus and Preferences

The Applet Launcher is a port of the Mac OS 9 Applet Launcher utility and has not been cleanly ported to Mac OS X. Although it works, you'll notice a variety of visual anomalies, including the Preferences panel located under the Edit menu.

Very little configuration can be performed on Applet Launcher. If you want to clear the pop-up history of recent Applets, use the Clear History button in the Preferences panel (under Edit).

The Applets menu contains shortcuts to several simple demonstration applets. Choosing an item from the list will launch it within the Applet Viewer.

Quitting the Applet Viewer quits all open applets.

Java Applications

Java applications are a breed apart from applets. Applications do not rely on an HMTL file for launching information, nor can they be started from the Applet Launcher.

To run a Java application that is stored as a .class or .jar file, you must open the Terminal application to a command prompt. Chapter 12 will begin your introduction to the Unix underpinnings in OS X.

To execute a Java application based on a class filename use the following command:

java <theclassfile>

Alternatively, to launch a Java application that has been packaged as a .jar file, you must alter the command slightly:

java -jar <jarfilename>

To run most Java applications, you will need to be comfortable using the command line and might have to alter configuration files manually depending on the installation instructions. The information provided here is just a starting point.

TextEdit

Who among us hasn't searched our drives at one point in time and found 20 or 30 copies of SimpleText laying around on the system? For years, the Mac OS didn't automatically install a text editor or reader with the system. Application installers took it upon themselves to install SimpleText, Apple's simple styled-text editor. Over time, you could amass quite a collection of different (and identical) versions of the little editor.

In Mac OS X, Apple introduces TextEdit(Path: /Applications/TextEdit), the modern replacement for SimpleText. TextEdit works in a similar way as SimpleText, but saves files using the RTF (Rich Text Format) standard, and handles Unicode editing as well. RTF files can be opened in popular word-processing programs, such as Microsoft Word, and display all formatting information.

Like the Stickies application covered at the beginning of this chapter, TextEdit uses many of the built-in OS X features to provide advanced control over text and fonts. For more information about the individual font controls, see Chapter 10.

When started, TextEdit will open a new Untitled.rtf document for you to begin working. If you'd like to open an existing document, choose Open (Command+O) from the File menu.

TextEdit's Open dialog box will enable you to select any type of file, including binary files such as images. To read a file, however, it must be a supported document type such as plain text, HTML, or RTF. By default, TextEdit will open HTML documents and display the styled information similar to a Web browser. Figure 6.43 demonstrates TextEdit's rich text editing capabilities. To open an HTML file and edit the source code, you will need to adjust the preferences.

06fig43.jpg

Figure 6.43 TextEdit can edit styled text documents stored in HTML or RTF.

For the most part, you should be able to open TextEdit and start creating and editing text documents. However, a number of preferences and features exist that you can use to customize its appearance and functionality.

Preferences

The TextEdit Preferences panel, shown in Figure 6.44, controls the default application preferences. Most of these options can be chosen from the menu bar and stored on a per-document basis, as well as for the entire application.

06fig44.jpg

Figure 6.44 The TextEdit preferences can control a range of features.

Use the Set buttons in the Preferences panel to choose new default fonts for rich text and plain text documents. The default fonts are Helvetica 12 and Monaco 10, respectively.

The New Document Format section of the panel includes options for

The New Window Size section includes a Width setting option, where you can specify the width of new windows in characters, as well as a Height setting option where you can set the height of new windows in lines.

To have TextEdit automatically check your spelling as you type, select the Check spelling as you type check box within the Editing section. Misspelled words will be underlined in red. Press Ctrl and click the misspelled word to open a contextual menu that enables you to choose from a list of corrections, ignore the word, or add it (learn) to the OS X dictionary.

The Savings options include

When opening or saving a document, TextEdit gives you the opportunity to override automatic detection of the appropriate file encoding type to use. To choose an alternative encoding, such as Unicode, use the pop-up menus.

Allowing automatic detection enables TextEdit to open files created on alternative operating systems, such as Windows, and transparently translate end-of-line characters.

By default, TextEdit attempts to read style information in whatever files it is opening. To disable rich text commands in HTML or RTF files, click the corresponding check box. Ignoring the style information opens the document as a plain text file, showing all the control codes and tags used to embed the original styles. This is required for editing HTML tags within a Web page.

To save your settings, close the Preferences window. To revert to the original configuration, click Revert to Default Settings.

Menus

The TextEdit menus provide control over fonts and other document-specific information. Most of the application preferences can be overridden on a per-document basis from the menu system.

Open, save, and print documents using the File menu, which includes the following options:

The Edit menu contains the basic copy and paste functions, along with the find and replace and spell-checking features introduced in Stickies.

The Format menu enables you to control your font settings, and text alignment. In addition, you can toggle wrapping modes, as well as rich and plain text, and hyphenation.

Rulers

At the beginning of the chapter, you saw the Find/Replace and Spell Checking objects that are common in Mac OS X. The Ruler object, accessed from the Text subheading of the Format menu, is another common component.

Figure 6.45 shows a TextEdit window that includes the ruler—another common Cocoa object. Using the ruler, you can visually adjust tabs and other layout features of the active document.

06fig45.gif

Figure 6.45 The ruler enables you control text alignment within the active document window.

The formatting and placement of text can be adjusted on the fly when the TextEdit ruler is active. Using the ruler, you can easily and visually change these settings:

TextEdit is an intuitive replacement to SimpleText, but the new font configuration and Unicode text entry systems can be a bit confusing. Chapter 10's font information should shed some light on how to truly take advantage of these features.

Chess

Now for the entertainment. The first fun application is Chess (Path: /Applications/Chess). Microsoft includes various card games on its systems, but Apple decided to package something a bit more suited to the intellectual needs of its customers—a full-featured Chess game. Originally shipped with NeXTSTEP, Chess has been updated to work with Mac OS X and even includes support for speech recognition.

In all honesty, the underlying chess engine isn't Apple's, but that of the GNUChess, a free Chess application that has existed for the Unix platform since the mid-1980s. Apple's interface for the application, shown in Figure 6.46, is simply beautiful.

06fig46.jpg

Figure 6.46 Chess is a GUI front end to GNUChess.

When Chess is first started, it will display a new board ready for play. Move the pieces by dragging them from their original position to the desired location. If a move is invalid, Mac OS X will play the system beep, refuse the move, and display a message in the window's title bar.

Preferences

To control the game's difficulty, or change to a computer-computer or human-human game, open the Application Preferences panel. The Chess preferences are shown in Figure 6.47.

06fig47.jpg

Figure 6.47 Control how badly you will lose using the Preferences panel.

Use Chess's preferences to control how difficult the game will be, who is playing, and whether speech recognition should be used:

Click Set to start a new game using the preferences you've chosen.

A few additional preferences can be accessed by choosing the Controls option, from the File menu. Within the Controls panel, each player is represented by a chess piece and her name, as shown in Figure 6.48.

06fig48.jpg

Figure 6.48 The Controls set some additional game preferences.

Clicking the color well to the right of the player name sets the color for that player's pieces. The color is not applied until Set Piece Color is clicked.

Beneath each player's settings is a white progress bar. When the computer is thinking about a move, the graph will draw in (from left to right), to indicate how close the computer is to making a move. To force the computer to move before it has finished, click the Force Computer To Move button.

Finally, if you've selected a computer vs. computer game in the preferences, the game won't start until you click Start Computer vs. Computer Game in this panel.

Menus

The File menu can save or open stored games and control player colors. Options available in the File menu include

The Move menu is used to ask for a hint, and replay or take back the last move. In a sense, the Move menu lets you cheat. The three options to choose from are

Use the View menu to toggle between a grayscale two-dimensional representation of the board (Shift+Command+A) and the default 3D board (Shift+Command+B)

DVD Player

If you initially purchased Mac OS X with the hope of having a modern operating system that would never crash and still let you use all your hardware, you were probably slightly disappointed. One of the most visible missing features was a DVD player. The only way to play DVDs was to boot into Mac OS 9.x. Apple has fixed this shortcoming with the release of Mac OS X 10.1. Included in this new version of the operating system is DVD Player (Path: /Applications/DVD Player), a very-much improved version of Apple's previous DVD player application.

To start the DVD Player, simply insert a video DVD into your system, or double-click the application icon. By default, Mac OS X will launch the DVD Player automatically when it detects a new disk has been mounted. On startup, a video window and playback controller will appear onscreen. The playback controller is shown in Figure 6.49. Although I would have loved to provide a screenshot of the video window, this is not permitted with the current DVD Player application.

06fig49.gif

Figure 6.49 The DVD Player returns in Mac OS X 10.1.

Use the controller window as you would a standard DVD remote. Basic playback buttons are provided, along with a selection control in the middle, and volume slider on the bottom.

Six additional advanced controls are accessible by clicking the three dots at the edge of the controller window. This opens a drawer containing Slow, Step, Return, Subtitle, Audio, and Angle buttons. In Figure 6.49, the controller window is shown with the drawer exposed. If you'd prefer a horizontally oriented player control, choose Horizontal (Shift+Command+H) from the Controller Type submenu of the Controls menu. You can switch back to the vertical layout at any time by using the Vertical (Shift+Command+V) option in the same menu.

To navigate onscreen selections without the use of the controller, you can simply point and click at a DVD menu item to select it. To navigate with the keyboard, use the arrow keys and Return key.

Preferences

The DVD Player application preferences offer a few minor modifications to the playback process and the controller. There are two panels within the preferences window: Player and Disc.

The Player panel is shown in Figure 6.50.

06fig50.jpg

Figure 6.50 Adjust how the video and controller appear onscreen.

Using the pop-up menu within the Player panel, you can choose the default size of the playback area when in full-screen mode. You can also choose to enable resizing of the viewer and have the application automatically hide the DVD controller when it hasn't been used for a specified amount of time.

The Disc panel, shown in Figure 6.51, sets options that apply to the DVD itself.

06fig51.jpg

Figure 6.51 The Disc panel controls basic playback options.

By default, the DVD Player will start when a DVD is inserted. To control whether the computer will go into full-screen mode and immediately start playing the movie, use the Start Up options in this panel. The Language settings control the default language used for audio, subtitles, and menus. Not all languages are available for all disks, so don't assume any of the choices given is always valid.

Finally, some DVDs include DVD@ccess Web links. These are embedded hot spots that link to Internet web sites. To enable the DVD Player to recognize and react to these links, check the Enable DVD@ccess Web Links check box.

Menus

The DVD Player menus feature controls for most of the DVD features. Although many of these functions are found within the graphical controller, the menu offers the advantage of having keyboard shortcuts for almost anything you could want to do. This, coupled with a remote control, can turn your Macintosh into a true DVD playback system.

The Video menu shifts between three video sizes and toggles in and out of full-screen mode. Use Command+1, Command+2, and Command+3 to select half size, normal, and maximum size viewing areas, respectively. Command+0 toggles in and out of full-screen mode.

The Controls menu is used to start, stop, and navigate during playback. The following options are available:

The Window menu offers the ability to hide each of the DVD Player windows individually as well as display information (Control+I) about the disk, time remaining, and so on.

Share ThisShare This

Informit Network