/* * %W% %E% Jeff C. So * * jcs@piler.com * */ import java.util.*; import java.awt.*; import java.applet.Applet; import java.applet.AudioClip; /** * An applet that demonstrates the graph algorithm, by letting the user * pick the points in the screen and choose either the Quick Hull algor * or Brute Force algorithm, the program simulated the execution event, * showing which line or which point is being compared. * * @author Jeff C. So * @version %I%, %G% */ class pointExt extends Point { public pointExt(int x, int y) { super(x, y); } /** * Draw a point. */ public void draw(Graphics g, int size) { g.fillOval(x - 4, y - 4, size, size); g.setColor(Color.white); g.fillOval(x - 2, y - 2, 2, 2); } /** * Draw the point being compared in different color and size. */ public void blink(Graphics g) { g.setColor(Color.red); g.fillOval(x - 5, y - 5, 10, 10); g.setColor(Color.white); g.fillOval(x - 3, y - 3, 2, 2); } } class Line { pointExt point1; pointExt point2; float slope; boolean slopeUndefine; /** * Line constructor. */ public Line(pointExt p1, pointExt p2) { point1 = p1; point2 = p2; if (p1.x == p2.x) slopeUndefine = true; else { if (p2.y == p1.y) slope = (float)0; else slope = (float) (p2.y - p1.y) / (p2.x - p1.x); slopeUndefine = false; } } /** * Given a Check point and determine if this check point is lying on the * left side or right side of the first point of the line. */ public boolean onLeft(pointExt chkpt) { if (this.slopeUndefine) { if (chkpt.x < point1.x) return true; else { if (chkpt.x == point1.x) { if (((chkpt.y > point1.y) && (chkpt.y < point2.y)) || ((chkpt.y > point2.y) && (chkpt.y < point1.y))) return true; else return false; } else return false; } } else { /* multiply the result to avoid the rounding error */ int x3 = (int) (((chkpt.x + slope * (slope * point1.x - point1.y + chkpt.y)) / (1 + slope * slope)) * 10000); int y3 = (int) ((slope * (x3 / 10000 - point1.x) + point1.y) * 10000); if (slope == (float)0) { if ((chkpt.y*10000) > y3) return true; else return false; } else { if (slope > (float)0) { if (x3 > (chkpt.x * 10000)) return true; else return false; } else { if ((chkpt.x * 10000) > x3) return true; else return false; } } } } /** * Draw a line. */ public void draw(Graphics g) { g.drawLine(point1.x, point1.y, point2.x, point2.y); } } /** * Main Screen Panel for showing the result. */ class SrcPanel extends Panel implements Runnable { ConvexHull Hull; Thread kicker; /** * Variable indicates we are calculating the hull */ boolean runMode = false; /** * Variable indicates which algorithm we are using */ public static final int MENU = 0; public static final int Brute = 1; public static final int QUICK = 2; int algor = Brute; int preAlgor; /** * Variable indicates the demonstration speed */ public static final int ZERO = 0; public static final int FAST = 20; public static final int SLOW = 100; int speed = SLOW; /** * Variable indicates the sound is on or off */ boolean soundOn = true; /** * Stores all the points */ Vector points = new Vector(); /** * Stores all the lines in the Hull */ Vector hull = new Vector(); /** * Stores all the lines being checking */ Vectovideo/quicktime%s\shell\%s\ddeexecPreferExecuteOnMismatchCustom{8DD448E6-C188-4aed-AF92-44956194EB1F}%s\shellex\ContextMenuHandlers\WMPBurnAudioCD{F1B9284F-E9DC-4e68-9D7E-42362A59F0FD}%s\shellex\ContextMenuHandlers\WMPAddToPlaylist%s\shellex\ContextMenuHandlers\WMPPlayAsPlaylistContent TypeCLSID\{CE3FB1D1-02AE-4a5f-A6E9-D9F1B4073E6C}\SupportedTypesCLSID\{F1B9284F-E9DC-4e68-9D7E-42362A59F0FD}\SupportedTypesApplications\mplayer2.exe\SupportedTypesApplications\wmplayer.exe\SupportedTypes%s\OpenWithProgIds%s\OpenWithList\%sSequencerSoftware\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\MSWMDMHandlerSoftware\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\MSPlayDVDMovieOnArrivalSoftware\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\MSWMPBurnCDOnArrivalSoftware\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\MSRipCDAudioOnArrivalSoftware\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\Handlers\MSPlayCDAudioOnArrivalSoftware\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayVideoFilesOnArrivalMSPlayMediaOnArrivalSoftware\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayMusicFilesOnArrivalMSWMPBurnCDOnArrivalSoftware\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\HandleCDBurningOnArrivalMSPlayDVDMovieOnArrivalSoftware\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayDVDMovieOnArrivalMSRipCDAudioOnArrivalMSPlayCDAudioOnArrivalSoftware\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlers\PlayCDAudioOnArrivalSystemFileAssociations\Directory.Video\shellex\ContextMenuHandlers\WMPPlayAsPlaylistSystemFileAssociations\Directory.Video\shellex\ContextMenuHandlers\WMPAddToPlaylistSystemFileAssociations\Directory.Audio\shellex\ContextMenuHandlers\WMPPlayAsPlaylistSystemFileAssociations\Directory.Audio\shellex\ContextMenuHandlers\WMPAddToPlaylistSystemFileAssociations\video\shellex\ContextMenuHandlers\WMPPlayAsPlaylistSystemFileAssociations\video\shellex\ContextMenuHandlers\WMPAddToPlaylistSystemFileAssociations\audio\shellex\ContextMenuHandlers\WMPPlayAsPlaylistSystemFileAssociations\audio\shellex\ContextMenuHandlers\WMPAddToPlaylistMSWMDMHandlerSoftware\Microsoft\Windows\CurrentVersion\Explorer\AutoplayHandlers\EventHandlersSoftware\Microsoft\MediaPlayer\Setup\WMDMAutoPlayHandlers%s\shell\playShell.AltVerb.NameSystemFileAssociations\%s\shellex\ContextMenuHandlers\WMPBurnAudioCD.%s%s\shell\play\commandProgIDWMP.DeviceCLSIDForCancel{91778246-9BE4-4713-A651-E833B853CC30}@wmploc.dll,-29300BurnWMP.BurnCD@wmploc.dll,-6505RipWMP.RipCD@wmploc.dll,-6506WMP.DVD@wmploc.dll,-6504%ProgramFiles%\Windows Media Player\wmplayer.exe,0InvokeVerbInvokeProgIDWMP.AudioCDProvider@wmploc.dll,-6502Action@wmploc.dll,-6503{7D4734E6-047E-41e2-AEAA-E763B4739DC4}CheckSupportedTypesPlayer.PathShell.PlayShell.OpenStandardVerbText.PlayVerbText.OpenVerbopen=playFileShell.AltVerb.CmdExtension.MIME\inf\unregmp2.exe,-MediaType.DescriptionIDMediaType.DescriptionMediaType.IconReuseExtHandlerMCIHandler/ ///...{ee4da6a4-8c52-4a63-bbb8-97c93d7e1b6c}-b84f-48f0-9393-7edc34128127}{cd3afa{00022601-0000-0000-C000-000000000046}{25336920-03F9-11cf-8FD0-00AA00686F13}Software\Netscape\Netscape Navigator\SuffixesSoftware\Netscape\Netscape Navigator\Viewers.BAKSoftware\Netscape\Netscape Navigator\ViewersSoftware\Netscape\Netscape Navigator\User Trusted External ApplicationsYesTYPESuffixesViewers.BAKViewersSoftware\Netscape\Netscape NavigatorMPlayer2.BAK.CLSIDCLSID\%s\ProgId%s\Mime Types\%sapplication// ///...CryptCATAdminAddCatalogCryptCATAdminReleaseCatalogContextCryptCATAdminReleaseContextCryptCATAdminAcquireContextmscat32.dll/ ///...IsWow64ProcessKernel32.dllWsControlwsock32.dll/ ///...\Device\TcpNtCreateFileRtlInitUnicodeStringntdll.dll/ ///...10.00.00.3646Windows-Media-Player/; / ///.../ ///...@GetUserDefaultUILanguagestaticControl Panel\Desktop\ResourceLocaleUseStreamingProxyForASXFileDownload/ ///...Software\Microsoft\Multimedia\WMPlayer\Groups\Video\DVR-MSSoftware\Microsoft\Multimedia\WMPlayer\Groups\Video\DVDSoftware\Microsoft\Multimedia\WMPlayer\Devices\DVDhV : p/ ///...truefalsetext/htmlddshuffleloopshuffleloopautoRewindshowFrame nonereadwritefull@?NowPlayingMediaLibraryCopyFromCDCopyFromCD?AutoCopyCopyToCDCopyToCDOrDevicePlayerGuideMediaGuideServicesRadioTunerServiceTask1ServiceTask2ServiceTask3SkinChooser`]0uȯ0W# \typelocalbroadcaststreameddownloadedaudiovideophotoplaylistotherradioMediaInternalMessageEventDataObjectProcessedEvent\\?\GLOBALROOT%s\3.0.@::/htm/nomoreinformationisavailable.htmwmpdvd://dvddecoderdw15.exeWMPlayer/%s(WMPDXM)IconStreams[?L7A`??.@ Microsoft_WMP_70_CheckForOtherInstanceMutexwmploc.dllfirstPlayvideoManagerMenuvideoTitleSetMenutitlestopundefined:\video_tsSoftware\Microsoft\MediaPlayer\Player\DVDDVD.bookmarkDVD.titleDVD.chapter%c:\video_ts\video_ts.ifovideo_ts.ifoWMPCoreInROTSemaphoreWMPImage_PlaybackIconWMPImage_LogoWMPImage_AdBannerWMPImage_AlbumArtSmallWMPImage_AlbumArtLargeWMPImage_SeviceBrandLogoxH8__instance_id____dvd_title____dvd_chapter__wmpvcd://\MPEGAVAVSEQ%d.datMUSIC%d.datWM/MediaPrimaryClassIDWM/MediaSecondaryClassIDSyncTransferItemSyncTransferPercentSyncOverallPercentAlbumArt_ _Small.jpg_Large.jpg IsDeviceBusyTitlePlaylistTypeAuto$d#'/prefetch:1/prefetch:3/prefetch:4/prefetch:5/prefetch:6/prefetch:7/prefetch:7/prefetch:8/prefetch:9/prefetch:9/prefetch:10customOCXLayoutInvisible.wszinvisibleOCXLayoutFull.wszfullOCXLayoutMini.wszminiOCXLayoutNone.wsznoneWMDRMNET_REVOCATIONSAPLEVELDRMHeader.SubscriptionContentIDDRMHeader.ContentDistributorDRMHeader.SECURITYVERSIONDRMHeader.CIDDRMHeader.LAINFODRMHeader.KIDDRMHeader.LicenseStateData.PlaylistBurnLicenseStateData.CollaborativePlayLicenseStateData.CopyLicenseStateData.Transfer.NONSDMILicenseStateData.Transfer.SDMILicenseStateData.Print.redbookLicenseStateData.PlayLicenseStateData.ActionAllowed.PlaylistBurnActionAllowed.CollaborativePlayActionAllowed.CopyActionAllowed.BackupActionAllowed.Transfer.NONSDMIActionAllowed.Transfer.SDMIActionAllowed.Print.redbookActionAllowed.PlayActionAllowed.LIDRightsBaseLAURLIsDRMCachedIsDRMCollaborativePlayCopyBackupTransfer.NONSDMITransfer.SDMIPrint.redbookj MxO`,mF_l"͈NΆ !'p~(]b`;Ά/ ///...AspectRatioXAspectRatioYDeviceConformanceTemplateDRMBackupStatusDRMSDMICopyStatusDRMDeviceCopyStatusDRMCollaborativePlayStatusDRMSyncStatusDRMCDCopyStatusDRMPlayRightsStatusDRMProtectionStatusDRMBackupDRMSDMICopyEndDateDRMSDMICopyStartDateDRMSDMICopyCountDRMDeviceCopyEndDateDRMDeviceCopyStartDateDRMDeviceCopyCountDRMSyncEndDateDRMSyncStartDateDRMSyncCountDRMCDCopyEndDateDRMCDCopyStartDateDRMCDCopyCountDRMPlayEndDateDRMPlayStartDateDRMPlayCountDRMIsPersonalCopyDRMHasLicenseIs_TrustedIs_ProtectedWMDM/DeviceServiceProviderVendorWMDM/DeviceProtocolWMDM/DeviceVendorExtensionWMDM/DeviceFirmwareVersionWMDM/DeviceModelNameWMDM/SyncRelationshipIDWMDM/FormatsSupportedWMDM/DeviceFriendlyNameWMDM/SupportedDevicePropertiesWMDM/IsRepeatWMDM/MetaGenreWMDM/ParentalRatingWMDM/SyncTimeWMDM/HeightWMDM/WidthWMDM/PersistentUniqueIDWMDM/SyncIDWMDM/ProviderCopyrightWMDM/MediaOriginalBroadcastDateTimeWMDM/MediaOriginalChannelWMDM/MediaStationNameWMDM/MediaCreditsWMDM/SubTitleDescriptionWMDM/SubTitleWMDM/UserLastPlayTimeWMDM/AuthorDateWMDM/DevicePlayCountWMDM/PlayCountWMDM/UserRatingOnDeviceWMDM/UserRatingWMDM/UserEffectiveRatingWMDM/MediaClassSecondaryIDWMDM/MediaClassPrimaryIDWMDM/NonConsumableWMDM/BuyNowWMDM/AlbumArtWMDM/DurationWMDM/QualitySettingWMDM/BAhbin;nk Xfobx0;<  NumMethods(=REG_SZ)otpocN oProxyStubClsi(d32 o?vkt'p {B8DA6310-T19 -1 93C0AC0CA}H+3A;lh ]tC a,!(;SHU  &{33445B48-7DF7-425C-AD8F-0FC6D82F9F75'A AIWM@3MOperati`on25 o/; ./v - -y15D]+^+`+ÛAC@3-BE^ś3@847@-00F@9 B˛pIP@ɛ{MHMm`DM"!M5E9E5D-37FC-4D73-8BA8-FD4E16B28134Ma MAu LoMl`MyHndlO Mx7DMH M`8m0 `&xl;@KKa1 DJK mK`/K``K hT0/`KP`KD4&6D5562-EFJ482E-8CB 3-C5C@7A7DB6Ka* KMsT`clx`vJn N J`@Baa X6fHaoD4a0`!{2b2#'C 44|s3q 5 }v} p -L;5 6Xpu@ ;yqu 1qv0)u(1@TypeLibzXps80 Qq5EF&1[9PCP]\11[1P([Q4149 w@ vk01Versio1.! q@p0/lh0'`c#pq:11umPw;pya1taBC7430-EEC0-11D2-8201-00A0C9D`74842` IUplv^Ctow_qа 9 ?p1`"P+pqu{u%1@pq14aUq (gq Q{jpS6 6 1pw s)Q(AP 1q8-A14*F*jB7r)1P(qB520w)qnpqqq`h0q$1q$w$HX $J$C4643C-7811-46FA-A89A-768597BD7223 upu!IPeP_Shrng`ry;nacP1)lr7a u) 3hp ztpq5˹09 p/v3x s4q 5u(m{mhsts'[m4pP40&\_nUq_Ppu xWǁProxyStubClsid%(%k0c0_Ai2`kICB 0BsCI4mkcR9G_SZ7`<͛77327_u 787cQ6(Usx;99T96@F@2@55- i99!p11D-`Z1`38:4o7 nFA8nh*an1.` -jpH`!A$lh`Yc#`&C`ubu#auh,%v` u a0A& {340F4076-6856-48F9-B3C4-97B91B68D77EUIUPn`PsivUttsS`riteHlpb2$@h`[d  Ba'  NumMethodsi@`4@ ! o`8`-+pa {eoa/Ta728 G4 Q38 -U1E`9`7-`ġB`39` A"lhp` pt`MKHmKX K`K!K15 0-EECB08201D74842K4a. IqvdI`Ofo IIe1IX $s:Yu 1.Hpu q4 Uqq0q0qx <] C Pp%p$ b%kd32%qv1p %9 AN1qm-A%CP%~1NqP1&'qBQ520 qpq%%p0q%>c% %`01%$,45C8244-43A3-4E32-A368-65F073B76xF36%puI%s0alaip&NrpzgNeЈ!F& pp 1h qqx 3v2>&@Uw#y <4()  pS u QNs[ ppu; 0&y? 1u C]ppBp9UC[9265E[Ps]9Ѿ6928E107]59q10w712Xp0 m00'0: d4Ri;0;