java book store application

profileQINGYING LIU
hw1-project.zip

username-bookstore/.checkstyle

username-bookstore/.classpath

username-bookstore/.fbprefs

#FindBugs User Preferences #Wed Sep 17 04:06:17 PDT 2014 cloud_id=edu.umd.cs.findbugs.cloud.doNothingCloud detectorAppendingToAnObjectOutputStream=AppendingToAnObjectOutputStream|true detectorAtomicityProblem=AtomicityProblem|true detectorBCPMethodReturnCheck=BCPMethodReturnCheck|false detectorBadAppletConstructor=BadAppletConstructor|false detectorBadResultSetAccess=BadResultSetAccess|true detectorBadSyntaxForRegularExpression=BadSyntaxForRegularExpression|true detectorBadUseOfReturnValue=BadUseOfReturnValue|true detectorBadlyOverriddenAdapter=BadlyOverriddenAdapter|true detectorBooleanReturnNull=BooleanReturnNull|true detectorBuildInterproceduralCallGraph=BuildInterproceduralCallGraph|false detectorBuildObligationPolicyDatabase=BuildObligationPolicyDatabase|true detectorCallToUnsupportedMethod=CallToUnsupportedMethod|false detectorCalledMethods=CalledMethods|true detectorCheckCalls=CheckCalls|false detectorCheckExpectedWarnings=CheckExpectedWarnings|false detectorCheckImmutableAnnotation=CheckImmutableAnnotation|true detectorCheckRelaxingNullnessAnnotation=CheckRelaxingNullnessAnnotation|true detectorCheckTypeQualifiers=CheckTypeQualifiers|true detectorCloneIdiom=CloneIdiom|true detectorComparatorIdiom=ComparatorIdiom|true detectorConfusedInheritance=ConfusedInheritance|true detectorConfusionBetweenInheritedAndOuterMethod=ConfusionBetweenInheritedAndOuterMethod|true detectorCrossSiteScripting=CrossSiteScripting|true detectorDefaultEncodingDetector=DefaultEncodingDetector|true detectorDoInsideDoPrivileged=DoInsideDoPrivileged|true detectorDontCatchIllegalMonitorStateException=DontCatchIllegalMonitorStateException|true detectorDontIgnoreResultOfPutIfAbsent=DontIgnoreResultOfPutIfAbsent|true detectorDontUseEnum=DontUseEnum|true detectorDroppedException=DroppedException|true detectorDumbMethodInvocations=DumbMethodInvocations|true detectorDumbMethods=DumbMethods|true detectorDuplicateBranches=DuplicateBranches|true detectorEmptyZipFileEntry=EmptyZipFileEntry|true detectorEqStringTest=EqStringTest|false detectorEqualsOperandShouldHaveClassCompatibleWithThis=EqualsOperandShouldHaveClassCompatibleWithThis|true detectorExplicitSerialization=ExplicitSerialization|true detectorFieldItemSummary=FieldItemSummary|true detectorFinalizerNullsFields=FinalizerNullsFields|true detectorFindBadCast=FindBadCast|false detectorFindBadCast2=FindBadCast2|true detectorFindBadEqualsImplementation=FindBadEqualsImplementation|false detectorFindBadForLoop=FindBadForLoop|true detectorFindBugsSummaryStats=FindBugsSummaryStats|true detectorFindCircularDependencies=FindCircularDependencies|false detectorFindDeadLocalStores=FindDeadLocalStores|true detectorFindDoubleCheck=FindDoubleCheck|true detectorFindEmptySynchronizedBlock=FindEmptySynchronizedBlock|true detectorFindFieldSelfAssignment=FindFieldSelfAssignment|true detectorFindFinalizeInvocations=FindFinalizeInvocations|true detectorFindFloatEquality=FindFloatEquality|true detectorFindFloatMath=FindFloatMath|false detectorFindHEmismatch=FindHEmismatch|true detectorFindInconsistentSync2=FindInconsistentSync2|true detectorFindJSR166LockMonitorenter=FindJSR166LockMonitorenter|true detectorFindLocalSelfAssignment2=FindLocalSelfAssignment2|true detectorFindMaskedFields=FindMaskedFields|true detectorFindMismatchedWaitOrNotify=FindMismatchedWaitOrNotify|true detectorFindNakedNotify=FindNakedNotify|true detectorFindNonSerializableStoreIntoSession=FindNonSerializableStoreIntoSession|true detectorFindNonSerializableValuePassedToWriteObject=FindNonSerializableValuePassedToWriteObject|true detectorFindNonShortCircuit=FindNonShortCircuit|true detectorFindNullDeref=FindNullDeref|true detectorFindNullDerefsInvolvingNonShortCircuitEvaluation=FindNullDerefsInvolvingNonShortCircuitEvaluation|true detectorFindOpenStream=FindOpenStream|true detectorFindPuzzlers=FindPuzzlers|true detectorFindRefComparison=FindRefComparison|true detectorFindReturnRef=FindReturnRef|true detectorFindRoughConstants=FindRoughConstants|true detectorFindRunInvocations=FindRunInvocations|true detectorFindSelfComparison=FindSelfComparison|true detectorFindSelfComparison2=FindSelfComparison2|true detectorFindSleepWithLockHeld=FindSleepWithLockHeld|true detectorFindSpinLoop=FindSpinLoop|true detectorFindSqlInjection=FindSqlInjection|true detectorFindTwoLockWait=FindTwoLockWait|true detectorFindUncalledPrivateMethods=FindUncalledPrivateMethods|true detectorFindUnconditionalWait=FindUnconditionalWait|true detectorFindUninitializedGet=FindUninitializedGet|true detectorFindUnrelatedTypesInGenericContainer=FindUnrelatedTypesInGenericContainer|true detectorFindUnreleasedLock=FindUnreleasedLock|true detectorFindUnsatisfiedObligation=FindUnsatisfiedObligation|true detectorFindUnsyncGet=FindUnsyncGet|true detectorFindUseOfNonSerializableValue=FindUseOfNonSerializableValue|true detectorFindUselessControlFlow=FindUselessControlFlow|true detectorFormatStringChecker=FormatStringChecker|true detectorHugeSharedStringConstants=HugeSharedStringConstants|true detectorIDivResultCastToDouble=IDivResultCastToDouble|true detectorIncompatMask=IncompatMask|true detectorInconsistentAnnotations=InconsistentAnnotations|true detectorInefficientIndexOf=InefficientIndexOf|true detectorInefficientMemberAccess=InefficientMemberAccess|false detectorInefficientToArray=InefficientToArray|true detectorInfiniteLoop=InfiniteLoop|true detectorInfiniteRecursiveLoop=InfiniteRecursiveLoop|true detectorInfiniteRecursiveLoop2=InfiniteRecursiveLoop2|false detectorInheritanceUnsafeGetResource=InheritanceUnsafeGetResource|true detectorInitializationChain=InitializationChain|true detectorInitializeNonnullFieldsInConstructor=InitializeNonnullFieldsInConstructor|true detectorInstantiateStaticClass=InstantiateStaticClass|true detectorIntCast2LongAsInstant=IntCast2LongAsInstant|true detectorInvalidJUnitTest=InvalidJUnitTest|true detectorIteratorIdioms=IteratorIdioms|true detectorLazyInit=LazyInit|true detectorLoadOfKnownNullValue=LoadOfKnownNullValue|true detectorLockedFields=LockedFields|false detectorLostLoggerDueToWeakReference=LostLoggerDueToWeakReference|true detectorMethodReturnCheck=MethodReturnCheck|true detectorMethods=Methods|true detectorMultithreadedInstanceAccess=MultithreadedInstanceAccess|true detectorMutableLock=MutableLock|true detectorMutableStaticFields=MutableStaticFields|true detectorNaming=Naming|true detectorNoise=Noise|false detectorNoiseNullDeref=NoiseNullDeref|false detectorNoteAnnotationRetention=NoteAnnotationRetention|true detectorNoteCheckReturnValue=NoteCheckReturnValue|true detectorNoteCheckReturnValueAnnotations=NoteCheckReturnValueAnnotations|true detectorNoteDirectlyRelevantTypeQualifiers=NoteDirectlyRelevantTypeQualifiers|true detectorNoteJCIPAnnotation=NoteJCIPAnnotation|true detectorNoteNonNullAnnotations=NoteNonNullAnnotations|true detectorNoteNonnullReturnValues=NoteNonnullReturnValues|true detectorNoteSuppressedWarnings=NoteSuppressedWarnings|true detectorNoteUnconditionalParamDerefs=NoteUnconditionalParamDerefs|true detectorNumberConstructor=NumberConstructor|true detectorOptionalReturnNull=OptionalReturnNull|true detectorOverridingEqualsNotSymmetrical=OverridingEqualsNotSymmetrical|true detectorPreferZeroLengthArrays=PreferZeroLengthArrays|true detectorPublicSemaphores=PublicSemaphores|false detectorQuestionableBooleanAssignment=QuestionableBooleanAssignment|true detectorReadOfInstanceFieldInMethodInvokedByConstructorInSuperclass=ReadOfInstanceFieldInMethodInvokedByConstructorInSuperclass|true detectorReadReturnShouldBeChecked=ReadReturnShouldBeChecked|true detectorRedundantInterfaces=RedundantInterfaces|true detectorReflectiveClasses=ReflectiveClasses|true detectorRepeatedConditionals=RepeatedConditionals|true detectorResolveAllReferences=ResolveAllReferences|false detectorRuntimeExceptionCapture=RuntimeExceptionCapture|true detectorSerializableIdiom=SerializableIdiom|true detectorStartInConstructor=StartInConstructor|true detectorStaticCalendarDetector=StaticCalendarDetector|true detectorStringConcatenation=StringConcatenation|true detectorSuperfluousInstanceOf=SuperfluousInstanceOf|true detectorSuspiciousThreadInterrupted=SuspiciousThreadInterrupted|true detectorSwitchFallthrough=SwitchFallthrough|true detectorSynchronizationOnSharedBuiltinConstant=SynchronizationOnSharedBuiltinConstant|true detectorSynchronizeAndNullCheckField=SynchronizeAndNullCheckField|true detectorSynchronizeOnClassLiteralNotGetClass=SynchronizeOnClassLiteralNotGetClass|true detectorSynchronizingOnContentsOfFieldToProtectField=SynchronizingOnContentsOfFieldToProtectField|true detectorTestASM=TestASM|false detectorTestDataflowAnalysis=TestDataflowAnalysis|false detectorTestingGround=TestingGround|false detectorTrainFieldStoreTypes=TrainFieldStoreTypes|true detectorTrainNonNullAnnotations=TrainNonNullAnnotations|true detectorTrainUnconditionalDerefParams=TrainUnconditionalDerefParams|true detectorURLProblems=URLProblems|true detectorUncallableMethodOfAnonymousClass=UncallableMethodOfAnonymousClass|true detectorUnnecessaryMath=UnnecessaryMath|true detectorUnreadFields=UnreadFields|true detectorUseObjectEquals=UseObjectEquals|false detectorUselessSubclassMethod=UselessSubclassMethod|false detectorVarArgsProblems=VarArgsProblems|true detectorVolatileUsage=VolatileUsage|true detectorWaitInLoop=WaitInLoop|true detectorWrongMapIterator=WrongMapIterator|true detectorXMLFactoryBypass=XMLFactoryBypass|true detector_threshold=2 effort=default filter_settings=Medium|BAD_PRACTICE,CORRECTNESS,I18N,MALICIOUS_CODE,MT_CORRECTNESS,PERFORMANCE,SECURITY,STYLE|false|15 filter_settings_neg=EXPERIMENTAL,NOISE| run_at_full_build=true

username-bookstore/.pmd

false .ruleset AvoidDecimalLiteralsInBigDecimalConstructor Basic AvoidMultipleUnaryOperators Basic AvoidThreadGroup Basic AvoidUsingHardCodedIP Basic AvoidUsingOctalValues Basic BigIntegerInstantiation Basic BooleanInstantiation Basic BrokenNullCheck Basic CheckResultSet Basic ClassCastExceptionWithToArray Basic DoubleCheckedLocking Basic ForLoopShouldBeWhileLoop Basic JumbledIncrementer Basic MisplacedNullCheck Basic OverrideBothEqualsAndHashcode Basic ReturnFromFinallyBlock Basic UnconditionalIfStatement Basic CollapsibleIfStatements Basic Velocity ForLoopsMustUseBraces Braces IfElseStmtsMustUseBraces Braces IfStmtsMustUseBraces Braces WhileLoopsMustUseBraces Braces CloneMethodMustImplementCloneable Clone Implementation CloneThrowsCloneNotSupportedException Clone Implementation ProperCloneImplementation Clone Implementation CyclomaticComplexity Code Size ExcessiveClassLength Code Size ExcessiveMethodLength Code Size ExcessiveParameterList Code Size ExcessivePublicCount Code Size NcssConstructorCount Code Size NcssMethodCount Code Size NcssTypeCount Code Size NPathComplexity Code Size TooManyFields Code Size AssignmentInOperand Controversial AvoidAccessibilityAlteration Controversial AvoidUsingNativeCode Controversial AvoidUsingShortType Controversial AvoidUsingVolatile Controversial BooleanInversion Controversial CallSuperInConstructor Controversial DefaultPackage Controversial DoNotCallGarbageCollectionExplicitly Controversial DontImportSun Controversial NullAssignment Controversial OneDeclarationPerLine Controversial OnlyOneReturn Controversial SuspiciousOctalEscape Controversial UnnecessaryConstructor Controversial CouplingBetweenObjects Coupling ExcessiveImports Coupling LooseCoupling Coupling AbstractClassWithoutAbstractMethod Design AbstractClassWithoutAnyMethod Design AccessorClassGeneration Design AssignmentToNonFinalStatic Design AvoidConstantsInterface Design AvoidDeeplyNestedIfStmts Design AvoidInstanceofChecksInCatchClause Design AvoidProtectedFieldInFinalClass Design AvoidReassigningParameters Design BadComparison Design ClassWithOnlyPrivateConstructorsShouldBeFinal Design CloseResource Design CompareObjectsWithEquals Design ConfusingTernary Design ConstructorCallsOverridableMethod Design DefaultLabelNotLastInSwitchStmt Design EmptyMethodInAbstractClassShouldBeAbstract Design EqualsNull Design FinalFieldCouldBeStatic Design IdempotentOperations Design ImmutableField Design InstantiationToGetClass Design MissingBreakInSwitch Design MissingStaticMethodInNonInstantiatableClass Design NonCaseLabelInSwitchStatement Design NonStaticInitializer Design NonThreadSafeSingleton Design OptimizableToArrayCall Design PositionLiteralsFirstInComparisons Design PreserveStackTrace Design ReturnEmptyArrayRatherThanNull Design SimpleDateFormatNeedsLocale Design SimplifyBooleanExpressions Design SimplifyBooleanReturns Design SimplifyConditional Design SingularField Design SwitchDensity Design SwitchStmtsShouldHaveDefault Design TooFewBranchesForASwitchStatement Design UncommentedEmptyConstructor Design UncommentedEmptyMethod Design UnnecessaryLocalBeforeReturn Design UnsynchronizedStaticDateFormatter Design UseCollectionIsEmpty Design UseLocaleWithCaseConversions Design UseNotifyAllInsteadOfNotify Design EmptyCatchBlock Empty Code EmptyFinallyBlock Empty Code EmptyIfStmt Empty Code EmptyInitializer Empty Code EmptyStatementNotInLoop Empty Code EmptyStaticInitializer Empty Code EmptySwitchStatements Empty Code EmptySynchronizedBlock Empty Code EmptyTryBlock Empty Code EmptyWhileStmt Empty Code AvoidCallingFinalize Finalizer EmptyFinalizer Finalizer FinalizeDoesNotCallSuperFinalize Finalizer FinalizeOnlyCallsSuperFinalize Finalizer FinalizeOverloaded Finalizer FinalizeShouldBeProtected Finalizer DontImportJavaLang Import Statements DuplicateImports Import Statements ImportFromSamePackage Import Statements TooManyStaticImports Import Statements JUnitAssertionsShouldIncludeMessage JUnit JUnitSpelling JUnit JUnitTestsShouldIncludeAssert JUnit SimplifyBooleanAssertion JUnit TestClassWithoutTestCases JUnit UnnecessaryBooleanAssertion JUnit UseAssertEqualsInsteadOfAssertTrue JUnit UseAssertNullInsteadOfAssertTrue JUnit UseAssertSameInsteadOfAssertTrue JUnit AvoidAssertAsIdentifier Migration AvoidEnumAsIdentifier Migration ByteInstantiation Migration IntegerInstantiation Migration JUnit4SuitesShouldUseSuiteAnnotation Migration JUnit4TestShouldUseAfterAnnotation Migration JUnit4TestShouldUseBeforeAnnotation Migration JUnit4TestShouldUseTestAnnotation Migration JUnitUseExpected Migration LongInstantiation Migration ReplaceEnumerationWithIterator Migration ReplaceHashtableWithMap Migration ReplaceVectorWithList Migration ShortInstantiation Migration AbstractNaming Naming AvoidDollarSigns Naming AvoidFieldNameMatchingMethodName Naming AvoidFieldNameMatchingTypeName Naming BooleanGetMethodName Naming ClassNamingConventions Naming MethodNamingConventions Naming MethodWithSameNameAsEnclosingClass Naming MisleadingVariableName Naming PackageCase Naming SuspiciousConstantFieldName Naming SuspiciousEqualsMethodName Naming SuspiciousHashcodeMethodName Naming AddEmptyString Optimization AvoidArrayLoops Optimization LocalVariableCouldBeFinal Optimization MethodArgumentCouldBeFinal Optimization SimplifyStartsWith Optimization UnnecessaryWrapperObjectCreation Optimization UseArrayListInsteadOfVector Optimization UseArraysAsList Optimization UseStringBufferForStringAppends Optimization ArrayIsStoredDirectly Security Code Guidelines MethodReturnsInternalArray Security Code Guidelines AvoidCatchingNPE Strict Exceptions AvoidCatchingThrowable Strict Exceptions AvoidRethrowingException Strict Exceptions AvoidThrowingNewInstanceOfSameException Strict Exceptions AvoidThrowingNullPointerException Strict Exceptions AvoidThrowingRawExceptionTypes Strict Exceptions DoNotExtendJavaLangError Strict Exceptions DoNotThrowExceptionInFinally Strict Exceptions ExceptionAsFlowControl Strict Exceptions SignatureDeclareThrowsException Strict Exceptions AppendCharacterWithChar String and StringBuffer AvoidStringBufferField String and StringBuffer ConsecutiveLiteralAppends String and StringBuffer InefficientEmptyStringCheck String and StringBuffer InefficientStringBuffering String and StringBuffer InsufficientStringBufferDeclaration String and StringBuffer StringBufferInstantiationWithChar String and StringBuffer StringInstantiation String and StringBuffer StringToString String and StringBuffer UnnecessaryCaseChange String and StringBuffer UseEqualsToCompareStrings String and StringBuffer UseIndexOfChar String and StringBuffer UselessStringValueOf String and StringBuffer UseStringBufferLength String and StringBuffer UnnecessaryConversionTemporary Unnecessary UnnecessaryFinalModifier Unnecessary UnnecessaryParentheses Unnecessary UnnecessaryReturn Unnecessary UnusedNullCheckInEquals Unnecessary UselessOperationOnImmutable Unnecessary UselessOverridingMethod Unnecessary UnusedFormalParameter Unused Code UnusedLocalVariable Unused Code UnusedModifier Unused Code UnusedPrivateField Unused Code UnusedPrivateMethod Unused Code false false true

username-bookstore/.project

username-bookstore net.sourceforge.metrics.builder org.eclipse.jdt.core.javabuilder net.sf.eclipsecs.core.CheckstyleBuilder net.sourceforge.pmd.eclipse.plugin.pmdBuilder edu.umd.cs.findbugs.plugin.eclipse.findbugsBuilder org.eclipse.jdt.core.javanature net.sf.eclipsecs.core.CheckstyleNature edu.umd.cs.findbugs.plugin.eclipse.findbugsNature net.sourceforge.pmd.eclipse.plugin.pmdNature

username-bookstore/.settings/org.eclipse.jdt.core.prefs

eclipse.preferences.version=1 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=18 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=18 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=18 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_assignment=16 org.eclipse.jdt.core.formatter.alignment_for_binary_expression=18 org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=18 org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=18 org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 org.eclipse.jdt.core.formatter.blank_lines_after_package=1 org.eclipse.jdt.core.formatter.blank_lines_before_field=0 org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 org.eclipse.jdt.core.formatter.blank_lines_before_method=1 org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 org.eclipse.jdt.core.formatter.blank_lines_before_package=1 org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=same_line org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=same_line org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_block=same_line org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=same_line org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=same_line org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=same_line org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=same_line org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=same_line org.eclipse.jdt.core.formatter.brace_position_for_switch=same_line org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=same_line org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false org.eclipse.jdt.core.formatter.comment.format_block_comments=true org.eclipse.jdt.core.formatter.comment.format_header=true org.eclipse.jdt.core.formatter.comment.format_html=true org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true org.eclipse.jdt.core.formatter.comment.format_line_comments=true org.eclipse.jdt.core.formatter.comment.format_source_code=true org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true org.eclipse.jdt.core.formatter.comment.indent_root_tags=true org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=do not insert org.eclipse.jdt.core.formatter.comment.line_length=80 org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false org.eclipse.jdt.core.formatter.compact_else_if=true org.eclipse.jdt.core.formatter.continuation_indentation=4 org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=4 org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true org.eclipse.jdt.core.formatter.indent_empty_lines=false org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=true org.eclipse.jdt.core.formatter.indentation.size=4 org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=insert org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=insert org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=insert org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=insert org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=insert org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert org.eclipse.jdt.core.formatter.join_lines_in_comments=true org.eclipse.jdt.core.formatter.join_wrapped_lines=true org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false org.eclipse.jdt.core.formatter.lineSplit=95 org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true org.eclipse.jdt.core.formatter.tabulation.char=space org.eclipse.jdt.core.formatter.tabulation.size=4 org.eclipse.jdt.core.formatter.use_on_off_tags=false org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true

username-bookstore/.settings/org.eclipse.jdt.ui.prefs

eclipse.preferences.version=1 formatter_profile=_TCSS 305 Same Line Format formatter_settings_version=12

username-bookstore/bin/.DS_Store

username-bookstore/bin/appliation/BookstoreMain$1.class

package appliation;
synchronized class BookstoreMain$1 implements Runnable {
    void BookstoreMain$1(java.util.List);
    public void run();
}

username-bookstore/bin/appliation/BookstoreMain.class

package appliation;
public final synchronized class BookstoreMain {
    private void BookstoreMain();
    public static transient void main(String[]);
}

username-bookstore/bin/io/CredentialingLoader.class

package io;
public final synchronized class CredentialingLoader {
    private void CredentialingLoader();
    public static String login(String, char[]);
    public static boolean comparePasswords(char[], char[]);
    public static String register(String, char[], String);
    private static boolean checkIfUserExists(String);
}

username-bookstore/bin/io/InventoryLoader.class

package io;
public final synchronized class InventoryLoader {
    private void InventoryLoader();
    public static java.util.List readItemsFromFile(String);
    public static java.util.List readConfigurationFromFile(String);
}

username-bookstore/bin/model/Cart.class

package model;
public synchronized class Cart {
    public void Cart();
    public void add(ItemOrder);
    public void setMembership(boolean);
    public java.math.BigDecimal calculateTotal();
    public void clear();
    public int getCartSize();
    public String toString();
}

username-bookstore/bin/model/Item.class

package model;
public final synchronized class Item {
    public void Item(String, java.math.BigDecimal);
    public void Item(String, java.math.BigDecimal, int, java.math.BigDecimal);
    public java.math.BigDecimal getPrice();
    public int getBulkQuantity();
    public java.math.BigDecimal getBulkPrice();
    public boolean isBulk();
    public String toString();
    public boolean equals(Object);
    public int hashCode();
}

username-bookstore/bin/model/ItemOrder.class

package model;
public final synchronized class ItemOrder {
    public void ItemOrder(Item, int);
    public Item getItem();
    public int getQuantity();
    public String toString();
}

username-bookstore/bin/res/R$Colors.class

package res;
public synchronized class R$Colors {
    public static final java.awt.Color CONTENT_BG;
    public static final java.awt.Color HEADER_FOOTER_BG;
    public static final java.awt.Color CONTENT_TEXT;
    public static final java.awt.Color HEADER_FOOTER_TEXT;
    public static final java.awt.Color ERROR_TEXT_FIELD_BG;
    public static final java.awt.Color NO_ERROR_TEXT_FIELD_BG;
    static void <clinit>();
    public void R$Colors();
}

username-bookstore/bin/res/R$Dimensions.class

package res;
public synchronized class R$Dimensions {
    public static final int LF_LOGIN_ROWS = 2;
    public static final int LF_LOGIN_COLS = 2;
    public static final int LF_REGISTRATION_ROWS = 4;
    public static final int LF_REGISTRATION_COLS = 2;
    public static final int BF_ITEMS_COLS = 1;
    public static final int H_PADDING = 10;
    public static final int V_PADDING = 5;
    public static final int LF_TEXTFIELD_WIDTH = 10;
    public static final int BF_TEXTFIELD_TOTAL = 12;
    public static final int BF_TEXTFIELD_QUANITITY = 3;
    public void R$Dimensions();
}

username-bookstore/bin/res/R$Indicies.class

package res;
public synchronized class R$Indicies {
    public static final int IF_ITEM_NAME = 0;
    public static final int IF_ITEM_PRICE = 1;
    public static final int IF_ITEM_BULK_QUANITIY = 2;
    public static final int IF_ITEM_BULK_PRICE = 3;
    public static final int UF_USERNAME = 0;
    public static final int UF_PASSWORD = 1;
    public static final int UF_CAMPUS = 2;
    public void R$Indicies();
}

username-bookstore/bin/res/R$Strings.class

package res;
public synchronized class R$Strings {
    public static final String IO_CONFIG_FILE = config.txt;
    public static final String IO_CREDENTIALS_FILE = users.txt;
    public static final String IO_ICON_FILE = w.gif;
    public static final String IO_FILE_LOCATION = files/;
    public static final String IO_FILE_EXTENSION = .txt;
    public static final String IO_FILE_DELIMITER = ;;
    public static final String IO_FILE_COMMENT = #;
    public static final String ERROR_MSG_ILLEGAL_INVOKE = Only invoke when used as handler for JButton.;
    public static final String ERROR_MSG_PASSWORDS_NO_MATCH = Passwords must be the same.;
    public static final String ERROR_MSG_PASSWORDS_TOO_SHORT = Password must be at least 7 charachters long.;
    public static final String ERROR_MSG_USER_EXISTS = Unfortunatly that user name is already taken.;
    public static final String ERROR_MSG_EMPTY_FIELDS = All fields are required.;
    public static final String ERROR_MSG_TITLE = Oh No!;
    public static final String ERROR_MSG_CREDENTIALS = Login credentials incorrect. Plesae try again.;
    public static final String BF_TEXTFIELD_TOTAL = $0.00;
    public static final String BF_FRAME_TITLE = UW Bookstore;
    public static final String BF_LABEL_TOTAL = order total:;
    public static final String BF_BUTTON_CLEAR = Clear;
    public static final String BF_CHECKBOX_MEMBER = customer has store membership;
    public static final String LF_BUTTON_LOGIN = Login;
    public static final String LF_BUTTON_LOGIN_REGISTRATION = Register and Login;
    public static final String LF_BUTTON_REGISTER = Register;
    public static final String LF_LABEL_USERNAME = Username:;
    public static final String LF_LABEL_PASSWORD = Password:;
    public static final String LF_LABEL_PASSWORD_2 = Re-enter Password:;
    public static final String LF_LABEL_CAMPUS = Choose your Campus:;
    public static final String LF_LABEL_HEADER = Login to access store:;
    public void R$Strings();
}

username-bookstore/bin/res/R.class

package res;
public synchronized class R {
    public void R();
}

username-bookstore/bin/view/BookstoreFrame$1.class

package view;
synchronized class BookstoreFrame$1 extends java.awt.event.FocusAdapter {
    void BookstoreFrame$1(BookstoreFrame, model.Item, javax.swing.JTextField);
    public void focusLost(java.awt.event.FocusEvent);
}

username-bookstore/bin/view/BookstoreFrame.class

package view;
public final synchronized class BookstoreFrame extends javax.swing.JFrame {
    private static final long serialVersionUID = 505198377375189354;
    private static final java.awt.Toolkit KIT;
    private static final java.awt.Dimension SCREEN_SIZE;
    private final model.Cart myItems;
    private final java.util.Map myCampusInventories;
    private String myCurrentCampus;
    private final javax.swing.JTextField myTotal;
    private javax.swing.JPanel myItemsPanel;
    private final java.util.List myQuantities;
    static void <clinit>();
    public void BookstoreFrame(java.util.Map, String);
    private void setupGUI();
    private javax.swing.JPanel makeCampusPanel();
    private javax.swing.JPanel makeTotalPanel();
    private javax.swing.JPanel makeItemsPanel(java.util.List);
    private javax.swing.JPanel makeCheckBoxPanel();
    private void addItem(model.Item, javax.swing.JPanel);
    private void updateItem(model.Item, javax.swing.JTextField);
    private void updateTotal();
}

username-bookstore/bin/view/LoginFrame$AttemptLoginWorker.class

package view;
synchronized class LoginFrame$AttemptLoginWorker extends javax.swing.SwingWorker {
    private void LoginFrame$AttemptLoginWorker(LoginFrame);
    public String doInBackground();
    public void done();
}

username-bookstore/bin/view/LoginFrame$AttemptRegistrationWorker.class

package view;
synchronized class LoginFrame$AttemptRegistrationWorker extends javax.swing.SwingWorker {
    private String myCampus;
    private void LoginFrame$AttemptRegistrationWorker(LoginFrame);
    public String doInBackground();
    public void done();
}

username-bookstore/bin/view/LoginFrame$LoadInventoryWorker$1.class

package view;
synchronized class LoginFrame$LoadInventoryWorker$1 implements Runnable {
    void LoginFrame$LoadInventoryWorker$1(LoginFrame$LoadInventoryWorker);
    public void run();
}

username-bookstore/bin/view/LoginFrame$LoadInventoryWorker.class

package view;
synchronized class LoginFrame$LoadInventoryWorker extends javax.swing.SwingWorker {
    private final String myCampus;
    void LoginFrame$LoadInventoryWorker(LoginFrame, String);
    public java.util.Map doInBackground();
    public void done();
}

username-bookstore/bin/view/LoginFrame.class

