/*    */ package org.ui;
/*    */ 
/*    */ import java.awt.Dimension;
/*    */ import java.awt.Toolkit;
/*    */ import java.io.BufferedReader;
/*    */ import java.io.InputStreamReader;
/*    */ import javax.swing.JEditorPane;
/*    */ import javax.swing.JFrame;
/*    */ import javax.swing.JOptionPane;
/*    */ import javax.swing.JScrollPane;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class Documentation
/*    */   extends JFrame
/*    */ {
/*    */   private static final long serialVersionUID = 4741160972916811991L;
/*    */   private JEditorPane textPane;
/*    */   
/*    */   public Documentation() {
/* 33 */     Dimension size = Toolkit.getDefaultToolkit().getScreenSize();
/*    */ 
/*    */     
/* 36 */     this.textPane = new JEditorPane();
/* 37 */     this.textPane.setContentType("text/html");
/* 38 */     this.textPane.setEditable(false);
/*    */     
/* 40 */     loadDocsFromFile();
/*    */ 
/*    */     
/* 43 */     setTitle("RTX-GYTEBOT - Documentation (also README)");
/* 44 */     getContentPane().add(new JScrollPane(this.textPane));
/* 45 */     setSize(size.width * 3 >> 2, size.height * 3 >> 2);
/* 46 */     setLocationRelativeTo(null);
/* 47 */     setVisible(true);
/*    */   }
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */   
/*    */   private void loadDocsFromFile() {
/*    */     try {
/* 56 */       BufferedReader reader = new BufferedReader(new InputStreamReader(getClass().getResourceAsStream("/data/docs.html")));
/*    */ 
/*    */       
/* 59 */       this.textPane.setText(reader.lines().reduce("", (A, B) -> String.valueOf(A) + B + "\n"));
/*    */       
/* 61 */       reader.close();
/* 62 */     } catch (Exception e) {
/*    */       
/* 64 */       JOptionPane.showMessageDialog(null, "Could not open or read the deocumentation", "Error - documentation", 0);
/* 65 */       e.printStackTrace();
/*    */     } 
/*    */   }
/*    */ }


/* Location:              /home/teridax/Projects/Gytebot/GYTEBOT.jar!/org/ui/Documentation.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */