@startuml skinparam classAttributeIconSize 0 skinparam packageStyle rectangle skinparam dpi 50 ' PACKAGE mhuffman package "fr.iutfbleau.sae.mhuffman" { class CanonicalCode { +generateCodes(codesHuffman : Map) : Map +getCode(canonicalCodes : Map, value : int) : String +getLength(codesH : Map, value : int) : int } class ComparateurCanonique { +compare(entree1 : Map.Entry, entree2 : Map.Entry) : int } class ComparateurHuffmanNode { +compare(a : HuffmanNode, b : HuffmanNode) : int } class FrequencyTable { -freqR : int[] -freqG : int[] -freqB : int[] +FrequencyTable() +computeFromImage(img : RGBImage) : void +getRed() : int[] +getGreen() : int[] +getBlue() : int[] } class HuffmanNode { -value : int -frequence : int +HuffmanNode(value : int, frequence : int) +HuffmanNode(left : HuffmanNode, right : HuffmanNode) +isLeaf() : boolean +getFrequence() : int +getValue() : int +toString() : String } class HuffmanTree { -codes : Map +HuffmanTree(freq : int[]) +generateCodes() : Map +getCodes() : Map +getRoot() : HuffmanNode } ComparateurCanonique ..|> Comparator ComparateurHuffmanNode ..|> Comparator HuffmanTree "1" *-- "1" HuffmanNode : root HuffmanNode "1" o-- "0..1" HuffmanNode : left HuffmanNode "1" o-- "0..1" HuffmanNode : right HuffmanTree ..> ComparateurHuffmanNode CanonicalCode ..> ComparateurCanonique } ' PACKAGE mpif package "fr.iutfbleau.sae.mpif" { class Pixel { -r : int -g : int -b : int +Pixel(red:int, green:int, blue:int) +getR() : int +getG() : int +getB() : int +setR(r:int) : void +setG(g:int) : void +setB(b:int) : void } class RGBImage { -width : int -height : int +RGBImage(lar:int, haut:int) +getWidth() : int +getHeight() : int +setPixel(x:int, y:int, p:Pixel) : void +getPixel(x:int, y:int) : Pixel } class BitOutputStream { -octetEnConstruction : int -positionBit : int -fluxFerme : boolean +BitOutputStream(fluxSortie:OutputStream) +writeBit(bit:int) : void +writeBits(valeur:int, nombreBits:int) : void +writeBitString(codeBinaire:String) : void +flush() : void +fermerFlux() : void } class DecodeNode { +value : Integer +DecodeNode() +DecodeNode(left:DecodeNode, right:DecodeNode, value:Integer) +isLeaf() : boolean } class PIFWriter { +writeTOFile(filepath:String,image:RGBImage,canonR:Map,canonG:Map,canonB:Map) : void +writeHeader(out:BitOutputStream, width:int, height:int) : void +writeTables(out:BitOutputStream,canonR:Map,canonG:Map,canonB:Map) : void +encodePixels(out:BitOutputStream,image:RGBImage,canonRED:Map,canonGREEN:Map,canonBLUE:Map) : void } RGBImage "1" *-- "*" Pixel : pixels DecodeNode "1" o-- "0..1" DecodeNode : left DecodeNode "1" o-- "0..1" DecodeNode : right PIFWriter ..> RGBImage PIFWriter ..> BitOutputStream BitOutputStream --> OutputStream FrequencyTable ..> RGBImage } ' PACKAGE sae package "fr.iutfbleau.sae" { class JPanel class JFrame interface ActionListener{ +actionPerformed(e : ActionEvent) : void } class ConverterController { -abrHuffmanR : Map -abrHuffmanG : Map -abrHuffmanB : Map -canonRED : Map -canonGREEN : Map -canonBLUE : Map -outputPath : String -inputPath : String +ConverterController(fen:ConverterWindow, in:String, out:String) +loadImage(file:File) : void +computeFrequencies() : void +computeHuffman() : void +computeCanonical() : void +saveAsPIF(pathfile:String) : void +saveViaBtn() : void +conversionProcess() : void +getImage() : RGBImage } class ConverterWindow { -bottomPanel : JPanel +ConverterWindow() +setImagePreview(img:BufferedImage) : void +setFrequencyTable(freqR:int[], freqG:int[], freqB:int[]) : void +setHuffmanTable(r:Map, g:Map, b:Map) : void +setCanonicalTable(r:Map, g:Map, b:Map) : void +addSaveButton(controller:ConverterController) : void +removeSaveButton() : void } class CodeTablePanel{ -textHuffRouge : JTextArea -textHuffVert : JTextArea -textHuffBleu : JTextArea -textCanonRouge : JTextArea -textCanonVert : JTextArea -textCanonBleu : JTextArea +CodeTablePanel() +creerZoneTexte(titre : String) : JTextArea +updatesCodes(rouge : Map , vert : Map , bleu : Map) : void +updateCanonicalCodes(rouge : Map , vert : Map , bleu : Map) : void +mettreAJourZoneTexte(zone : JTextArea , codes : Map) : void } class FrequencyTablePanel{ -freqRouge : JTextArea -freqVert : JTextArea -freqBleu : JTextArea +FrequencyTablePAnel() +creationZoneText(titre : String) : JTextArea +updateFrequencies(freqR : int[] , freqG : int[] , freqB : int[]) } class ImagePreviewPanel{ -image : BufferedImage -MAX_WIDTH : int = 800 {static} -MAX_HEIGHT : int = 600 {static} +ImagePreviewPanel() +setImage(img : BufferedImage) : void } class ExportButtonListener { +ExportButtonListener(controller:ConverterController) +actionPerformed(e:ActionEvent) : void } class ThreadSauvegardePIF { -fichier : File +ThreadSauvegardePIF(controleur:ConverterController, fichier:File) +run() : void } class Convertisseur { +main(args:String[]) : void } class GestionErreur { +afficherErreur(message:String) : void {static} +afficherInfo(message:String) : void {static} } Convertisseur --> ConverterWindow Convertisseur --> ConverterController ConverterController "1" --> "1" RGBImage : image ConverterController "1" --> "1" FrequencyTable : frequencyTable ConverterController "1" --> "1" ConverterWindow : fen ConverterWindow *-- CodeTablePanel ConverterWindow *-- FrequencyTablePanel ConverterWindow *-- ImagePreviewPanel ExportButtonListener --> ConverterController ThreadSauvegardePIF --> ConverterController CodeTablePanel --|> JPanel FrequencyTablePanel --|> JPanel ImagePreviewPanel --|> JPanel ConverterWindow --|> JFrame ExportButtonListener ..|> ActionListener } @enduml