package view;
public synchronized class LoginFrame extends javax.swing.JFrame {
    private static final long serialVersionUID = 1728929170437545812;
    private static final java.awt.Toolkit KIT;
    private static final java.awt.Dimension SCREEN_SIZE;
    private final javax.swing.JTextField myUserNameField;
    private final javax.swing.JPasswordField myPasswdField;
    private final javax.swing.JPasswordField myPasswdField2;
    private final javax.swing.JComboBox myCampusBox;
    private final javax.swing.JButton myLoginButton;
    private final javax.swing.JButton myRegisterButton;
    private final javax.swing.JPanel myFieldsPanel;
    static void <clinit>();
    public void LoginFrame(java.util.List);
    private void setupGUI();
    private void layoutComponents();
    private void assignActions();
    private void finalizeFrame();
    private String validateLoginFieldsEmpty();
    private String validateEmpty(javax.swing.JTextField);
    private void loginButtonAction(java.awt.event.ActionEvent);
    private void loginRegisterButtonAction(java.awt.event.ActionEvent);
    private void registerButtonAction(java.awt.event.ActionEvent);
}

username-bookstore/files/bothell.txt

Jolly Ranchers;0.50;6;2.50 Laffy Taffy;0.50;6;2.50 Snickers Bar;1.00 Heath Bar;1.00 Bottled Water;1.00 Turkey Sandwich;4.99 Tim's Chips;1.24

username-bookstore/files/config.txt

#place an * in front of the campus that the application should start with. #There should be no space in between the * and the campus name. #if multiple campuses have an *, the last one read will become the start campus. Bothell Seattle Tacoma

username-bookstore/files/seattle.txt

Apple iPad8;499.99 Nexus 6P;479.99 Nexus 5X;399.99 Samsung S6 Edge;649.99 Microsoft Surface Pro;899.99 Microsoft Surface;499.99

username-bookstore/files/tacoma.txt

UW Note pad;4.41;6;10.04 'Java Rules!' button;0.95;10;5.00 'Java Rules!' bumper sticker;0.99;20;8.95 Computer science pen;2.00 3 Ring Binder;9.99 Effective Java 3rd Ed;18.01 Core Java Vol I 11th Ed;54.99 Ipad;349.95 Surface Pro;399.00 Chromebook;399.00 Macbook Pro;1297.99

username-bookstore/files/users.txt

################################### # Users files. # # It is not a good idea to store # # passwords in a plain text file. # # We do it here to keep the # # application simple. # # # # uwnetid;passwd;campus # ################################### test;test;Tacoma test;Bothell;test

username-bookstore/files/w.gif

username-bookstore/src/.DS_Store

username-bookstore/src/appliation/BookstoreMain.java

username-bookstore/src/appliation/BookstoreMain.java

/*
 * TCSS 305 Assignment 2 - UW Bookstore
 */

package  appliation ;

import  io . InventoryLoader ;
import  java . awt . EventQueue ;
import  java . util . List ;
import  res . R ;
import  view . LoginFrame ;

/**
 * BookstoreMain provides the main method for a simple shopping cart GUI
 * displayer and calculator.
 * 
 *  @author  Marty Stepp
 *  @author  Daniel M. Zimmerman (Formatting and Comments)
 *  @author  Alan Fowler (Numerous changes including use of BigDecimal and file input)
 *  @author  Charles Bryan (Added multiple file loading options/changed name)
 *  @version  Autumn 2018
 */

public   final   class   BookstoreMain   {   

     /**
     * A private constructor, to prevent external instantiation.
     */
     private   BookstoreMain ()   {
     }

     /**
     * The main() method - displays and runs the bookstore GUI.
     * 
     *  @param  theArgs Command line arguments, ignored by this program.
     */
     public   static   void  main ( final   String ...  theArgs )   {
        
         final   List < String >  campusNames  =
                         InventoryLoader . readConfigurationFromFile ( R . Strings . IO_FILE_LOCATION
                                                              +  R . Strings . IO_CONFIG_FILE );
        
         EventQueue . invokeLater ( new   Runnable ()   {
            @ Override
             public   void  run ()   {
                 new   LoginFrame ( campusNames ). setVisible ( true );      
             }
         });

     }   // end main()

}   // end class BookstoreMain

username-bookstore/src/io/CredentialingLoader.java

username-bookstore/src/io/CredentialingLoader.java

package  io ;

import  java . io . FileWriter ;
import  java . io . IOException ;
import  java . io . PrintWriter ;
import  java . nio . file . Paths ;
import  java . util . Scanner ;
import  res . R ;

/**
 * A utility class for The shopping cart application. 
 * 
 * 
 *  @author  Charles Bryan
 *  @version  September 2019
 */
public   final   class   CredentialingLoader   {
    
     /**
     * A private constructor, to prevent external instantiation.
     */
     private   CredentialingLoader ()   {
        
     }
    
     /**
     * Attempts to match a user name and password with the information stored in the 
     * credentialing system. 
     * 
     *  @param  theUsername the user name to attempt
     *  @param  thePassword the password to attempt
     *  @return  the users campus or the empty String if login is unsuccessful 
     */
     public   static   String  login ( final   String  theUsername ,   final   char []  thePassword )   {
         String  result  =   "" ;
         try   ( Scanner  input  =   new   Scanner ( Paths . get ( R . Strings . IO_FILE_LOCATION
                                                    +  R . Strings . IO_CREDENTIALS_FILE )))   {
             while   ( input . hasNextLine ())   {
                 final   String  lineAsString  =  input . nextLine ();
                 if   ( ! lineAsString . startsWith ( R . Strings . IO_FILE_COMMENT ))   {
                     final   String []  parts  =  
                                    lineAsString . split ( R . Strings . IO_FILE_DELIMITER );
                     final   String  username  =  parts [ R . Indicies . UF_USERNAME ];
                     if   ( username . equals ( theUsername ))   {
                         final   char []  password  =  parts [ R . Indicies . UF_USERNAME ]. toCharArray ();
                         final   String  campus  =  parts [ R . Indicies . UF_CAMPUS ];
                         if   ( comparePasswords ( password ,  thePassword ))   {
                            result  =  campus ;
                             break ;
                         }
                     }  
                 }
             }
         }   catch   ( final   IOException  e )   {
            e . printStackTrace ();
         }   // no file
        
         return  result ;
     }
    
     /**
     * Given two passwords, return true iff both have the exact same number, characters, and 
     * order. 
     * 
     *  @param  pwd1 the first password
     *  @param  pwd2 the second password
     *  @return  true iff both have the exact same number, characters, and order, false 
     * otherwise
     */
     public   static   boolean  comparePasswords ( final   char []  pwd1 ,   final   char []  pwd2 )   {
         boolean  same  =  pwd1 . length  ==  pwd2 . length ;
         if   ( same )   {
             for   ( int  i  =   0 ;  i  <  pwd1 . length  &&  same ;  i ++ )   {
                same  &=  pwd1 [ i ]   ==  pwd2 [ i ];
             }
         }
         return  same ;
     }
    
     /**
     * Attempts to add a new user to the credentials file. Note, this method does not perform
     * validation. Any and all validation must be performed before calling this method. 
     * 
     *  @param  theUsername the user name to add
     *  @param  thePassword the password associated to the user name
     *  @param  theCampus the campus associated to the user name
     *  @return  empty String if written, an error message otherwise
     */
     public   static   String  register ( final   String  theUsername ,
                                   final   char []  thePassword ,
                                   final   String  theCampus )   {
         String  result  =   "" ;
         if   ( checkIfUserExists ( theUsername ))   {
            result  =  R . Strings . ERROR_MSG_USER_EXISTS ;
         }   else   {
             try   ( PrintWriter  printWriter  =   new   PrintWriter ( new   FileWriter (
                                                  Paths . get ( R . Strings . IO_FILE_LOCATION
                                                        +  R . Strings . IO_CREDENTIALS_FILE ).
                                                       toFile (),   true )))   {
                printWriter . append ( theUsername );
                printWriter . append ( R . Strings . IO_FILE_DELIMITER );
                printWriter . append ( theCampus );
                printWriter . append ( R . Strings . IO_FILE_DELIMITER );
                 for   ( final   char  c  :  thePassword )   {
                    printWriter . append ( c );
                 }
                printWriter . append ( System . lineSeparator ());
             }   catch   ( final   IOException  ioException )   {
                ioException . printStackTrace ();
                result  =  ioException . getMessage ();
             }  
         }
         return  result ;
     }
    
     /**
     * Attempts to find the user name stored in the credentialing system. 
     * 
     *  @param  theUsername the user name to look for
     *  @return  true if the user name already exists, false otherwise 
     */
     private   static   boolean  checkIfUserExists ( final   String  theUsername )   {
         boolean  found  =   false ;
         try   ( Scanner  input  =   new   Scanner ( Paths . get ( R . Strings . IO_FILE_LOCATION
                                                    +  R . Strings . IO_CREDENTIALS_FILE )))   {
             while   ( input . hasNextLine ()   &&  found )   {
                 final   String  lineAsString  =  input . nextLine ();
                 if   ( ! lineAsString . startsWith ( R . Strings . IO_FILE_COMMENT ))   {
                    found  =  theUsername . equals ( lineAsString . split (
                        R . Strings . IO_FILE_DELIMITER )[ R . Indicies . UF_USERNAME ]);
                 }
             }
         }   catch   ( final   IOException  e )   {
            e . printStackTrace ();
         }   // no file
        
         return  found ;
     }
  
}

username-bookstore/src/io/InventoryLoader.java

username-bookstore/src/io/InventoryLoader.java

/*
 * TCSS 305 Assignment 2 - UW Bookstore
 */

package  io ;

import  java . io . IOException ;
import  java . math . BigDecimal ;
import  java . nio . file . Paths ;
import  java . util . LinkedList ;
import  java . util . List ;
import  java . util . Scanner ;
import  model . Item ;
import  res . R ;

/**
 * A utility class for The shopping cart application. 
 * 
 *  @author  Charles Bryan
 *  @version  Autumn 2015
 */
public   final   class   InventoryLoader   {
    
     /**
     * A private constructor, to prevent external instantiation.
     */
     private   InventoryLoader ()   {
        
     }
    
     /**
     * Reads item information from a file and returns a List of Item objects.
     *  @param  theFile the name of the file to load into a List of Items
     *  @return  a List of Item objects created from data in an input file
     */
     public   static   List < Item >  readItemsFromFile ( final   String  theFile )   {
         final   List < Item >  items  =   new   LinkedList <> ();
        
         try   ( Scanner  input  =   new   Scanner ( Paths . get ( theFile )))   {  
             while   ( input . hasNextLine ())   {
                 final   String []  parts  =  input . nextLine (). split ( R . Strings . IO_FILE_DELIMITER );
                 final   String  itemName  =  parts [ R . Indicies . IF_ITEM_NAME ];
                 final   BigDecimal  itemPrice  =   new   BigDecimal ( parts [ R . Indicies . IF_ITEM_PRICE ]);
                 if   ( parts . length  >   2 )   {
                     final   int  bulkQuantity  =  
                                     Integer . valueOf ( parts [ R . Indicies . IF_ITEM_BULK_QUANITIY ]);
                     final   BigDecimal  bulkPrice  =  
                                     new   BigDecimal ( parts [ R . Indicies . IF_ITEM_BULK_PRICE ]);
                    items . add ( new   Item ( itemName ,  itemPrice ,  bulkQuantity ,  bulkPrice ));
                 }   else   {
                    items . add ( new   Item ( itemName ,  itemPrice ));
                 }
             }
         }   catch   ( final   IOException  e )   {
            e . printStackTrace ();
         }  
         return  items ;
     }
    
     /**
     * Reads item information from a file and returns a List of Item objects.
     *  @param  theFile the name of the file to load into a List of Items
     *  @return  a List of Item objects created from data in an input file
     */
     public   static   List < String >  readConfigurationFromFile ( final   String  theFile )   {
         final   List < String >  results  =   new   LinkedList <> ();
        
         try   ( Scanner  input  =   new   Scanner ( Paths . get ( theFile )))   {  
             while   ( input . hasNextLine ())   {
                 final   String  line  =  input . nextLine ();
                
                 if   ( ! line . startsWith ( R . Strings . IO_FILE_COMMENT ))   {
                    results . add ( line );
                 }
                
             }
         }   catch   ( final   IOException  e )   {
            e . printStackTrace ();
         }  
    
         return  results ;
     }     
}

username-bookstore/src/model/Cart.java

username-bookstore/src/model/Cart.java

// Finish and comment me!

package  model ;

import  java . math . BigDecimal ;

public   class   Cart   {


     public   Cart ()   {

     }
    

     public   void  add ( final   ItemOrder  theOrder )   {

     }

    
     public   void  setMembership ( final   boolean  theMembership )   {

     }


     public   BigDecimal  calculateTotal ()   {
        
         return   null ;
     }
    
    
     public   void  clear ()   {
        
     }
    
    
     public   int  getCartSize ()   {
         return   - 1 ;
     }


    @ Override
     public   String  toString ()   {
         return   null ;
     }

}

username-bookstore/src/model/Item.java

username-bookstore/src/model/Item.java

// Finish and comment me!

package  model ;

import  java . math . BigDecimal ;


public   final   class   Item   {


     public   Item ( final   String  theName ,   final   BigDecimal  thePrice )   {
   
     }


     public   Item ( final   String  theName ,   final   BigDecimal  thePrice ,   final   int  theBulkQuantity ,
                 final   BigDecimal  theBulkPrice )   {

     }


     public   BigDecimal  getPrice ()   {
         return   null ;
     }


     public   int  getBulkQuantity ()   {
         return   0 ;
     }


     public   BigDecimal  getBulkPrice ()   {
         return   null ;
     }

    
     public   boolean  isBulk ()   {
         return   false ;
     }


    @ Override
     public   String  toString ()   {

         return   null ;
     }

    @ Override
     public   boolean  equals ( final   Object  theOther )   {

         return   false ;
     }

    @ Override
     public   int  hashCode ()   {

         return   0 ;
     }

}

username-bookstore/src/model/ItemOrder.java

username-bookstore/src/model/ItemOrder.java

// Finish and comment me!

package  model ;


public   final   class   ItemOrder   {


     public   ItemOrder ( final   Item  theItem ,   final   int  theQuantity )   {
        

     }


     public   Item  getItem ()   {
         return   null ;
     }
    

     public   int  getQuantity ()   {
         return   0 ;
     }

    @ Override
     public   String  toString ()   {

         return   null ;
     }

}

username-bookstore/src/res/R.java

username-bookstore/src/res/R.java

package  res ;

import  java . awt . Color ;

/**
 * Resources class.
 * 
 * General convention: constant starts with the abbreviation for the class it is associated 
 * with.
 * 
 *  LoginFrame == LF
 *  BookstoreFrame == BS
 * 
 *  @author  Charles Bryan
 *  @version  7 September 2019
 */
public   class  R  {
    
     /**
     * Resource class for color schemes. 
     * 
     *  @author  Charles Bryan
     *  @version  7 September 2019
     */
     public   static   class   Colors   {
        
         /*
         * For the UW color palate and other UW branding information see
         * http://www.washington.edu/marketing/files/2012/09/WebColorPalette1.pdf 
         */
        
         /** The background color for content containers. */
         public   static   final   Color  CONTENT_BG  =   new   Color ( 199 ,   153 ,   0 );   // UW Gold

         /** The background color for headers and footers. */
         public   static   final   Color  HEADER_FOOTER_BG  =   new   Color ( 57 ,   39 ,   91 );   // UW Purple
        
         /** The text color for content containers. */
         public   static   final   Color  CONTENT_TEXT  =  HEADER_FOOTER_BG ;          
        
         /** The text color for headers and footers. */
         public   static   final   Color  HEADER_FOOTER_TEXT  =   Color . WHITE ;  
        
         /** The text color for background of text fields on error. */
         public   static   final   Color  ERROR_TEXT_FIELD_BG  =   Color . PINK ;  
        
         /** The text color for background of text fields on without error. */
         public   static   final   Color  NO_ERROR_TEXT_FIELD_BG  =   Color . WHITE ;  
        
     }
    
     /**
     * Resource class for Array index values. 
     * 
     * File Name nicknames: 
     *      Items File == IF
     *      Users File == UF
     *  @author  Charles Bryan
     *  @version  7 September 2019
     */
     public   static   class   Indicies   {
    
         /** The index of the Item name in the Items files. */
         public   static   final   int  IF_ITEM_NAME  =   0 ;
        
         /** The index of the Item price in the Items files. */
         public   static   final   int  IF_ITEM_PRICE  =   1 ;
        
         /** The index of the Item bulk quantity in the Items files. */
         public   static   final   int  IF_ITEM_BULK_QUANITIY  =   2 ;
        
         /** The index of the Item bulk price in the Items files. */
         public   static   final   int  IF_ITEM_BULK_PRICE  =   3 ;
        
         /** The index of the user name in the credentials files. */
         public   static   final   int  UF_USERNAME  =   0 ;
        
         /** The index of the password in the credentials files. */
         public   static   final   int  UF_PASSWORD  =   1 ;
        
         /** The index of the campus in the credentials files. */
         public   static   final   int  UF_CAMPUS  =   2 ;
     }

     /**
     * Resource class for dimensions. 
     * 
     *  @author  Charles Bryan
     *  @version  7 September 2019
     */
     public   static   class   Dimensions   {
        
         /** The number of rows in the Login Frame: status login. */
         public   static   final   int  LF_LOGIN_ROWS  =   2 ;
        
         /** The number of columns in the Login Frame: status login. */
         public   static   final   int  LF_LOGIN_COLS  =   2 ;
        
         /** The number of rows in the Login Frame: status register. */
         public   static   final   int  LF_REGISTRATION_ROWS  =   4 ;
        
         /** The number of columns in the Login Frame: status register. */
         public   static   final   int  LF_REGISTRATION_COLS  =   2 ;
        
         /** The number of columns for Item Panels in the Bookstore frame. */
         public   static   final   int  BF_ITEMS_COLS  =   1 ;
        
         /** General horizontal padding. */
         public   static   final   int  H_PADDING  =   10 ;
        
         /** General vertical padding. */
         public   static   final   int  V_PADDING  =   5 ;
        
         /** The width of the text fields in the Login GUI. */
         public   static   final   int  LF_TEXTFIELD_WIDTH  =   10 ;
        
         /** The width of the total text field in the BookStore GUI. */
         public   static   final   int  BF_TEXTFIELD_TOTAL  =   12 ;
        
         /** The width of the quantity text field in the BookStore GUI. */
         public   static   final   int  BF_TEXTFIELD_QUANITITY  =   3 ;
     }

     /**
     * Resource class for String Literals. 
     * 
     * General naming convention for strings associated with Swing Components:
     * 
     *  CLASS_COMPONENT_DESCRIPTION
     *  
     * 
     *  @author  Charles Bryan
     *  @version  7 September 2019
     */
     public   static   class   Strings   {
        
         /** The filename of the file containing the items to display in the cart. */
         public   static   final   String  IO_CONFIG_FILE  =   "config.txt" ;
        
         /** The filename of the file containing the user credentials. */
         public   static   final   String  IO_CREDENTIALS_FILE  =   "users.txt" ;
        
         /** The filename of the application icon. */
         public   static   final   String  IO_ICON_FILE  =   "w.gif" ;
        
         /** The local path of the configuration files. */
         public   static   final   String  IO_FILE_LOCATION  =   "files/" ;
        
         /** The file extension for text files. */
         public   static   final   String  IO_FILE_EXTENSION  =   ".txt" ;
        
         /** The delimiter used in text files. */
         public   static   final   String  IO_FILE_DELIMITER  =   ";" ;
        
         /** The character used to make a single line comment in text files. */
         public   static   final   String  IO_FILE_COMMENT  =   "#" ;
        
         /** Error message used when event handlers are implemented with method references. */
         public   static   final   String  ERROR_MSG_ILLEGAL_INVOKE  =  
                         "Only invoke when used as handler for JButton." ;
        
         /** Error message used when registration pwds don't match. */
         public   static   final   String  ERROR_MSG_PASSWORDS_NO_MATCH  =  
                         "Passwords must be the same." ;
        
         /** Error message used when registration pwds are too short. */
         public   static   final   String  ERROR_MSG_PASSWORDS_TOO_SHORT  =  
                         "Password must be at least 7 charachters long." ;
        
         /** Error message used when registration pwds are too short. */
         public   static   final   String  ERROR_MSG_USER_EXISTS  =  
                         "Unfortunatly that user name is already taken." ;
        
         /** Error message used when registration pwds done match. */
         public   static   final   String  ERROR_MSG_EMPTY_FIELDS  =  
                         "All fields are required." ;
        
         /** Error message for title in Error Popup. */
         public   static   final   String  ERROR_MSG_TITLE  =  
                         "Oh No!" ;
        
         /** Error message for incorrect login credentials. */
         public   static   final   String  ERROR_MSG_CREDENTIALS  =  
                         "Login credentials incorrect. Plesae try again." ;
        
         /** Text in Total text field. */
         public   static   final   String  BF_TEXTFIELD_TOTAL  =   "$0.00" ;
        
