src/Doc/JEdit/JEdit.thy
changeset 73151 f78a3be79ad1
parent 73150 c9a836122739
child 73162 c4b688abe2c4
equal deleted inserted replaced
73150:c9a836122739 73151:f78a3be79ad1
    71   \caption{The Isabelle/jEdit Prover IDE}
    71   \caption{The Isabelle/jEdit Prover IDE}
    72   \label{fig:isabelle-jedit}
    72   \label{fig:isabelle-jedit}
    73   \end{figure}
    73   \end{figure}
    74 
    74 
    75   Isabelle/jEdit (\figref{fig:isabelle-jedit}) consists of some plugins for
    75   Isabelle/jEdit (\figref{fig:isabelle-jedit}) consists of some plugins for
    76   the jEdit text editor, while preserving its general look-and-feel as far as
    76   the jEdit text editor, while preserving its overall look-and-feel. The main
    77   possible. The main plugin is called ``Isabelle'' and has its own menu
    77   plugin is called ``Isabelle'' and has its own menu \<^emph>\<open>Plugins~/ Isabelle\<close>
    78   \<^emph>\<open>Plugins~/ Isabelle\<close> with access to several actions and add-on panels (see
    78   with access to several actions and add-on panels (see also
    79   also \secref{sec:dockables}), as well as \<^emph>\<open>Plugins~/ Plugin Options~/
    79   \secref{sec:dockables}), as well as \<^emph>\<open>Plugins~/ Plugin Options~/ Isabelle\<close>
    80   Isabelle\<close> (see also \secref{sec:options}).
    80   (see also \secref{sec:options}).
    81 
    81 
    82   The options allow to specify a logic session name, but the same selector is
    82   The options allow to specify a logic session name, but the same selector is
    83   also accessible in the \<^emph>\<open>Theories\<close> panel (\secref{sec:theories}). After
    83   also accessible in the \<^emph>\<open>Theories\<close> panel (\secref{sec:theories}). After
    84   startup of the Isabelle plugin, the selected logic session image is provided
    84   startup of the Isabelle plugin, the selected logic session image is provided
    85   automatically by the Isabelle build tool @{cite "isabelle-system"}: if it is
    85   automatically by the Isabelle build tool @{cite "isabelle-system"}: if it is
   318 \<close>
   318 \<close>
   319 
   319 
   320 
   320 
   321 section \<open>GUI rendering\<close>
   321 section \<open>GUI rendering\<close>
   322 
   322 
   323 subsection \<open>Look-and-feel \label{sec:look-and-feel}\<close>
   323 text \<open>
   324 
   324   Isabelle/jEdit is a classic Java/AWT/Swing application: its GUI rendering
   325 text \<open>
   325   usually works well, but there are technical side-conditions on the Java
   326   jEdit is a Java/AWT/Swing application with the ambition to support
   326   window system and graphics engine. When researching problems and solutions
   327   ``native'' look-and-feel on all platforms, within the limits of what Java
   327   on the Web, it often helps to include other well-known Swing applications,
   328   provider and major operating systems allow (see also \secref{sec:problems}).
   328   notably IntelliJ IDEA and Netbeans.
   329 
   329 \<close>
   330   Isabelle/jEdit enables platform-specific look-and-feel by default as
   330 
   331   follows.
   331 
   332 
   332 subsection \<open>Portable and scalable look-and-feel\<close>
   333     \<^descr>[Linux:] The platform-independent \<^emph>\<open>Metal\<close> is used by default.
   333 
   334 
   334 text \<open>
   335     The Linux-specific \<^emph>\<open>GTK+\<close> look-and-feel often works, but the overall GTK
   335   In the past, \<^emph>\<open>system look-and-feels\<close> tried hard to imitate native GUI
   336     theme and options need to be selected to suite Java/AWT/Swing. Note that
   336   elements on specific platforms (Windows, macOS/Aqua, Linux/GTK+), but many
   337     the Java Virtual Machine has no direct influence of GTK rendering: it
   337   technical problems have accumulated in recent years (e.g.\ see
   338     happens within external C libraries.
   338   \secref{sec:problems}).
   339 
   339 
   340     \<^descr>[Windows:] Regular \<^emph>\<open>Windows\<close> look-and-feel is used by default.
   340   In 2021, we are de-facto back to \<^emph>\<open>portable look-and-feels\<close>, which also
   341 
   341   happen to be \emph{scalable} on high-resolution displays:
   342     \<^descr>[macOS:] Regular \<^emph>\<open>Mac OS X\<close> look-and-feel is used by default.
   342 
   343 
   343     \<^item> \<^verbatim>\<open>FlatLaf Light\<close> is the default for Isabelle/jEdit on all platforms. It
   344   Users may experiment with different Swing look-and-feels, but need to keep
   344     generally looks good and adapts itself pretty well to high-resolution
   345   in mind that this extra variance of GUI functionality often causes problems.
   345     displays.
   346   The platform-independent \<^emph>\<open>Metal\<close> look-and-feel should work smoothly on all
   346 
   347   platforms, although its is technically and stylistically outdated.
   347     \<^item> \<^verbatim>\<open>FlatLaf Dark\<close> is an alternative, but it requires further changes of
   348 
   348     editor colors by the user (or by the jEdit plugin \<^verbatim>\<open>Editor Scheme\<close>). Also
   349   Changing the look-and-feel in \<^emph>\<open>Global Options~/ Appearance\<close> may update the
   349     note that Isabelle/PIDE has its own extensive set of rendering options
   350   GUI only partially: a proper restart of Isabelle/jEdit is usually required.
   350     that need to be revisited.
   351 \<close>
   351 
   352 
   352     \<^item> \<^verbatim>\<open>Metal\<close> still works smoothly, although it is stylistically outdated. It
   353 
   353     can accommodate high-resolution displays via font properties (see below).
   354 subsection \<open>Displays with high resolution \label{sec:hdpi}\<close>
   354 
   355 
   355   Changing the look-and-feel in \<^emph>\<open>Global Options~/ Appearance\<close> often updates
   356 text \<open>
   356   the GUI only partially: a full restart of Isabelle/jEdit is required to see
   357   In 2020, we usually see displays with high resolution like ``Ultra HD'' /
   357   the true effect.
   358   ``4K'' at $3840 \times 2160$, or more. Old ``Full HD'' displays at $1920
   358 \<close>
   359   \times 1080$ pixels are still being used, but Java 11 font-rendering might
   359 
   360   look bad on it. GUI layouts are lagging behind the high resolution trends,
   360 
   361   and implicitly assume very old-fashioned $1024 \times 768$ or $1280 \times
   361 subsection \<open>Adjusting fonts\<close>
   362   1024$ screens and fonts with 12 or 14 pixels. Java and jEdit do provide
   362 
   363   reasonable support for high resolution, but this requires manual
   363 text \<open>
   364   adjustments as described below.
   364   The preferred font family for Isabelle/jEdit is \<^verbatim>\<open>Isabelle DejaVu\<close>: it is
   365 
   365   used by default for the main text area and various GUI elements. The default
   366   \<^medskip> The \<^bold>\<open>operating-system\<close> often provides some configuration for global
   366   font sizes attempt to deliver a usable application for common display types,
   367   scaling of text fonts, e.g.\ to enlarge it uniformly by $200\%$. This
   367   such as ``Full HD'' at $1920 \times 1080$ and ``Ultra HD'' at $3840 \times
   368   impacts regular GUI elements, when used with native look-and-feel: Linux
   368   2160$.
   369   \<^emph>\<open>GTK+\<close>, \<^emph>\<open>Windows\<close>, \<^emph>\<open>Mac OS X\<close>, respectively. Alternatively, it is
   369 
   370   possible to use the platform-independent \<^emph>\<open>Metal\<close> look-and-feel and change
   370   \<^medskip> Isabelle/jEdit provides various options to adjust font sizes in particular
   371   its main font sizes via jEdit options explained below. The Isabelle/jEdit
       
   372   \<^bold>\<open>application\<close> provides further options to adjust font sizes in particular
       
   373   GUI elements. Here is a summary of all relevant font properties:
   371   GUI elements. Here is a summary of all relevant font properties:
   374 
   372 
   375     \<^item> \<^emph>\<open>Global Options / Text Area / Text font\<close>: the main text area font,
   373     \<^item> \<^emph>\<open>Global Options / Text Area / Text font\<close>: the main text area font,
   376     which is also used as reference point for various derived font sizes,
   374     which is also used as reference point for various derived font sizes,
   377     e.g.\ the \<^emph>\<open>Output\<close> (\secref{sec:output}) and \<^emph>\<open>State\<close>
   375     e.g.\ the \<^emph>\<open>Output\<close> (\secref{sec:output}) and \<^emph>\<open>State\<close>
   381     left of the main text area, e.g.\ relevant for display of line numbers
   379     left of the main text area, e.g.\ relevant for display of line numbers
   382     (disabled by default).
   380     (disabled by default).
   383 
   381 
   384     \<^item> \<^emph>\<open>Global Options / Appearance / Button, menu and label font\<close> as well as
   382     \<^item> \<^emph>\<open>Global Options / Appearance / Button, menu and label font\<close> as well as
   385     \<^emph>\<open>List and text field font\<close>: this specifies the primary and secondary font
   383     \<^emph>\<open>List and text field font\<close>: this specifies the primary and secondary font
   386     for the \<^emph>\<open>Metal\<close> look-and-feel (\secref{sec:look-and-feel}).
   384     for the \<^emph>\<open>Metal\<close> look-and-feel.
   387 
   385 
   388     \<^item> \<^emph>\<open>Plugin Options / Isabelle / General / Reset Font Size\<close>: the main text
   386     \<^item> \<^emph>\<open>Plugin Options / Isabelle / General / Reset Font Size\<close>: the main text
   389     area font size for action @{action_ref "isabelle.reset-font-size"}, e.g.\
   387     area font size for action @{action_ref "isabelle.reset-font-size"}, e.g.\
   390     relevant for quick scaling like in common web browsers.
   388     relevant for quick scaling like in common web browsers.
   391 
   389 
   392     \<^item> \<^emph>\<open>Plugin Options / Console / General / Font\<close>: the console window font,
   390     \<^item> \<^emph>\<open>Plugin Options / Console / General / Font\<close>: the console window font,
   393     e.g.\ relevant for Isabelle/Scala command-line.
   391     e.g.\ relevant for Isabelle/Scala command-line.
   394 
       
   395   In \figref{fig:isabelle-jedit-hdpi} the \<^emph>\<open>Metal\<close> look-and-feel is configured
       
   396   with custom fonts at 36 pixels, and the main text area and console at 40
       
   397   pixels. This leads to fairly good rendering quality, despite the
       
   398   old-fashioned appearance of \<^emph>\<open>Metal\<close>.
       
   399 
       
   400   \begin{sidewaysfigure}[!htb]
       
   401   \begin{center}
       
   402   \includegraphics[width=\textwidth]{isabelle-jedit-hdpi}
       
   403   \end{center}
       
   404   \caption{Metal look-and-feel with custom fonts for high resolution}
       
   405   \label{fig:isabelle-jedit-hdpi}
       
   406   \end{sidewaysfigure}
       
   407 \<close>
   392 \<close>
   408 
   393 
   409 
   394 
   410 chapter \<open>Augmented jEdit functionality\<close>
   395 chapter \<open>Augmented jEdit functionality\<close>
   411 
   396 
   713 
   698 
   714 
   699 
   715 subsection \<open>PIDE resources via virtual file-systems\<close>
   700 subsection \<open>PIDE resources via virtual file-systems\<close>
   716 
   701 
   717 text \<open>
   702 text \<open>
   718   The jEdit file browser is docked by default, e.g. see
   703   The jEdit file browser is docked by default. It provides immediate access to
   719   \figref{fig:isabelle-jedit-hdpi} (left docking area). It provides immediate
   704   the local file-system, as well as important Isabelle resources via the
   720   access to the local file-system, as well as important Isabelle resources via
   705   \<^emph>\<open>Favorites\<close> menu. Environment variables like \<^verbatim>\<open>$ISABELLE_HOME\<close> are
   721   the \<^emph>\<open>Favorites\<close> menu. Environment variables like \<^verbatim>\<open>$ISABELLE_HOME\<close> are
       
   722   discussed in \secref{sec:local-files}. Virtual file-systems are more
   706   discussed in \secref{sec:local-files}. Virtual file-systems are more
   723   special: the idea is to present structured information like a directory
   707   special: the idea is to present structured information like a directory
   724   tree. The following URLs are offered in the \<^emph>\<open>Favorites\<close> menu, or by
   708   tree. The following URLs are offered in the \<^emph>\<open>Favorites\<close> menu, or by
   725   corresponding jEdit actions.
   709   corresponding jEdit actions.
   726 
   710