Skip to content

Instantly share code, notes, and snippets.

View LindsayBradford's full-sized avatar
🎓
Naval-gazing on design issues

Lindsay Bradford LindsayBradford

🎓
Naval-gazing on design issues
View GitHub Profile
@LindsayBradford
LindsayBradford / StrictJavaMVCChecking.java
Created May 1, 2012 12:38
Doing strict MVC checks that View and Control components of a Model truly are valid Viewers for updates, and Controlers for state changes within Java.
/* public interfaces for controller and view components to implement for a model */
public interface StrictModelViewer extends Observer {};
public interface StrictModelComtroller;
public class StrictModel extends Observable {
/* All model changing calls must come from classes implementing StrictModelController */
public void alterModelState() {
assert ReflectionUtilities.callerImplements(StrictModelController.class);
this.setChagned();
@LindsayBradford
LindsayBradford / build.gradle
Last active February 26, 2019 14:39
Gradle script for LaTeX pdf generation.
/*
* Usage:
* all LaTeX source files go in $rawDirectory
* base document to 'cook' should match content of $latexFile
* build script delivers resulting PDF file to $cookedDirectory
*/
defaultTasks 'full'
ext { documentBase = 'myBaseLaTeXFileName' }
@LindsayBradford
LindsayBradford / MouseReactiveTabbedPane.java
Created May 3, 2014 08:47
Reacting to Java Swing JTabbedPane mouse events over a tab.
import java.awt.event.MouseEvent;
import java.awt.event.MouseMotionAdapter;
import javax.swing.JTabbedPane;
import java.util.HashMap;
import java.util.Runnable;
public class MouseReactiveTabbedPane extends JTabbedPane {