         /** Text in Total text field. */
         public   static   final   String  BF_FRAME_TITLE  =   "UW Bookstore" ;
        
         /** Message on total Label. */
         public   static   final   String  BF_LABEL_TOTAL  =   "order total:" ;
        
         /** Message on clear Button. */
         public   static   final   String  BF_BUTTON_CLEAR  =   "Clear" ;
        
         /** Message on membership check box. */
         public   static   final   String  BF_CHECKBOX_MEMBER  =   "customer has store membership" ;
        
         /** Message on Login Button during login. */
         public   static   final   String  LF_BUTTON_LOGIN  =   "Login" ;
        
         /** Message on Login Button during registration. */
         public   static   final   String  LF_BUTTON_LOGIN_REGISTRATION  =   "Register and Login" ;
        
         /** Message on Register Button. */
         public   static   final   String  LF_BUTTON_REGISTER  =   "Register" ;
        
         /** Message on user name Label. */
         public   static   final   String  LF_LABEL_USERNAME  =   "Username:" ;
        
         /** Message on password Label. */
         public   static   final   String  LF_LABEL_PASSWORD  =   "Password:" ;
        
         /** Message on second password name Label. */
         public   static   final   String  LF_LABEL_PASSWORD_2  =   "Re-enter Password:" ;
        
         /** Message on campus Label. */
         public   static   final   String  LF_LABEL_CAMPUS  =   "Choose your Campus:" ;
        
         /** Message on frame header Label. */
         public   static   final   String  LF_LABEL_HEADER  =   "Login to access store:" ;
     }
}

username-bookstore/src/view/BookstoreFrame.java

username-bookstore/src/view/BookstoreFrame.java

/*
 * TCSS 305 Assignment 2 - UW Bookstore
 */

package  view ;

import  java . awt . BorderLayout ;
import  java . awt . Dimension ;
import  java . awt . FlowLayout ;
import  java . awt . GridLayout ;
import  java . awt . Toolkit ;
import  java . awt . event . FocusAdapter ;
import  java . awt . event . FocusEvent ;
import  java . text . NumberFormat ;
import  java . util . LinkedList ;
import  java . util . List ;
import  java . util . Map ;
import  javax . swing . BorderFactory ;
import  javax . swing . ButtonGroup ;
import  javax . swing . ImageIcon ;
import  javax . swing . JButton ;
import  javax . swing . JCheckBox ;
import  javax . swing . JFrame ;
import  javax . swing . JLabel ;
import  javax . swing . JPanel ;
import  javax . swing . JRadioButton ;
import  javax . swing . JTextField ;
import  javax . swing . SwingConstants ;
import  model . Cart ;
import  model . Item ;
import  model . ItemOrder ;
import  res . R ;

/**
 * BookstoreFrame provides the user interface for a UW Bookstore program.
 * 
 *  @author  Marty Stepp
 *  @author  Daniel M. Zimmerman (Formatting and Comments)
 *  @author  Alan Fowler (Numerous changes to code and comments including use of BigDecimal)
 *  @author  Charles Bryan (Added radio buttons to change campus locations/changed name)
 *  @version  Autumn 2019
 */
public   final   class   BookstoreFrame   extends   JFrame   {

     /** The Serialization ID. */
     private   static   final   long  serialVersionUID  =   505198377375189354L ;

     // constants to capture screen dimensions
     /** A ToolKit. */
     private   static   final   Toolkit  KIT  =   Toolkit . getDefaultToolkit ();
    
     /** The Dimension of the screen. */
     private   static   final   Dimension  SCREEN_SIZE  =  KIT . getScreenSize ();

     /**
     * The shopping cart used by this GUI.
     */
     private   final   Cart  myItems ;
    
     /**
     * The map that stores each campus name and the campus's bookstore inventory.
     */
     private   final   Map < String ,   List < Item >>  myCampusInventories ;  

     /**
     * The map that stores each campus name and the campus's bookstore inventory.
     */
     private   String  myCurrentCampus ;
    
     /**
     * The text field used to display the total amount owed by the customer.
     */
     private   final   JTextField  myTotal ;
    
     /**
     * The panel that holds the item descriptions. Needed to add and remove on
     * the fly when the radio buttons change. 
     */
     private   JPanel  myItemsPanel ;

     /**
     * A List of the item text fields.
     */
     private   final   List < JTextField >  myQuantities ;
    
     /**
     * Initializes the bookstore GUI.
     * 
     *  @param  theCampusInventories The list of items.
     *  @param  theCurrentCampus The campus that is originally selected when 
     * the application starts. 
     */
     public   BookstoreFrame ( final   Map < String ,   List < Item >>  theCampusInventories ,  
                          final   String  theCurrentCampus )   {
         // create frame and order list
         super ();   // No title on the JFrame. We can set this later.
        
        myItems  =   new   Cart ();

         // set up text field with order total
        myTotal  =   new   JTextField ( R . Strings . BF_TEXTFIELD_TOTAL ,  
                                 R . Dimensions . BF_TEXTFIELD_TOTAL );
        
        myQuantities  =   new   LinkedList <> ();
        
        myCampusInventories  =  theCampusInventories ;
        myCurrentCampus  =  theCurrentCampus ;
        
        setupGUI ();
     }     

     /**
     * Setup the various parts of the GUI.
     * 
     */
     private   void  setupGUI ()   {
         // hide the default JFrame icon
         //final Image icon = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB_PRE);
        
        
         // replace the default JFrame icon
         final   ImageIcon  img  =  
                         new   ImageIcon ( R . Strings . IO_FILE_LOCATION  +  R . Strings . IO_ICON_FILE );
        setIconImage ( img . getImage ());
        
        setTitle ( R . Strings . BF_FRAME_TITLE );
        
        setDefaultCloseOperation ( JFrame . EXIT_ON_CLOSE );
        
        add ( makeTotalPanel (),   BorderLayout . NORTH );
        
        myItemsPanel  =  makeItemsPanel ( myCampusInventories . get ( myCurrentCampus ));  
        add ( myItemsPanel ,   BorderLayout . CENTER );
        
        add ( makeCheckBoxPanel (),   BorderLayout . SOUTH );

         // adjust size to just fit
        pack ();
        
         // make the GUI so that it cannot be resized by the user dragging a corner
        setResizable ( false );
        
         // position the frame in the center of the screen
        setLocation ( SCREEN_SIZE . width  /   2   -  getWidth ()   /   2 ,
                    SCREEN_SIZE . height  /   2   -  getHeight ()   /   2 );
        setVisible ( true );
     }
    
     /**
     * Creates the panel to hold the campus location radio buttons. 
     * 
     *  @return  The created JPanel
     */
     private   JPanel  makeCampusPanel ()   {
         final   JPanel  p  =   new   JPanel ();
        p . setBackground ( R . Colors . HEADER_FOOTER_BG );
        
         final   ButtonGroup  g  =   new   ButtonGroup ();
         for   ( final   Object  campus  :  myCampusInventories . keySet ())   {
             final   JRadioButton  rb  =   new   JRadioButton ( campus . toString ());
            rb . setForeground ( R . Colors . HEADER_FOOTER_TEXT );
            rb . setBackground ( R . Colors . HEADER_FOOTER_BG );
            rb . setSelected ( campus . equals ( myCurrentCampus ));
            g . add ( rb );
            p . add ( rb );
            
            rb . addActionListener ( ae  ->   {
                    myCurrentCampus  =  rb . getText ();
                    
                     //remove the old panel and add the new one
                    remove ( myItemsPanel );
                    myItemsPanel  =  makeItemsPanel ( myCampusInventories . get ( myCurrentCampus ));
                    add ( myItemsPanel ,   BorderLayout . CENTER );
                    
                     //clear previous data from the ShppingCart and
                     //update the total in the GUI
                    myItems . clear ();
                    updateTotal ();
                    
                     //redraw the UI with the new panel
                    pack ();
                    revalidate ();
                 }  
             );
         }  
         return  p ;
     }

     /**
     * Creates a panel to hold the total.
     * 
     *  @return  The created panel
     */
     private   JPanel  makeTotalPanel ()   {
         // tweak the text field so that users can't edit it, and set
         // its color appropriately

        myTotal . setEditable ( false );
        myTotal . setEnabled ( false );
        myTotal . setDisabledTextColor ( R . Colors . CONTENT_TEXT );

         // create the panel, and its label

         final   JPanel  totalPanel  =   new   JPanel ();
        totalPanel . setBackground ( R . Colors . HEADER_FOOTER_BG );
         final   JLabel  l  =   new   JLabel ( R . Strings . BF_LABEL_TOTAL );
        l . setForeground ( R . Colors . HEADER_FOOTER_TEXT );
        totalPanel . add ( l );
        totalPanel . add ( myTotal );
        
         final   JPanel  p  =   new   JPanel ( new   BorderLayout ());
        p . add ( makeCampusPanel (),   BorderLayout . NORTH );
        p . add ( totalPanel ,   BorderLayout . CENTER );
        
         return  p ;
     }

     /**
     * Creates a panel to hold the specified list of items.
     * 
     *  @param  theItems The items
     *  @return  The created panel
     */
     private   JPanel  makeItemsPanel ( final   List < Item >  theItems )   {
         final   JPanel  p  =   new   JPanel ( new   GridLayout ( theItems . size (),
                                                   R . Dimensions . BF_ITEMS_COLS ));
        p . setBorder ( BorderFactory .
                    createEmptyBorder ( R . Dimensions . V_PADDING ,  R . Dimensions . H_PADDING ,
                                      R . Dimensions . V_PADDING ,  R . Dimensions . H_PADDING ));
        p . setBackground ( R . Colors . CONTENT_BG );
         for   ( final   Item  item  :  theItems )   {
            addItem ( item ,  p );
         }

         return  p ;
     }

     /**
     * Creates and returns the checkbox panel.
     * 
     *  @return  the checkbox panel
     */
     private   JPanel  makeCheckBoxPanel ()   {
         final   JPanel  p  =   new   JPanel ();
        p . setBackground ( R . Colors . HEADER_FOOTER_BG );
        
         final   JButton  clearButton  =   new   JButton ( R . Strings . BF_BUTTON_CLEAR );
        clearButton . addActionListener ( theEvent  ->   {
            myItems . clear ();
             for   ( final   JTextField  field  :  myQuantities )   {
                field . setText ( "" );
             }
            updateTotal ();
         });
        p . add ( clearButton );
        
         final   JCheckBox  cb  =   new   JCheckBox ( R . Strings . BF_CHECKBOX_MEMBER );
        cb . setForeground ( R . Colors . HEADER_FOOTER_TEXT );
        cb . setBackground ( R . Colors . HEADER_FOOTER_BG );
        cb . addActionListener ( theEvent  ->   {
            myItems . setMembership ( cb . isSelected ());
            updateTotal ();
         });
        p . add ( cb );
        
         return  p ;
     }

     /**
     * Adds the specified product to the specified panel.
     * 
     *  @param  theItem The product to add.
     *  @param  thePanel The panel to add the product to.
     */
     private   void  addItem ( final   Item  theItem ,   final   JPanel  thePanel )   {
         final   JPanel  sub  =   new   JPanel ( new   FlowLayout ( FlowLayout . LEFT ));
        sub . setBackground ( R . Colors . CONTENT_BG );
         final   JTextField  quantity  =   new   JTextField ( R . Dimensions . BF_TEXTFIELD_QUANITITY );
        myQuantities . add ( quantity );
        quantity . setHorizontalAlignment ( SwingConstants . CENTER );
        quantity . addActionListener ( theEvent  ->  quantity . transferFocus ());
        quantity . addFocusListener ( new   FocusAdapter ()   {
            @ Override
             public   void  focusLost ( final   FocusEvent  theEvent )   {
                updateItem ( theItem ,  quantity );
             }
         });
        sub . add ( quantity );
         final   JLabel  l  =   new   JLabel ( theItem . toString ());
        l . setForeground ( R . Colors . HEADER_FOOTER_BG );
        sub . add ( l );
        thePanel . add ( sub );
     }

     /**
     * Updates the set of items by changing the quantity of the specified
     * product to the specified quantity.
     * 
     *  @param  theItem The product to update.
     *  @param  theQuantity The new quantity.
     */
     private   void  updateItem ( final   Item  theItem ,   final   JTextField  theQuantity )   {
         final   String  text  =  theQuantity . getText (). trim ();
         int  number ;
         try   {
            number  =   Integer . parseInt ( text );
             if   ( number  <   0 )   {
                 // disallow negative numbers
                 throw   new   NumberFormatException ();
             }
         }   catch   ( final   NumberFormatException  e )   {
            number  =   0 ;
            theQuantity . setText ( "" );
         }
        myItems . add ( new   ItemOrder ( theItem ,  number ));
        updateTotal ();
     }

     /**
     * Updates the total displayed in the window.
     */
     private   void  updateTotal ()   {
         final   double  total  =  myItems . calculateTotal (). doubleValue ();
        myTotal . setText ( NumberFormat . getCurrencyInstance (). format ( total ));
     }
}

// end of class BookstoreFrame

username-bookstore/src/view/LoginFrame.java

username-bookstore/src/view/LoginFrame.java


package  view ;

import  io . CredentialingLoader ;
import  io . InventoryLoader ;
import  java . awt . BorderLayout ;
import  java . awt . Cursor ;
import  java . awt . Dimension ;
import  java . awt . EventQueue ;
import  java . awt . FlowLayout ;
import  java . awt . GridLayout ;
import  java . awt . Toolkit ;
import  java . awt . event . ActionEvent ;
import  java . util . HashMap ;
import  java . util . List ;
import  java . util . Locale ;
import  java . util . Map ;
import  java . util . concurrent . ExecutionException ;
import  javax . swing . BorderFactory ;
import  javax . swing . JButton ;
import  javax . swing . JComboBox ;
import  javax . swing . JFrame ;
import  javax . swing . JLabel ;
import  javax . swing . JOptionPane ;
import  javax . swing . JPanel ;
import  javax . swing . JPasswordField ;
import  javax . swing . JTextField ;
import  javax . swing . SwingWorker ;
import  model . Item ;
import  res . R ;


/**
 * LoginFrame provides a user interface for login and registration.
 * 
 *  @author  Charles Bryan
 *  @version  7 September 2019
 */
public   class   LoginFrame   extends   JFrame   {

     /** The Serialization ID. */
     private   static   final   long  serialVersionUID  =   1728929170437545812L ;

     // constants to capture screen dimensions
     /** A ToolKit. */
     private   static   final   Toolkit  KIT  =   Toolkit . getDefaultToolkit ();
    
     /** The Dimension of the screen. */
     private   static   final   Dimension  SCREEN_SIZE  =  KIT . getScreenSize ();

     /** The text field used to enter the user name. */
     private   final   JTextField  myUserNameField ;

     /** The text field used to enter the password. */
     private   final   JPasswordField  myPasswdField ;

     /** The text field used to enter the password the 2nd time on registration. */
     private   final   JPasswordField  myPasswdField2 ;

     /** The combo box used to select the campus on registration. */
     private   final   JComboBox < String >  myCampusBox ;

     /** The button used to trigger login sequence. */
     private   final   JButton  myLoginButton ;

     /** The button used to trigger login registration. */
     private   final   JButton  myRegisterButton ;

     /** The panel that holds the Login/registration text fields. */
     private   final   JPanel  myFieldsPanel ;

     /**
     * Initializes the bookstore GUI.
     *  @param  theCampusList the list of university campuses
     */
     public   LoginFrame ( final   List < String >  theCampusList )   {
         super ();
        myUserNameField  =   new   JTextField ( R . Dimensions . LF_TEXTFIELD_WIDTH );
        myPasswdField  =   new   JPasswordField ( R . Dimensions . LF_TEXTFIELD_WIDTH );
        myPasswdField2  =   new   JPasswordField ( R . Dimensions . LF_TEXTFIELD_WIDTH );
        myCampusBox  =   new   JComboBox <> ( theCampusList . toArray ( new   String [ 0 ]));

        myFieldsPanel  =   new   JPanel ( new   GridLayout ( R . Dimensions . LF_LOGIN_ROWS ,
                                                  R . Dimensions . LF_LOGIN_COLS ));

        myLoginButton  =   new   JButton ( R . Strings . LF_BUTTON_LOGIN );
        myRegisterButton  =   new   JButton ( R . Strings . LF_BUTTON_REGISTER );

        setupGUI ();
     }

     /**
     * Setup the various parts of the GUI.
     */
     private   void  setupGUI ()   {
        layoutComponents ();
        assignActions ();
        finalizeFrame ();
     }
    
     /**
     * Layout the Swing components.
     */
     private   void  layoutComponents ()   {
         final   JPanel  pane  =   new   JPanel ( new   BorderLayout ());

         final   JPanel  header  =   new   JPanel ();
        header . setBackground ( R . Colors . HEADER_FOOTER_BG );
         final   JLabel  headerLabel  =   new   JLabel ( R . Strings . LF_LABEL_HEADER );
        headerLabel . setForeground ( R . Colors . HEADER_FOOTER_TEXT );
        header . add ( headerLabel );
        pane . add ( header ,   BorderLayout . NORTH );

        myFieldsPanel . setBorder ( BorderFactory .
                        createEmptyBorder ( R . Dimensions . V_PADDING ,  R . Dimensions . H_PADDING ,
                                           R . Dimensions . V_PADDING ,  R . Dimensions . H_PADDING ));
        myFieldsPanel . setBackground ( R . Colors . CONTENT_BG );

         final   JLabel  uNameLabel  =   new   JLabel ( R . Strings . LF_LABEL_USERNAME );
        uNameLabel . setForeground ( R . Colors . CONTENT_TEXT );
        myFieldsPanel . add ( uNameLabel );
        myFieldsPanel . add ( myUserNameField );

         final   JLabel  pwdLabel  =   new   JLabel ( R . Strings . LF_LABEL_PASSWORD );
        pwdLabel . setForeground ( R . Colors . CONTENT_TEXT );
        myFieldsPanel . add ( pwdLabel );
        myFieldsPanel . add ( myPasswdField );

        pane . add ( myFieldsPanel ,   BorderLayout . CENTER );

         final   JPanel  bottom  =   new   JPanel ( new   FlowLayout ( FlowLayout . RIGHT ));
        bottom . setBackground ( R . Colors . HEADER_FOOTER_BG );
        bottom . add ( myRegisterButton );
        bottom . add ( myLoginButton );

        pane . add ( bottom ,   BorderLayout . SOUTH );

        setContentPane ( pane );         
     }

     /**
     * Add Listeners to any GUI components that require them.
     */
     private   void  assignActions ()   {
        myLoginButton . addActionListener ( this :: loginButtonAction );
        myRegisterButton . addActionListener ( this :: registerButtonAction );
     }
    
     /**
     * Finalize this JFrame before making visible. 
     */
     private   void  finalizeFrame ()   {
         // make the GUI so that it cannot be resized by the user dragging a corner
        setResizable ( false );
        
         // position the frame in the center of the screen
        setLocation ( SCREEN_SIZE . width  /   2   -  getWidth ()   /   2 ,
                    SCREEN_SIZE . height  /   2   -  getHeight ()   /   2 );

        setDefaultCloseOperation ( JFrame . DISPOSE_ON_CLOSE );
        pack ();
        setVisible ( true );         
     }

     /**
     * Validate the Login Fields for empty. If the fields are empty, an error
     * message is returned, otherwise the empty String is returned.
     * 
     *  @return  an error message if the login fields are empty, otherwise the
     *         empty String
     */
     private   String  validateLoginFieldsEmpty ()   {
         String  result  =  validateEmpty ( myUserNameField );
         final   String  pwd  =  validateEmpty ( myPasswdField );
         if   ( result . isEmpty ())   {
            result  =  pwd ;
         }
         return  result ;
     }

     /**
     * Validate TextField for empty. If the field is empty, an error message is
     * returned, otherwise the empty String is returned.
     * 
     *  @param  theField The Field to validate.
     *  @return  an error message if the field is empty, otherwise the empty
     *         String.
     */
     private   String  validateEmpty ( final   JTextField  theField )   {
         String  result  =   "" ;
         if   ( theField . getText (). isEmpty ())   {
            theField . setBackground ( R . Colors . ERROR_TEXT_FIELD_BG );
            result  =  R . Strings . ERROR_MSG_EMPTY_FIELDS ;
         }   else   {
            theField . setBackground ( R . Colors . NO_ERROR_TEXT_FIELD_BG );
         }
         return  result ;
     }
    
     /* Event Handlers follow */

     /**
     * Event handler for the Login Button during login. This method is implicitly called when
     * the user presses the "Login" button.  It is not explicitly called in  this class: you 
     * will not find a method invocation for it.
     * 
     *  @param  theEvent the ActionEvent that triggered this method.
     */
     private   void  loginButtonAction ( final   ActionEvent  theEvent )   {
         if   ( theEvent . getSource (). getClass ()   !=   JButton . class )   {
             throw   new   IllegalStateException ( R . Strings . ERROR_MSG_ILLEGAL_INVOKE );
         }
         final   String  errorMsg  =  validateLoginFieldsEmpty ();
         if   ( errorMsg . isEmpty ())   {
             LoginFrame . this . setCursor ( Cursor . getPredefinedCursor ( Cursor . WAIT_CURSOR ));
            myRegisterButton . setEnabled ( false );
            myLoginButton . setEnabled ( false );
             new   AttemptLoginWorker (). execute ();
         }   else   {
             JOptionPane . showMessageDialog ( this ,  
                                          errorMsg ,  
                                          R . Strings . ERROR_MSG_TITLE ,
                                           JOptionPane . ERROR_MESSAGE );
         }
     }

     /**
     * Event handler for the Login Button during registration. This method is implicitly called
     * when the user presses the "Register and Login" button. It is not explicitly called in 
     * this class: you will not find a method invocation for it.
     * 
     *  @param  theEvent the ActionEvent that triggered this method.
     */
     private   void  loginRegisterButtonAction ( final   ActionEvent  theEvent )   {
         if   ( theEvent . getSource (). getClass ()   !=   JButton . class )   {
             throw   new   IllegalStateException ( R . Strings . ERROR_MSG_ILLEGAL_INVOKE );
         }
         final   String  errorMsg  =  validateLoginFieldsEmpty ();
         if   ( CredentialingLoader . comparePasswords ( myPasswdField . getPassword (),  
                                                 myPasswdField2 . getPassword ()))   {
             if   ( errorMsg . isEmpty ())   {
                 LoginFrame . this . setCursor ( Cursor . getPredefinedCursor ( Cursor . WAIT_CURSOR ));
                myRegisterButton . setEnabled ( false );
                myLoginButton . setEnabled ( false );
                 new   AttemptRegistrationWorker (). execute ();
             }   else   {
                 JOptionPane . showMessageDialog ( this ,  
                                              errorMsg ,  
                                              R . Strings . ERROR_MSG_TITLE ,
                                               JOptionPane . ERROR_MESSAGE );
             }
         }   else   {
             JOptionPane . showMessageDialog ( this ,  
                                          R . Strings . ERROR_MSG_PASSWORDS_NO_MATCH ,
                                          R . Strings . ERROR_MSG_TITLE ,
                                           JOptionPane . ERROR_MESSAGE );
         }
     }

     /**
     * Event handler for the Register Button. This method is implicitly called when
     * the user presses the "Register" button. It is not explicitly called in this class: you 
     * will not find a method invocation for it. 
     * 
     *  @param  theEvent the ActionEvent that triggered this method.
     */
     private   void  registerButtonAction ( final   ActionEvent  theEvent )   {
         if   ( theEvent . getSource (). getClass ()   !=   JButton . class )   {
             throw   new   IllegalStateException ( R . Strings . ERROR_MSG_ILLEGAL_INVOKE );
         }

        myRegisterButton . setVisible ( false );
        myFieldsPanel . setLayout ( new   GridLayout ( R . Dimensions . LF_REGISTRATION_ROWS ,
                                               R . Dimensions . LF_REGISTRATION_COLS ));
         final   JLabel  pwdLabel  =   new   JLabel ( R . Strings . LF_LABEL_PASSWORD_2 );
        pwdLabel . setForeground ( R . Colors . CONTENT_TEXT );
        myFieldsPanel . add ( pwdLabel );
        myFieldsPanel . add ( myPasswdField2 );

         final   JLabel  campusLabel  =   new   JLabel ( R . Strings . LF_LABEL_CAMPUS );
        campusLabel . setForeground ( R . Colors . CONTENT_TEXT );
        myFieldsPanel . add ( campusLabel );
        myFieldsPanel . add ( myCampusBox );

        myLoginButton . setText ( R . Strings . LF_BUTTON_LOGIN_REGISTRATION );
        myLoginButton . removeActionListener ( myLoginButton . getActionListeners ()[ 0 ]);
        myLoginButton . addActionListener ( this :: loginRegisterButtonAction );

        pack ();
     }
    
     /* Inner Classes follow */
    
     /**
     * A worker thread to attempt register user.
     * 
     * NOTE: THERE ARE NO ERRORS/BUGS IN THIS INNER CLASS
     * 
     * Operations that may take a long time to complete (like file I/O or network connections) 
     * should be performed in a thread separate from the user interface thread. This will keep 
     * your graphical user interface responsive to user interactions. 
     * 
     * This inner class starts a background thread to perform the file I/O operations found in
     * io.Credentialing.java
     * 
     *  @author  Charles Bryan
     *
     */
     private   class   AttemptRegistrationWorker   extends   SwingWorker < String ,   Integer >   {

         /** The campus of the user registering in. */
         private   String  myCampus ;
        
        @ Override
         public   String  doInBackground ()   {
            myCampus  =  myCampusBox . getItemAt ( myCampusBox . getSelectedIndex ());
             return   CredentialingLoader . register ( myUserNameField . getText (),  
                                             myPasswdField . getPassword (),
                                             myCampus );
         }

        @ Override
         public   void  done ()   {
             try   {
                 final   String  message  =  get ();
                 if   ( message . isEmpty ())   {
                     new   LoadInventoryWorker ( myCampus ). execute ();
                 }   else   {
                     LoginFrame . this . setCursor ( Cursor . getDefaultCursor ());
                    myRegisterButton . setEnabled ( true );
                    myLoginButton . setEnabled ( true );
                     JOptionPane . showMessageDialog ( LoginFrame . this ,  
                                                  message ,  
                                                  R . Strings . ERROR_MSG_TITLE ,
                                                   JOptionPane . ERROR_MESSAGE );
                 }  
             }   catch   ( final   InterruptedException  ex1 )   {
                ex1 . printStackTrace ();
             }   catch   ( final   ExecutionException  ex2 )   {
                ex2 . printStackTrace ();
             }
         }
     }  
    
     /**
     * A worker thread to attempt login.
     * 
     * NOTE: THERE ARE NO ERRORS/BUGS IN THIS INNER CLASS
     * 
     * Operations that may take a long time to complete (like file I/O or network connections) 
     * should be performed in a thread separate from the user interface thread. This will keep 
     * your graphical user interface responsive to user interactions. 
     * 
     * This inner class starts a background thread to perform the file I/O operations found in
     * io.Credentialing.java
     * 
     *  @author  Charles Bryan
     *
     */
     private   class   AttemptLoginWorker   extends   SwingWorker < String ,   Integer >   {

        @ Override
         public   String  doInBackground ()   {
             return   CredentialingLoader . login ( myUserNameField . getText (),  
                                             myPasswdField . getPassword ());
         }

        @ Override
         public   void  done ()   {
             try   {
                 final   String  campus  =  get ();
                 if   ( campus . isEmpty ())   {
                     LoginFrame . this . setCursor ( Cursor . getDefaultCursor ());
                    myRegisterButton . setEnabled ( true );
                    myLoginButton . setEnabled ( true );
                     JOptionPane . showMessageDialog ( LoginFrame . this ,  
                                                  R . Strings . ERROR_MSG_CREDENTIALS ,  
                                                  R . Strings . ERROR_MSG_TITLE ,
                                                   JOptionPane . ERROR_MESSAGE );
                 }   else   {
                     new   LoadInventoryWorker ( campus ). execute ();
                 }  
             }   catch   ( final   InterruptedException  ex1 )   {
                ex1 . printStackTrace ();
             }   catch   ( final   ExecutionException  ex2 )   {
                ex2 . printStackTrace ();
             }
         }
     }   

     /**
     * A worker thread to load the inventory files. 
     * 
     * NOTE: THERE ARE NO ERRORS/BUGS IN THIS INNER CLASS
     * 
     * Operations that may take a long time to complete (like file I/O or network connections) 
     * should be performed in a thread separate from the user interface thread. This will keep 
     * your graphical user interface responsive to user interactions. 
     * 
     * This inner class starts a background thread to perform the file I/O operations found in
     * io.InventoryLoader.java
     * 
     *  @author  Charles Bryan
     */
     private   class   LoadInventoryWorker   extends   SwingWorker < Map < String ,   List < Item >> ,   Integer >   {

         /** The campus of the user logging in. */
         private   final   String  myCampus ;
        
         /**
         * Creates a worked to load the inventory file. 
         *  @param  theCampus the campus of the user logging in
         */
         LoadInventoryWorker ( final   String  theCampus )   {
             super ();
            myCampus  =  theCampus ;
         }
        
        @ Override
         public   Map < String ,   List < Item >>  doInBackground ()   {
             final   Map < String ,   List < Item >>  inventories  =   new   HashMap <> ();
             final   List < String >  campusNames  =
                 InventoryLoader . readConfigurationFromFile ( R . Strings . IO_FILE_LOCATION
                                                                  +  R . Strings . IO_CONFIG_FILE );
             for   ( final   String  campusName  :  campusNames )   {
                inventories . put ( campusName ,   InventoryLoader .
                                readItemsFromFile ( R . Strings . IO_FILE_LOCATION
                                                    +  campusName . toLowerCase ( Locale . ENGLISH )
                                                    +  R . Strings . IO_FILE_EXTENSION ));
             }
             return  inventories ;
         }

        @ Override
         public   void  done ()   {
             LoginFrame . this . setCursor ( Cursor . getDefaultCursor ());
            myRegisterButton . setEnabled ( true );
            myLoginButton . setEnabled ( true );
             EventQueue . invokeLater ( new   Runnable ()   {
                @ Override
                 public   void  run ()   {
                     try   {
                         new   BookstoreFrame ( get (),  myCampus );
                         LoginFrame . this . dispose ();
                     }   catch   ( final   InterruptedException  ex1 )   {
                        ex1 . printStackTrace ();
                     }   catch   ( final   ExecutionException  ex2 )   {

                        ex2 . printStackTrace ();
                     }
                 }
             });
         }
     }
}

username-bookstore/support_files/tcss305_checkstyle_nextline.xml

username-bookstore/support_files/tcss305_checkstyle_nextline_test.xml

username-bookstore/support_files/tcss305_checkstyle_sameline.xml

username-bookstore/support_files/tcss305_checkstyle_sameline_test.xml

username-bookstore/support_files/tcss305_format_nextline.xml

username-bookstore/support_files/tcss305_format_sameline.xml